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 retuns a object storage that add a prefix to keys.
Click to show internal directories.
Click to hide internal directories.