Documentation ¶
Index ¶
- func S3UsePathStyle(opts *s3.Options)
- type ContentKeys
- type DevStore
- type GCPStore
- type MemStore
- type Presigner
- type S3Store
- func (s *S3Store) Delete(key string) error
- func (d *S3Store) Name() string
- func (s *S3Store) Read(key string) (io.Reader, error)
- func (s *S3Store) SendURLData(key string) (*URLData, error)
- func (s *S3Store) Upload(data io.Reader) (string, error)
- func (s *S3Store) UploadWithName(key string, data io.Reader) error
- type Storable
- type Store
- type URLData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func S3UsePathStyle ¶
S3UsePathStyle is a s3.config function that allows you to enable the client to use path-style addressing, i.e., https:// s3.amazonaws.com/BUCKET/KEY . By default, the S3 client will use virtual hosted bucket addressing when possible( https://BUCKET.s3.amazonaws.com/KEY ).
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 GCPStore ¶
type GCPStore struct {
// contains filtered or unexported fields
}
func NewGCPStore ¶
NewGCPStore provides a mechanism to initialize a GCP client
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
type Presigner ¶
type Presigner struct {
PresignClient *s3.PresignClient
}
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) UploadWithName(key string, data io.Reader) error Read(key string) (io.Reader, error) Delete(key string) error Name() string }
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
Note that UploadWithName is only intended for development and testing. This should not be used directly.
Read retrieves the raw bytes from the storage service, given a key obtained by Upload