storage

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NotCached = errors.New("not cached")
View Source
var NotFoundError = errors.New("file not found")

Functions

This section is empty.

Types

type Cached

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

func NewCached

func NewCached(conf config.StorageConf) (*Cached, error)

func (*Cached) Delete

func (cs *Cached) Delete(path string) error

func (*Cached) LoadImage

func (cs *Cached) LoadImage(ctx context.Context, path string) (SourceImage, error)

func (*Cached) NewImage

func (cs *Cached) NewImage() SourceImage

func (*Cached) Upload

func (cs *Cached) Upload(path string, contents []byte) error

func (*Cached) UploadFile

func (cs *Cached) UploadFile(path string, r io.Reader) error

type S3Storage

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

func NewS3Storage

func NewS3Storage(b string, credentials string) (S3Storage, error)

func (*S3Storage) Delete

func (f *S3Storage) Delete(path string) error

func (*S3Storage) Open

func (f *S3Storage) Open(ctx context.Context, path string) (io.ReadCloser, error)

func (*S3Storage) Save

func (f *S3Storage) Save(path string, file io.Reader) error

type SourceImage

type SourceImage struct {
	Data []byte

	io.Closer
	// contains filtered or unexported fields
}

func (*SourceImage) Close

func (si *SourceImage) Close()

func (*SourceImage) Read

func (si *SourceImage) Read(b []byte) (n int, err error)

func (*SourceImage) ReadFrom

func (si *SourceImage) ReadFrom(r io.Reader) (n int64, err error)

func (*SourceImage) Reset

func (si *SourceImage) Reset()

Jump to

Keyboard shortcuts

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