store

package
v0.0.1-alpha1 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSS3Storage

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

func (AWSS3Storage) DownloadFile

func (s AWSS3Storage) DownloadFile(path, name string) ([]byte, error)

func (AWSS3Storage) MakeDownloadURL

func (s AWSS3Storage) MakeDownloadURL(path, name string) string

MakeDownloadURL path is directory, name is the file name. It is downloaded in the 'data-market' bucket

func (AWSS3Storage) MakeRandomFilename

func (s AWSS3Storage) MakeRandomFilename() string

MakeRandomFilename Create filename with UUID

func (AWSS3Storage) UploadFile

func (s AWSS3Storage) UploadFile(path, name string, data []byte) error

UploadFile path is directory, name is the file name. It is stored in the 'data-market' bucket

type Storage

type Storage interface {
	UploadFile(path, name string, data []byte) error
	MakeDownloadURL(path, name string) string
	MakeRandomFilename() string
	DownloadFile(path, name string) ([]byte, error)
}

func NewS3Store

func NewS3Store(conf *config.Config) (Storage, error)

NewS3Store Create AWSS3Storage with bucket and region.

Jump to

Keyboard shortcuts

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