Documentation
¶
Index ¶
- Constants
- func CreateKey() string
- func ProvideBatchRunner(name string) kernel.ModuleFactory
- func WithNamingStrategy(strategy NamingFactory)
- type Batch
- type BatchRunner
- type BatchRunnerChannels
- type BatchRunnerSettings
- type CopyBatch
- type CopyObject
- type NamingFactory
- type Object
- type ReadCloser
- type ReadSeekerCloser
- type Service
- type Settings
- type Store
- type Stream
- type UrlBuilder
Constants ¶
View Source
const ( PrivateACL = types.ObjectCannedACLPrivate PublicReadACL = types.ObjectCannedACLPublicRead )
Variables ¶
This section is empty.
Functions ¶
func ProvideBatchRunner ¶
func ProvideBatchRunner(name string) kernel.ModuleFactory
func WithNamingStrategy ¶
func WithNamingStrategy(strategy NamingFactory)
Types ¶
type BatchRunner ¶
type BatchRunnerChannels ¶
type BatchRunnerChannels struct {
// contains filtered or unexported fields
}
func NewBatchRunnerChannels ¶
func NewBatchRunnerChannels(config cfg.Config) *BatchRunnerChannels
func ProvideBatchRunnerChannels ¶
func ProvideBatchRunnerChannels(config cfg.Config) *BatchRunnerChannels
type BatchRunnerSettings ¶
type BatchRunnerSettings struct {
ClientName string `cfg:"client_name" default:"default"`
CopyRunnerCount int `cfg:"copy_runner_count" default:"10"`
DeleteRunnerCount int `cfg:"delete_runner_count" default:"10"`
ReaderRunnerCount int `cfg:"reader_runner_count" default:"10"`
WriterRunnerCount int `cfg:"writer_runner_count" default:"10"`
}
type CopyBatch ¶
type CopyBatch []*CopyObject
type CopyObject ¶
type CopyObject struct {
ACL types.ObjectCannedACL
ContentEncoding *string
ContentType *string
Error error
Key *string
SourceBucket *string
SourceKey *string
// contains filtered or unexported fields
}
func (*CopyObject) GetFullKey ¶
func (o *CopyObject) GetFullKey() string
type NamingFactory ¶
type NamingFactory func() string
func DefaultNamingStrategy ¶
func DefaultNamingStrategy() NamingFactory
type Object ¶
type Object struct {
ACL types.ObjectCannedACL
Body Stream
ContentEncoding *string
ContentType *string
Error error
Exists bool
Key *string
// contains filtered or unexported fields
}
func (*Object) GetFullKey ¶
type ReadCloser ¶
type ReadCloser interface {
io.ReadCloser
}
type ReadSeekerCloser ¶
type ReadSeekerCloser interface {
io.ReadSeeker
io.Closer
}
A reader that we can close and that can seek
func CloseOnce ¶
func CloseOnce(reader io.ReadSeeker) ReadSeekerCloser
CloseOnce wraps a reader and provide a closer. Can be called more than once. If the reader does not implement closer, it ignores calls to close.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) DeleteObjects ¶
type Store ¶
type Store interface {
BucketName() string
Copy(batch CopyBatch)
CopyOne(obj *CopyObject) error
CreateBucket(ctx context.Context) error
Delete(batch Batch)
DeleteBucket(ctx context.Context) error
DeleteOne(obj *Object) error
Read(batch Batch)
ReadOne(obj *Object) error
Write(batch Batch) error
WriteOne(obj *Object) error
}
func NewStoreWithInterfaces ¶
type Stream ¶
type Stream interface {
// Read all data and close the reader.
ReadAll() ([]byte, error)
// Extract a reader you have to close yourself. Calling this multiple times might return
// the same object.
AsReader() ReadSeekerCloser
}
A stream is a source of bytes you can either get as a full []byte or stream as a reader.
func StreamReader ¶
func StreamReader(reader ReadCloser) Stream
Use a reader as a stream. If the reader does not implement Seek, we provide a dummy implementation.
type UrlBuilder ¶
func NewUrlBuilder ¶
func NewUrlBuilder(config cfg.Config, name string) (UrlBuilder, error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.