Documentation
¶
Index ¶
- Variables
- type LocalStorage
- func (s *LocalStorage) Delete(_ context.Context, path string) error
- func (s *LocalStorage) Exists(_ context.Context, path string) (bool, error)
- func (s *LocalStorage) List(_ context.Context, prefix string) ([]string, error)
- func (s *LocalStorage) Read(_ context.Context, path string) ([]byte, error)
- func (s *LocalStorage) Write(_ context.Context, path string, data []byte) error
- type S3Storage
- func (s *S3Storage) Delete(ctx context.Context, path string) error
- func (s *S3Storage) Exists(ctx context.Context, path string) (bool, error)
- func (s *S3Storage) List(ctx context.Context, prefix string) ([]string, error)
- func (s *S3Storage) Read(ctx context.Context, path string) ([]byte, error)
- func (s *S3Storage) Write(ctx context.Context, path string, data []byte) error
- type Storage
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("not found")
ErrNotFound is returned when a requested path does not exist in storage.
Functions ¶
This section is empty.
Types ¶
type LocalStorage ¶
type LocalStorage struct {
// contains filtered or unexported fields
}
LocalStorage implements Storage using the local filesystem.
func NewLocalStorage ¶
func NewLocalStorage(basePath string) (*LocalStorage, error)
NewLocalStorage creates a new LocalStorage rooted at basePath.
type S3Storage ¶
type S3Storage struct {
// contains filtered or unexported fields
}
S3Storage implements Storage using AWS S3.
func NewS3Storage ¶
NewS3Storage creates a new S3Storage.
type Storage ¶
type Storage interface {
Read(ctx context.Context, path string) ([]byte, error)
Write(ctx context.Context, path string, data []byte) error
Delete(ctx context.Context, path string) error
List(ctx context.Context, prefix string) ([]string, error)
Exists(ctx context.Context, path string) (bool, error)
}
Storage provides an abstraction over key-value style file storage.
Click to show internal directories.
Click to hide internal directories.