object

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2021 License: AGPL-3.0 Imports: 8 Imported by: 16

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Creator

type Creator func(bucket, accessKey, secretKey string) (ObjectStorage, error)

type ObjectStorage

type ObjectStorage interface {
	// Description of the object storage.
	String() string
	// Create the bucket if not existed.
	Create() error
	// Get the data for the given object specified by key.
	Get(key string, off, limit int64) (io.ReadCloser, error)
	// Put data read from a reader to an object specified by key.
	Put(key string, in io.Reader) error
	// Delete a object.
	Delete(key string) error
}

ObjectStorage is the interface for object storage. all of these API should be idempotent.

func CreateStorage

func CreateStorage(name, endpoint, accessKey, secretKey string) (ObjectStorage, error)

func WithPrefix

func WithPrefix(os ObjectStorage, prefix string) (ObjectStorage, error)

WithPrefix returns a object storage that add a prefix to keys.

Jump to

Keyboard shortcuts

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