storage

package
v0.0.0-...-3cb8ae0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2023 License: BSD-2-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type B2Storage

type B2Storage struct {
	Client *b2.Client
	Bucket *b2.Bucket
}

func NewB2

func NewB2(backblazeID, backblazeAPIKey, bucketname string) (*B2Storage, error)

func (*B2Storage) Delete

func (s *B2Storage) Delete(filename string) error

TODO: Not implemented

func (*B2Storage) Fetch

func (s *B2Storage) Fetch(id string) (*os.File, error)

func (*B2Storage) Upload

func (s *B2Storage) Upload(path, desiredFilename string) error

type S3Storage

type S3Storage struct {
	BucketName   string
	S3Client     s3.Client
	StorageClass string
}

func NewS3

func NewS3(bucketName string) (*S3Storage, error)

func NewS3Endpoint

func NewS3Endpoint(bucketName string, endpoint string, apiID string, apiKey string) (*S3Storage, error)

func (*S3Storage) Delete

func (s *S3Storage) Delete(filename string) error

func (*S3Storage) Fetch

func (s *S3Storage) Fetch(id string) (*os.File, error)

FIXME: can probably rewrite a significant portion of this. Too long and complicated!

func (*S3Storage) Upload

func (s *S3Storage) Upload(path, desiredFilename string) error

type Storage

type Storage interface {
	Fetch(path string) (*os.File, error)
	Upload(path, desiredFilename string) error
	Delete(filename string) error
}

Jump to

Keyboard shortcuts

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