storage

package
v0.0.0-...-2b4790d Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(srcStorage, dstStorage Storage, srcKey, dstKey string) error

func CopyAll

func CopyAll(src, dst Storage) error

func FindInAny

func FindInAny(key string, storages ...Storage) (io.ReadCloser, error)

func FindUnusedKey

func FindUnusedKey(storage Storage, pattern string) (*string, error)

Types

type Storage

type Storage interface {
	ListFiles() ([]string, error)
	HasFile(key string) (bool, error)
	GetFile(key string) (io.ReadCloser, error)
	PutFile(key string, file io.Reader) error
	DeleteFile(key string) error
}

func NewLocal

func NewLocal(rootDir string) Storage

type TempStorage

type TempStorage interface {
	Storage

	Clear() error
}

func NewTemp

func NewTemp() (TempStorage, error)

Jump to

Keyboard shortcuts

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