storage

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrStreamExists = errors.New("stream already exists")

Functions

func SetLogger

func SetLogger(l *zap.SugaredLogger)

Types

type LocalStorage

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

func Local

func Local(path string) LocalStorage

func (LocalStorage) Delete

func (s LocalStorage) Delete(sdHash string) error

func (LocalStorage) Path

func (s LocalStorage) Path() string

type S3Configuration

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

func S3Configure

func S3Configure() *S3Configuration

func (*S3Configuration) Bucket

func (c *S3Configuration) Bucket(b string) *S3Configuration

Bucket is a bucket name for storing data.

func (*S3Configuration) CreateBucket

func (c *S3Configuration) CreateBucket() *S3Configuration

CreateBucket will attempt to create a configured bucket at initialization. Should be skipped for wasabi storage.

func (*S3Configuration) Credentials

func (c *S3Configuration) Credentials(accessKey, secretKey string) *S3Configuration

Credentials set access key and secret key for accessing S3 bucket.

func (*S3Configuration) DisableSSL

func (c *S3Configuration) DisableSSL() *S3Configuration

DisableSSL will use plain HTTP for accessing S3.

func (*S3Configuration) Endpoint

func (c *S3Configuration) Endpoint(e string) *S3Configuration

Endpoint is S3 HTTP API server address.

func (*S3Configuration) Name

Name is storage type name (for internal use)

func (*S3Configuration) Region

func (c *S3Configuration) Region(r string) *S3Configuration

Region is a bucked region setting.

type S3Driver

type S3Driver struct {
	*S3Configuration
	// contains filtered or unexported fields
}

func InitS3Driver

func InitS3Driver(cfg *S3Configuration) (*S3Driver, error)

func (*S3Driver) Delete

func (s *S3Driver) Delete(streamTID string) error

func (*S3Driver) GetFragment

func (s *S3Driver) GetFragment(streamTID, name string) (StreamFragment, error)

func (*S3Driver) GetURL

func (s *S3Driver) GetURL(streamTID string) string

func (*S3Driver) Name

func (s *S3Driver) Name() string

func (*S3Driver) Put

func (s *S3Driver) Put(stream *library.Stream, overwrite bool) error

func (*S3Driver) PutWithContext

func (s *S3Driver) PutWithContext(ctx context.Context, stream *library.Stream, overwrite bool) error

type StreamFragment

type StreamFragment interface {
	io.ReadCloser
}

Jump to

Keyboard shortcuts

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