Help us shape the future of Go! Take the 2026 Go Developer Survey

storage

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filesystem

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

Filesystem stores files on the local filesystem.

func NewFilesystem

func NewFilesystem(root string) *Filesystem

func (*Filesystem) Delete

func (fs *Filesystem) Delete(_ context.Context, key string) error

func (*Filesystem) Get

func (fs *Filesystem) Get(_ context.Context, key string) (io.ReadCloser, error)

func (*Filesystem) Put

func (fs *Filesystem) Put(_ context.Context, key string, r io.Reader, _ int64) error

type S3

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

S3 stores files in an S3-compatible object store.

func NewS3

func NewS3(endpoint, bucket, region, accessKey, secretKey string, pathStyle bool) (*S3, error)

func (*S3) Delete

func (s *S3) Delete(ctx context.Context, key string) error

func (*S3) Get

func (s *S3) Get(ctx context.Context, key string) (io.ReadCloser, error)

func (*S3) Put

func (s *S3) Put(ctx context.Context, key string, r io.Reader, size int64) error

type Store

type Store interface {
	Put(ctx context.Context, key string, r io.Reader, size int64) error
	Get(ctx context.Context, key string) (io.ReadCloser, error)
	Delete(ctx context.Context, key string) error
}

Store abstracts subtitle file storage (local filesystem or S3-compatible).

func New

func New(cfg config.Config) (Store, error)

New creates a Store from the application config.

Jump to

Keyboard shortcuts

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