Documentation
¶
Index ¶
- Constants
- Variables
- type Backends
- type FileStorage
- func (s *FileStorage) Delete(ctx context.Context, key string) error
- func (s *FileStorage) Exists(ctx context.Context, key string) (bool, error)
- func (s *FileStorage) Get(ctx context.Context, key string) ([]byte, error)
- func (s *FileStorage) GetMultiple(ctx context.Context, filePaths []string) ([]Object, error)
- func (s *FileStorage) List(ctx context.Context, prefix string) ([]Object, error)
- func (s *FileStorage) Purge(ctx context.Context) error
- func (s *FileStorage) Put(ctx context.Context, key string, data []byte) error
- type Object
- type Option
- type Options
- type S3Options
- type S3Storage
- func (s *S3Storage) Delete(ctx context.Context, key string) error
- func (s *S3Storage) Exists(ctx context.Context, key string) (bool, error)
- func (s *S3Storage) Get(ctx context.Context, key string) ([]byte, error)
- func (s *S3Storage) GetMultiple(ctx context.Context, keys []string) ([]Object, error)
- func (s *S3Storage) List(ctx context.Context, prefix string) ([]Object, error)
- func (s *S3Storage) Purge(ctx context.Context) error
- func (s *S3Storage) Put(ctx context.Context, key string, data []byte) error
- type Storage
- type TracingStorage
Constants ¶
View Source
const (
DigitalOceanRegion = `us-east-1`
)
Variables ¶
View Source
var ( ErrNoS3ConfigProvided = errors.New("no S3 config provided") ErrUnsupportedBackends = errors.New("unsupported backends") ErrLocalStorageUnsafePrefix = errors.New("path prefix must contain at least two segments") )
View Source
var ErrNotExists = errors.New("file not exists")
Functions ¶
This section is empty.
Types ¶
type FileStorage ¶
type FileStorage struct {
// contains filtered or unexported fields
}
func NewFileStorage ¶
func NewFileStorage(dir string) *FileStorage
func (*FileStorage) GetMultiple ¶
type Option ¶ added in v0.2.0
type Option func(o *Options)
func WithBackends ¶ added in v0.2.0
func WithPrefix ¶ added in v0.2.0
func WithS3Config ¶ added in v0.2.0
func WithTracer ¶ added in v0.2.0
type S3Options ¶
type S3Storage ¶
type S3Storage struct {
// contains filtered or unexported fields
}
func NewS3Storage ¶
func (*S3Storage) GetMultiple ¶ added in v0.2.0
type Storage ¶
type Storage interface {
Put(ctx context.Context, key string, data []byte) error
Get(ctx context.Context, key string) ([]byte, error)
GetMultiple(ctx context.Context, keys []string) ([]Object, error)
Exists(ctx context.Context, key string) (bool, error)
Delete(ctx context.Context, key string) error
List(ctx context.Context, prefix string) ([]Object, error)
Purge(ctx context.Context) error
}
Storage represents main interface for file storage as key/value database
func NewStorage ¶ added in v0.2.0
type TracingStorage ¶ added in v0.2.0
type TracingStorage interface {
Storage
GetMultiple(ctx context.Context, keys []string) ([]Object, error)
}
func NewTracingStorage ¶ added in v0.2.0
func NewTracingStorage(storage Storage, tracer trace.Tracer) TracingStorage
Click to show internal directories.
Click to hide internal directories.