s3

package
v0.0.0-...-dec19c8 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFount = errors.New("not found")

Functions

This section is empty.

Types

type Store

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

Store is media store that uses s3 compatible storage. It implements simple Get/Set operations, and in addition it can calculate sha256 checksum of already uploaded object.

TODO Seems like S3 API actually can calculate sha256 on server side, TODO but I couldn't get it working with minio. Need to investigate further.

func NewStore

func NewStore(cfg *StoreConfig) (*Store, error)

func (*Store) CalcSha256

func (s *Store) CalcSha256(ctx context.Context, name string) (string, error)

func (*Store) Get

func (s *Store) Get(ctx context.Context, name string) (io.ReadSeekCloser, int64, error)

func (*Store) Put

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

type StoreConfig

type StoreConfig struct {
	Logger       *zap.Logger
	Endpoint     string
	AccessKey    string
	SecretKey    string
	Bucket       string
	SSL          bool
	CreateBucket bool
}

Jump to

Keyboard shortcuts

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