storage

package
v0.0.0-...-cb7fb10 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2018 License: Apache-2.0 Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Config map[string]string
View Source
var NewStorage func(map[string]string) Storage

Functions

func Download

func Download(ctx context.Context, key string) ([]byte, string, error)

func Init

func Init()

func Register

func Register(ns func(map[string]string) Storage)

func Upload

func Upload(ctx context.Context, key string, blob []byte, options ...KV) (string, error)

Types

type Fetcher

type Fetcher interface {
	Fetch(string) string
}

type File

type File interface {
	Key() string

	Exist() (bool, string, error)

	Meta() (Fetcher, error)

	Append([]byte, int64, ...KV) (int64, string, error)

	Delete() (string, error)

	Bytes() ([]byte, string, error)

	SetMeta(...KV) error
}

type Iterator

type Iterator interface {
	Next() (File, error)

	LastKey() string
}

type KV

type KV [2]string

type Storage

type Storage interface {
	File(string) File

	Iterator(prefix string, lastKey string) Iterator

	StoreFile(string, []byte, ...KV) (string, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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