fileio

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 26, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package fileio provides the FileIO abstraction for reading Paimon table files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileIO

type FileIO interface {
	// Open returns a ReadCloser for the given path.
	Open(ctx context.Context, path string) (io.ReadCloser, error)

	// ReadAll reads the full contents of path into memory.
	ReadAll(ctx context.Context, path string) ([]byte, error)

	// List returns the immediate children of dir.
	List(ctx context.Context, dir string) ([]FileStatus, error)

	// Exists returns true if path exists.
	Exists(ctx context.Context, path string) (bool, error)

	// Close releases any resources held by the FileIO.
	Close() error
}

FileIO is the storage abstraction used by all Paimon readers.

func New

func New(ctx context.Context, path string, opts ...Option) (FileIO, error)

New creates a FileIO appropriate for the given path. Paths starting with "gs://" use GCS; everything else uses local filesystem.

type FileStatus

type FileStatus struct {
	Path    string
	Size    int64
	ModTime time.Time
	IsDir   bool
}

FileStatus describes a file or directory entry.

type Option

type Option func(*config)

Option configures a FileIO instance.

func WithCredentialsFile

func WithCredentialsFile(path string) Option

WithCredentialsFile sets a service-account key file for GCS auth.

func WithCredentialsJSON

func WithCredentialsJSON(json []byte) Option

WithCredentialsJSON sets raw service-account JSON for GCS auth.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL