Documentation ¶
Overview ¶
Package storage defines Storage API
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthTracker ¶ added in v0.5.0
type AuthTracker interface { //IsAuthChanged return true if auth has changed IsAuthChanged(ctx context.Context, baseURL string, options []Option) bool }
AuthTracker represents auth change tracker
type Authenticator ¶
type Authenticator interface { //Auth authenticate URL scheme with authentication option Auth(baseURL string, option ...Option) }
Authenticator represents an authennticator
type BatchUploader ¶
type BatchUploader interface { //Uploader returns upload handler, and upload closer for batch upload or error Uploader(ctx context.Context, URL string, options ...Option) (Upload, io.Closer, error) }
BatchUploader represents a batch uploader
type Checker ¶
type Checker interface { //Exists returns true if resource exists Exists(ctx context.Context, URL string, options ...Option) (bool, error) }
Checker represents abstraction that check if resource exists
type Copier ¶
type Copier interface { //Copy copies source to dest Copy(ctx context.Context, sourceURL, destURL string, options ...Option) error }
Copier represents an asset copier
type Creator ¶
type Creator interface { //CreateBucket creates a bucket Create(ctx context.Context, URL string, mode os.FileMode, isDir bool, options ...Option) error }
Creator represents a creator
type Deleter ¶
type Deleter interface { //Delete removes passed in storage object Delete(ctx context.Context, URL string, options ...Option) error }
Deleter represents a deleter
type Downloader ¶
type Downloader interface { //Download returns reader for downloaded storage object Download(ctx context.Context, object Object, options ...Option) (io.ReadCloser, error) //Download returns reader for downloaded storage object DownloadWithURL(ctx context.Context, URL string, options ...Option) (io.ReadCloser, error) }
Downloader represents a downloader
type Lister ¶
type Lister interface { //List returns a list of object for supplied url List(ctx context.Context, URL string, options ...Option) ([]Object, error) }
Lister represents asset lister
type Mover ¶
type Mover interface { //Move moves source to dest Move(ctx context.Context, sourceURL, destURL string, options ...Option) error }
Mover represents an asset mover
type Object ¶
type Object interface { os.FileInfo //URL return storage url URL() string //Wrap wraps source storage object Wrap(source interface{}) //Unwrap unwraps source storage object into provided target. Unwrap(target interface{}) error }
Object represents a storage object
type OnVisit ¶
type OnVisit func(ctx context.Context, baseURL string, parent string, info os.FileInfo, reader io.Reader) (toContinue bool, err error)
OnVisit represents on location visit handler
type Option ¶
type Option interface{}
Option represents generic service operation option
func NewOptions ¶
NewOptions returns new options
type Sizer ¶ added in v0.6.0
type Sizer interface {
Size() int64
}
Sizer represents abstraction returing a size
type Storager ¶
type Storager interface { io.Closer //Exists returns true if location exists Exists(ctx context.Context, location string) (bool, error) //List lists location assets List(ctx context.Context, location string, options ...Option) ([]os.FileInfo, error) //Download feches content for supplied location Download(ctx context.Context, location string, options ...Option) (io.ReadCloser, error) //Upload uploads Upload(ctx context.Context, destination string, mode os.FileMode, reader io.Reader, options ...Option) error //Create create file or directory Create(ctx context.Context, destination string, mode os.FileMode, reader io.Reader, isDir bool, options ...Option) error //Delete deletes locations Delete(ctx context.Context, location string) error }
Storager represents path oriented storage service
type StoragerAuthTracker ¶ added in v0.5.0
type StoragerAuthTracker interface { //FilterAuthOptions filters auth options FilterAuthOptions(option []Option) []Option //IsAuthChanged return true if auth has changes IsAuthChanged(authOptions []Option) bool }
StoragerAuthTracker represents auth manager