storage

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NotFound = errors.New("Not found")

Functions

This section is empty.

Types

type LocalStorage

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

func NewLocalStorage

func NewLocalStorage(rootDir string) (*LocalStorage, error)

func (*LocalStorage) Delete

func (s *LocalStorage) Delete(user string, name string, id string) error

func (*LocalStorage) Download

func (s *LocalStorage) Download(user string, name string, id string) ([]byte, error)

func (*LocalStorage) DownloadFile

func (s *LocalStorage) DownloadFile(user string, name string, id string, path string) ([]byte, error)

func (*LocalStorage) Upload

func (s *LocalStorage) Upload(user string, name string, id string, reader io.Reader) error

type Storage

type Storage interface {
	Upload(user string, name string, id string, reader io.Reader) error
	Download(user string, name string, id string) ([]byte, error) // TODO(andreas): return reader
	DownloadFile(user string, name string, id string, path string) ([]byte, error)
	Delete(user string, name string, id string) error
}

Jump to

Keyboard shortcuts

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