filestore

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileStore

type FileStore struct {
	// contains filtered or unexported fields
}

func New

func New(_ context.Context, rootPath string, s3Bucket string) (*FileStore, error)

New creates a new FileStore instance, examples: rootPath: /var/lib/unstructured/ s3Bucket: unstructured-data-bucket

func (*FileStore) Delete

func (fs *FileStore) Delete(ctx context.Context, path string) error

func (*FileStore) Exists

func (fs *FileStore) Exists(ctx context.Context, path string) (bool, error)

func (*FileStore) GetFileURL

func (fs *FileStore) GetFileURL(ctx context.Context, path string) (string, error)

func (*FileStore) ListFilesInPath

func (fs *FileStore) ListFilesInPath(ctx context.Context, path string) ([]string, error)

Note: this function is not thread safe and is prone to race conditions as we do not have directory level locks implemented

func (*FileStore) Retrieve

func (fs *FileStore) Retrieve(ctx context.Context, path string) ([]byte, error)

Try to retrieve from local filesystem first, if not found, try to retrieve from S3 if the file is found in S3, it will be stored in the local cache as well

func (*FileStore) Store

func (fs *FileStore) Store(ctx context.Context, path string, data []byte) error

Store locally and then to S3

Jump to

Keyboard shortcuts

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