blobstore

package
v0.0.0-...-9f60fe2 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlobStore

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

func NewBlobStore

func NewBlobStore(bucket string, s3Cfg aws.Config) *BlobStore

func (*BlobStore) Download

func (b *BlobStore) Download(ctx context.Context, remoteDir, remoteKey, localDir string, overwrite bool) error

func (*BlobStore) List

func (b *BlobStore) List(ctx context.Context, prefix string) ([]string, error)

func (*BlobStore) RemoteObjectMD5

func (b *BlobStore) RemoteObjectMD5(ctx context.Context, key string) (string, error)

func (*BlobStore) Upload

func (b *BlobStore) Upload(ctx context.Context, key string, content io.Reader, overwrite bool) error

func (*BlobStore) UploadFromPath

func (b *BlobStore) UploadFromPath(ctx context.Context, key, localPath string, overwrite bool) error

type CASStore

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

CASStore is a store that compares files by their content before syncing them. If the content is the same, the file is not copied locally to the new filename.

func (*CASStore) Download

func (s *CASStore) Download(ctx context.Context, remoteDir, remoteKey, localDir string, overwrite bool) error

func (*CASStore) List

func (s *CASStore) List(ctx context.Context, prefix string) ([]string, error)

func (*CASStore) RemoteObjectMD5

func (s *CASStore) RemoteObjectMD5(ctx context.Context, key string) (string, error)

func (*CASStore) Upload

func (s *CASStore) Upload(ctx context.Context, key string, content io.Reader, overwrite bool) error

func (*CASStore) UploadFromPath

func (s *CASStore) UploadFromPath(ctx context.Context, key, localPath string, overwrite bool) error

type Downloader

type Downloader interface {
	Download(ctx context.Context, w io.WriterAt, input *s3.GetObjectInput, options ...func(*manager.Downloader)) (n int64, err error)
}

type LocalBlobStore

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

func NewLocalBlobStore

func NewLocalBlobStore(rootDir string) *LocalBlobStore

func (*LocalBlobStore) Download

func (l *LocalBlobStore) Download(ctx context.Context, remoteDir, remoteKey, localDir string, overwrite bool) error

func (*LocalBlobStore) List

func (l *LocalBlobStore) List(ctx context.Context, prefix string) ([]string, error)

func (*LocalBlobStore) RemoteObjectMD5

func (l *LocalBlobStore) RemoteObjectMD5(ctx context.Context, key string) (string, error)

func (*LocalBlobStore) Upload

func (l *LocalBlobStore) Upload(ctx context.Context, key string, content io.Reader, overwrite bool) error

func (*LocalBlobStore) UploadFromPath

func (l *LocalBlobStore) UploadFromPath(ctx context.Context, key, localPath string, overwrite bool) error

type S3Client

type S3Client interface {
	ListObjectsV2(ctx context.Context, params *s3.ListObjectsV2Input, optFns ...func(*s3.Options)) (*s3.ListObjectsV2Output, error)
	HeadObject(ctx context.Context, params *s3.HeadObjectInput, optFns ...func(*s3.Options)) (*s3.HeadObjectOutput, error)
}

S3Client is an interface defining a subset of the S3 client methods used by BlobStore.

type Store

type Store interface {
	Download(ctx context.Context, remoteDir, remoteKey, localDir string, overwrite bool) error
	List(ctx context.Context, prefix string) ([]string, error)
	RemoteObjectMD5(ctx context.Context, key string) (string, error)
	Upload(ctx context.Context, key string, content io.Reader, overwrite bool) error
	UploadFromPath(ctx context.Context, key, localPath string, overwrite bool) error
}

type Uploader

type Uploader interface {
	Upload(ctx context.Context, input *s3.PutObjectInput, options ...func(*manager.Uploader)) (output *manager.UploadOutput, err error)
}

Jump to

Keyboard shortcuts

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