blobstore

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2019 License: MIT Imports: 5 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrBucketNotExists indicates that requested bucket does not exist
	ErrBucketNotExists = &shared.EntityNotExistsError{Message: "requested bucket does not exist"}
	// ErrBlobNotExists indicates that requested blob does not exist
	ErrBlobNotExists = &shared.EntityNotExistsError{Message: "requested blob does not exist"}
	// ErrBlobSerialization indicates that a failure occurred in serializing blob
	ErrBlobSerialization = &shared.BadRequestError{Message: "failed to serialize blob"}
	// ErrBlobDeserialization indicates that a failure occurred in deserializing blob
	ErrBlobDeserialization = &shared.BadRequestError{Message: "failed to deserialize blob"}
)

Functions

This section is empty.

Types

type BucketMetadataResponse

type BucketMetadataResponse struct {
	Owner         string
	RetentionDays int
}

BucketMetadataResponse contains information relating to a bucket's configuration

type Client

type Client interface {
	Upload(ctx context.Context, bucket string, key blob.Key, blob *blob.Blob) error
	Download(ctx context.Context, bucket string, key blob.Key) (*blob.Blob, error)
	Exists(ctx context.Context, bucket string, key blob.Key) (bool, error)
	Delete(ctx context.Context, bucket string, key blob.Key) (bool, error)
	ListByPrefix(ctx context.Context, bucket string, prefix string) ([]blob.Key, error)
	BucketMetadata(ctx context.Context, bucket string) (*BucketMetadataResponse, error)
}

Client is used to operate on blobs in a blobstore

func NewMetricClient added in v0.5.2

func NewMetricClient(client Client, metricsClient metrics.Client) Client

NewMetricClient creates a new instance of Client that emits metrics

func NewRetryableClient added in v0.5.2

func NewRetryableClient(client Client, policy backoff.RetryPolicy, isRetryable backoff.IsRetryable) Client

NewRetryableClient creates a new instance of Client with retry policy

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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