storage

package
v0.0.0-...-a2990ee Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2017 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudStorage

type CloudStorage struct {
	Storage
	// contains filtered or unexported fields
}

func NewCloudStorage

func NewCloudStorage(addr string) *CloudStorage

func (*CloudStorage) Delete

func (s *CloudStorage) Delete(ctx context.Context, filename string) error

func (*CloudStorage) Store

func (s *CloudStorage) Store(ctx context.Context, data []byte, filename string) (*StorageObject, error)

type FileStorage

type FileStorage struct {
	Storage
	// contains filtered or unexported fields
}

func NewFileStorage

func NewFileStorage(rootDir string) (*FileStorage, error)

func (*FileStorage) Delete

func (s *FileStorage) Delete(ctx context.Context, filename string) error

func (*FileStorage) Store

func (s *FileStorage) Store(ctx context.Context, data []byte, filename string) (*StorageObject, error)

type Storage

type Storage interface {
	Store(ctx context.Context, data []byte, filename string) (*StorageObject, error)
	Delete(ctx context.Context, filename string) error
}

func StorageFromEnv

func StorageFromEnv() Storage

type StorageObject

type StorageObject struct {
	Filename string
	URL      string
}

Jump to

Keyboard shortcuts

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