storage

package
v0.0.1-alpha Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

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) Delete

func (s *GCSStorage) Delete(ctx context.Context, path string) error

func (*GCSStorage) Exists

func (s *GCSStorage) Exists(ctx context.Context, path string) (bool, error)

func (*GCSStorage) Get

func (s *GCSStorage) Get(ctx context.Context, path string) (io.ReadCloser, error)

func (*GCSStorage) List

func (s *GCSStorage) List(ctx context.Context, prefix string) ([]string, error)

func (*GCSStorage) Put

func (s *GCSStorage) Put(ctx context.Context, path string, reader io.Reader) 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) Delete

func (s *LocalStorage) Delete(ctx context.Context, path string) error

func (*LocalStorage) Exists

func (s *LocalStorage) Exists(ctx context.Context, path string) (bool, error)

func (*LocalStorage) Get

func (s *LocalStorage) Get(ctx context.Context, path string) (io.ReadCloser, error)

func (*LocalStorage) List

func (s *LocalStorage) List(ctx context.Context, prefix string) ([]string, error)

func (*LocalStorage) Put

func (s *LocalStorage) Put(ctx context.Context, path string, reader io.Reader) (err error)

type S3Storage

type S3Storage struct {
	// contains filtered or unexported fields
}

S3Storage is a storage backend that uses AWS S3.

func NewS3Storage

func NewS3Storage(ctx context.Context, bucket, prefix, region string) (*S3Storage, error)

NewS3Storage creates a new S3Storage backend.

func (*S3Storage) Delete

func (s *S3Storage) Delete(ctx context.Context, path string) error

func (*S3Storage) Exists

func (s *S3Storage) Exists(ctx context.Context, path string) (bool, error)

func (*S3Storage) Get

func (s *S3Storage) Get(ctx context.Context, path string) (io.ReadCloser, error)

func (*S3Storage) List

func (s *S3Storage) List(ctx context.Context, prefix string) ([]string, error)

func (*S3Storage) Put

func (s *S3Storage) Put(ctx context.Context, path string, reader io.Reader) error

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.

Jump to

Keyboard shortcuts

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