storage

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFTPHostRequired = errors.New("FTP storage requires host")
)
View Source
var (
	ErrInvalidArgument = errors.New("invalid argument")
)
View Source
var (
	ErrUnsupportedStorageType = errors.New("unsupported storage type")
)

Functions

This section is empty.

Types

type Backend added in v0.5.1

type Backend interface {
	// Upload uploads data to the specified path in the storage backend
	Upload(ctx context.Context, filename string, data io.Reader) error

	// Download downloads data from the specified path in the storage backend
	Download(ctx context.Context, filename string, data io.Writer) error

	// DeleteOldBackups removes old backups based on the retention policy
	DeleteOldBackups(ctx context.Context, maxCount int) error
}

Backend defines the interface for pluggable storage backends.

func New

func New(u *url.URL) (Backend, error)

New creates a new storage backend based on the configuration.

func NewFTPStorage added in v0.3.0

func NewFTPStorage(u *url.URL) (Backend, error)

func NewFilesystemStorage

func NewFilesystemStorage(u *url.URL) (Backend, error)

func NewS3Storage

func NewS3Storage(u *url.URL) (Backend, error)

Jump to

Keyboard shortcuts

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