backends

package
v1.2.9 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2018 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BadMetadata = errors.New("Corrupted metadata.")

Functions

This section is empty.

Types

type MetaBackend added in v1.2.8

type MetaBackend interface {
	Get(key string) (Metadata, error)
	Put(key string, metadata *Metadata) error
}

type MetaStorageBackend added in v1.2.8

type MetaStorageBackend interface {
	StorageBackend
	List() ([]string, error)
}

type Metadata added in v1.2.8

type Metadata struct {
	DeleteKey    string
	Sha256sum    string
	Mimetype     string
	Size         int64
	Expiry       time.Time
	ArchiveFiles []string
	ShortURL     string
}

type ReadSeekCloser

type ReadSeekCloser interface {
	io.Reader
	io.Closer
	io.Seeker
	io.ReaderAt
}

type StorageBackend

type StorageBackend interface {
	Delete(key string) error
	Exists(key string) (bool, error)
	Get(key string) ([]byte, error)
	Put(key string, r io.Reader) (int64, error)
	Open(key string) (ReadSeekCloser, error)
	ServeFile(key string, w http.ResponseWriter, r *http.Request)
	Size(key string) (int64, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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