Documentation ¶
Index ¶
- Variables
- func Apply(opts ...Option) option
- type Attrs
- type Client
- func (c *Client) Delete(ctx context.Context, uri string, options ...Option) error
- func (c *Client) Download(ctx context.Context, uri string, options ...Option) ([]byte, error)
- func (c *Client) DownloadTo(ctx context.Context, source string, destination string, options ...Option) error
- func (c *Client) Exist(ctx context.Context, uri string) (bool, error)
- func (c *Client) GetAttrs(ctx context.Context, uri string) (Attrs, error)
- func (c *Client) StreamAt(key string, off int64, n int64) (io.ReadCloser, int64, error)
- func (c *Client) Upload(ctx context.Context, uri string, data []byte, options ...Option) error
- func (c *Client) UploadFile(ctx context.Context, uri string, data io.ReadCloser, options ...Option) error
- type ExcludeFunc
- type Option
- type Strategy
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrFileNotFound = errors.New("file not found")
)
Functions ¶
Types ¶
type Client ¶
type Client struct {
StorageStrategy Strategy
}
func NewStorageClient ¶
func (*Client) DownloadTo ¶
func (c *Client) DownloadTo(ctx context.Context, source string, destination string, options ...Option) error
DownloadTo enables to download file content in local file.
func (*Client) UploadFile ¶
func (c *Client) UploadFile(ctx context.Context, uri string, data io.ReadCloser, options ...Option) error
UploadFile enables to upload file in to remote file.
type ExcludeFunc ¶
type Option ¶
type Option func(o *option)
func Concurrency ¶
func Exclude ¶
func Exclude(ex ExcludeFunc) Option
func OnErrorRetryDelay ¶
func StorageClass ¶
type Strategy ¶
type Strategy interface { Download(ctx context.Context, uri string, options ...Option) ([]byte, error) DownloadToFile(ctx context.Context, source string, destination string, options ...Option) error Upload(ctx context.Context, uri string, data []byte, options ...Option) error UploadFile(ctx context.Context, uri string, data io.ReadCloser, options ...Option) error Delete(ctx context.Context, uri string, options ...Option) error Exist(ctx context.Context, uri string) (bool, error) GetAttrs(ctx context.Context, uri string) (Attrs, error) StreamAt(key string, off int64, n int64) (io.ReadCloser, int64, error) }
Click to show internal directories.
Click to hide internal directories.