sharded

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2019 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Impl

type Impl interface {
	GetBlobFromPath(ctx context.Context, dirPath, filePath string, offset, length int64) ([]byte, error)
	PutBlobInPath(ctx context.Context, dirPath, filePath string, data []byte) error
	DeleteBlobInPath(ctx context.Context, dirPath, filePath string) error
	ReadDir(ctx context.Context, path string) ([]os.FileInfo, error)
}

type Storage

type Storage struct {
	Impl Impl

	RootPath string
	Suffix   string
	Shards   []int
}

func (Storage) DeleteBlob

func (s Storage) DeleteBlob(ctx context.Context, blobID blob.ID) error

func (Storage) GetBlob

func (s Storage) GetBlob(ctx context.Context, blobID blob.ID, offset, length int64) ([]byte, error)

func (Storage) GetShardedPathAndFilePath

func (s Storage) GetShardedPathAndFilePath(blobID blob.ID) (shardPath, filePath string)

func (Storage) ListBlobs

func (s Storage) ListBlobs(ctx context.Context, prefix blob.ID, callback func(blob.Metadata) error) error

func (Storage) PutBlob

func (s Storage) PutBlob(ctx context.Context, blobID blob.ID, data []byte) error

Jump to

Keyboard shortcuts

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