Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContentKeys ¶
ContentKeys stores the location/path of the original content, as well as the thumbnail/preview location
type DevStore ¶
type DevStore struct {
// contains filtered or unexported fields
}
DevStore is the backing structure needed to interact with a local, temporary image store
func NewDevStore ¶
NewDevStore constructs a basic DevStore / local temporary store
type MemStore ¶
type MemStore struct {
// contains filtered or unexported fields
}
MemStore is the backing structure needed to interact with local memory -- for unit/integration testing purposes only
func NewMemStore ¶
NewMemStore is the constructor for MemStore
func (*MemStore) UploadWithName ¶
UploadWithName writes the given data to the given memory key -- this can allow for re-writing/replacing data if names are not unique
Note: to avoid overwriting random keys, DO NOT use uuids as they key Note 2: This is NOT part of the standard ContentStore interface
type S3Store ¶
type S3Store struct {
// contains filtered or unexported fields
}
S3Store is the backing structure needed to interact with an Amazon S3 storage service TODO: this can be unexported
func NewS3Store ¶
NewS3Store provides a mechanism to initialize an S3 bucket in a particular region
type Storable ¶
type Storable interface {
ProcessPreviewAndUpload(Store) (ContentKeys, error)
}
Storable represents content in a yet-to-be-uploaded state. The basic workflow when using this is to create a new instance, then immediately call ProcessPreviewAndUpload, which will both generate preview content (e.g. a resized image), and upload both the provided content, plus the preview to the provided Store
type Store ¶
type Store interface { Upload(data io.Reader) (string, error) Read(key string) (io.Reader, error) Delete(key string) error }
Store provides a generic interface into interacting with the underlying storage service
Upload stores the provided file/bytes into the storage service, returning the location of that file or any error that may have occurred
Read retrieves the raw bytes from the storage service, given a key obtained by Upload