Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInterfaceNotSupported = errors.New("Interface exists but does not function with this Bucket Type") BucketDebugLog = false )
Functions ¶
This section is empty.
Types ¶
type Bucket ¶
type Bucket interface { // Name provides an identifier that can be used in keys and maps to identify the instance Name() string // Delete removes the data represented by key from the bucket's storage. // Success returns err == nil, // If err != null the state of the object in the storage is unknown. Verification of the state // needs to occur Delete(key string) error // Write copies the data from a ReadSeeker to the key that represents the data. Write(key string, r io.Reader) error // ReadCloser opens a ReadCloser for the data represented by key. ReadCloser(key string) (io.ReadCloser, error) }
Bucket provides an API to read/write/delete files in storage regardless of the underlying storage type.
func NewBucketFromDSN ¶
NewBucketFromDSN creates an object that implements the Bucket interface based on the DSN. Returns ErrInterfaceNotSupported if the DSN contains a type that isn't supported yet. If err != nil the bucket failed to create. See fileBucket, s3Bucket for DSN examples
Click to show internal directories.
Click to hide internal directories.