Documentation
¶
Index ¶
- type GCSStorage
- func (s *GCSStorage) Delete(ctx context.Context, path string) error
- func (s *GCSStorage) Exists(ctx context.Context, path string) (bool, error)
- func (s *GCSStorage) Get(ctx context.Context, path string) (io.ReadCloser, error)
- func (s *GCSStorage) List(ctx context.Context, prefix string) ([]string, error)
- func (s *GCSStorage) Put(ctx context.Context, path string, reader io.Reader) error
- type LocalStorage
- func (s *LocalStorage) Delete(ctx context.Context, path string) error
- func (s *LocalStorage) Exists(ctx context.Context, path string) (bool, error)
- func (s *LocalStorage) Get(ctx context.Context, path string) (io.ReadCloser, error)
- func (s *LocalStorage) List(ctx context.Context, prefix string) ([]string, error)
- func (s *LocalStorage) Put(ctx context.Context, path string, reader io.Reader) (err 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) Get(ctx context.Context, path string) (io.ReadCloser, error)
- func (s *S3Storage) List(ctx context.Context, prefix string) ([]string, error)
- func (s *S3Storage) Put(ctx context.Context, path string, reader io.Reader) error
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GCSStorage ¶
type GCSStorage struct {
// contains filtered or unexported fields
}
GCSStorage is a storage backend that uses Google Cloud Storage.
func NewGCSStorage ¶
func NewGCSStorage(ctx context.Context, bucket, prefix string) (*GCSStorage, error)
NewGCSStorage creates a new GCSStorage backend.
func (*GCSStorage) Get ¶
func (s *GCSStorage) Get(ctx context.Context, path string) (io.ReadCloser, error)
type LocalStorage ¶
type LocalStorage struct {
// contains filtered or unexported fields
}
LocalStorage is a storage backend that uses the local filesystem.
func NewLocalStorage ¶
func NewLocalStorage(baseDir string) (*LocalStorage, error)
NewLocalStorage creates a new LocalStorage rooted at baseDir.
func (*LocalStorage) Get ¶
func (s *LocalStorage) Get(ctx context.Context, path string) (io.ReadCloser, error)
type S3Storage ¶
type S3Storage struct {
// contains filtered or unexported fields
}
S3Storage is a storage backend that uses AWS S3.
func NewS3Storage ¶
NewS3Storage creates a new S3Storage backend.
type Storage ¶
type Storage interface {
// Put writes the data from reader to the specified path.
Put(ctx context.Context, path string, reader io.Reader) error
// Get returns a reader for the specified path.
// The caller is responsible for closing the reader.
Get(ctx context.Context, path string) (io.ReadCloser, error)
// List returns a list of paths under the specified prefix.
List(ctx context.Context, prefix string) ([]string, error)
// Delete removes the specified path.
Delete(ctx context.Context, path string) error
// Exists checks if the specified path exists.
Exists(ctx context.Context, path string) (bool, error)
}
Storage defines the interface for persisting and retrieving backup chunks.
Click to show internal directories.
Click to hide internal directories.