bfs

package
v0.5.10 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BfsFile

type BfsFile struct {
	Path string // Absolute path in BucketFS, starting with the base path, e.g. "/buckets/bfsdefault/default/"
	Name string // File name
	Size int    // File size in bytes
}

BfsFile represents a file in BucketFS.

type BucketFsAPI

type BucketFsAPI interface {
	// ListFiles lists all files in the configured directory recursively.
	ListFiles() ([]BfsFile, error)

	// FindAbsolutePath searches for a file with the given name in BucketFS and returns its absolute path.
	// If multiple files with the same name exist in different folders, this picks an arbitrary file and returns its path.
	// If no file with the given name exists, this will return an error.
	FindAbsolutePath(fileName string) (string, error)

	// Close removes any resources used by the BucketFS API like Exasol UDF SCRIPTS.
	Close() error
}

BucketFsAPI allows access to BucketFS. Users must call the [BucketFsAPI.Close] method to release resources after using the BucketFS API.

func CreateBucketFsAPI

func CreateBucketFsAPI(bucketFsBasePath string, ctx context.Context, db *sql.DB) (BucketFsAPI, error)

CreateBucketFsAPI creates an instance of BucketFsAPI.

The current implementation uses a Python UDF for accessing BucketFS. Call the [BucketFsAPI.Close] method to release resources after using the BucketFS API.

[impl -> dsn~configure-bucketfs-path~1].

type BucketFsMock

type BucketFsMock struct {
	mock.Mock
}

func CreateBucketFsMock added in v0.5.2

func CreateBucketFsMock() *BucketFsMock

func (*BucketFsMock) Close added in v0.5.3

func (mock *BucketFsMock) Close() error

func (*BucketFsMock) FindAbsolutePath

func (mock *BucketFsMock) FindAbsolutePath(fileName string) (absolutePath string, retErr error)

func (*BucketFsMock) ListFiles

func (mock *BucketFsMock) ListFiles() ([]BfsFile, error)

func (*BucketFsMock) SimulateAbsolutePath

func (m *BucketFsMock) SimulateAbsolutePath(fileName, absolutePath string)

func (*BucketFsMock) SimulateAbsolutePathError

func (m *BucketFsMock) SimulateAbsolutePathError(fileName string, err error)

func (*BucketFsMock) SimulateCloseFails added in v0.5.3

func (m *BucketFsMock) SimulateCloseFails(err error)

func (*BucketFsMock) SimulateCloseSuccess added in v0.5.3

func (m *BucketFsMock) SimulateCloseSuccess()

func (*BucketFsMock) SimulateFiles

func (m *BucketFsMock) SimulateFiles(files []BfsFile)

func (*BucketFsMock) SimulateFilesError

func (m *BucketFsMock) SimulateFilesError(err error)

Jump to

Keyboard shortcuts

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