Documentation ¶
Overview ¶
Package sharded implements common support for sharded blob providers, such as filesystem or webdav.
Index ¶
- type Impl
- type Storage
- func (s Storage) DeleteBlob(ctx context.Context, blobID blob.ID) error
- func (s Storage) GetBlob(ctx context.Context, blobID blob.ID, offset, length int64, ...) error
- func (s Storage) GetMetadata(ctx context.Context, blobID blob.ID) (blob.Metadata, error)
- func (s Storage) GetShardedPathAndFilePath(blobID blob.ID) (shardPath, filePath string)
- func (s Storage) ListBlobs(ctx context.Context, prefix blob.ID, callback func(blob.Metadata) error) error
- func (s Storage) PutBlob(ctx context.Context, blobID blob.ID, data blob.Bytes) error
- func (s Storage) SetTime(ctx context.Context, blobID blob.ID, n time.Time) error
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, output *gather.WriteBuffer) error GetMetadataFromPath(ctx context.Context, dirPath, filePath string) (blob.Metadata, error) PutBlobInPath(ctx context.Context, dirPath, filePath string, dataSlices blob.Bytes) error SetTimeInPath(ctx context.Context, dirPath, filePath string, t time.Time) error DeleteBlobInPath(ctx context.Context, dirPath, filePath string) error ReadDir(ctx context.Context, path string) ([]os.FileInfo, error) }
Impl must be implemented by underlying provided.
type Storage ¶
Storage provides common implementation of sharded storage.
func (Storage) DeleteBlob ¶
DeleteBlob implements blob.Storage.
func (Storage) GetBlob ¶
func (s Storage) GetBlob(ctx context.Context, blobID blob.ID, offset, length int64, output *gather.WriteBuffer) error
GetBlob implements blob.Storage.
func (Storage) GetMetadata ¶ added in v0.6.0
GetMetadata implements blob.Storage.
func (Storage) GetShardedPathAndFilePath ¶
GetShardedPathAndFilePath returns the path of the shard and file name within the shard for a given blob ID.
func (Storage) ListBlobs ¶
func (s Storage) ListBlobs(ctx context.Context, prefix blob.ID, callback func(blob.Metadata) error) error
ListBlobs implements blob.Storage.
Click to show internal directories.
Click to hide internal directories.