Documentation ¶
Index ¶
- Variables
- type DefaultFactory
- type DefaultUri
- func (u DefaultUri) Bucket() string
- func (u DefaultUri) Delete(ctx context.Context) error
- func (u DefaultUri) Download(ctx context.Context) ([]byte, error)
- func (u DefaultUri) DownloadToFile(ctx context.Context, destination string) error
- func (u DefaultUri) Exist(ctx context.Context) (bool, error)
- func (u DefaultUri) FileName() string
- func (u DefaultUri) GetAttrs(ctx context.Context) (storage.Attrs, error)
- func (u DefaultUri) NewStorageStrategy(ctx context.Context) (storage.Strategy, error)
- func (u DefaultUri) Path() string
- func (u DefaultUri) Protocol() string
- func (u DefaultUri) String() string
- func (u DefaultUri) Upload(ctx context.Context, data []byte) error
- func (u DefaultUri) UploadFile(ctx context.Context, data io.ReadCloser) error
- type Factory
- type Uri
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrBadUri = fmt.Errorf("badly formatted storage uri")
)
Functions ¶
This section is empty.
Types ¶
type DefaultFactory ¶
type DefaultFactory struct{}
func (*DefaultFactory) NewUri ¶
func (f *DefaultFactory) NewUri(provider, bucketName, path string) Uri
type DefaultUri ¶
type DefaultUri struct {
// contains filtered or unexported fields
}
func ParseUri ¶
func ParseUri(rawURI string) (DefaultUri, error)
ParseUri parse a storage uri (e.g. gcs://bucket-name/path/to/file)
func (DefaultUri) Bucket ¶
func (u DefaultUri) Bucket() string
func (DefaultUri) DownloadToFile ¶
func (u DefaultUri) DownloadToFile(ctx context.Context, destination string) error
func (DefaultUri) Exist ¶ added in v0.3.0
func (u DefaultUri) Exist(ctx context.Context) (bool, error)
func (DefaultUri) FileName ¶
func (u DefaultUri) FileName() string
func (DefaultUri) NewStorageStrategy ¶
func (DefaultUri) Path ¶
func (u DefaultUri) Path() string
func (DefaultUri) Protocol ¶
func (u DefaultUri) Protocol() string
func (DefaultUri) String ¶
func (u DefaultUri) String() string
func (DefaultUri) UploadFile ¶
func (u DefaultUri) UploadFile(ctx context.Context, data io.ReadCloser) error
Click to show internal directories.
Click to hide internal directories.