Documentation ¶
Overview ¶
Package base define base manager
Index ¶
- Constants
- func NewStreamReader(stream *option.Stream, reedSeeker io.ReadSeeker) io.ReadCloser
- func NewUploader(manager storage.Manager) storage.BatchUploader
- type List
- type Manager
- func (m *Manager) BaseURL() string
- func (m *Manager) Close() error
- func (m *Manager) Create(ctx context.Context, URL string, mode os.FileMode, isDir bool, ...) error
- func (m *Manager) Delete(ctx context.Context, URL string, options ...storage.Option) error
- func (m *Manager) Download(ctx context.Context, object storage.Object, options ...storage.Option) (io.ReadCloser, error)
- func (m *Manager) DownloadWithURL(ctx context.Context, URL string, options ...storage.Option) (io.ReadCloser, error)
- func (m *Manager) Exists(ctx context.Context, URL string, options ...storage.Option) (bool, error)
- func (m *Manager) IsAuthChanged(ctx context.Context, baseURL string, options []storage.Option) bool
- func (m *Manager) List(ctx context.Context, URL string, options ...storage.Option) ([]storage.Object, error)
- func (m *Manager) Object(ctx context.Context, URL string, options ...storage.Option) (storage.Object, error)
- func (m *Manager) Options(options []storage.Option) []storage.Option
- func (m *Manager) Scheme() string
- func (m *Manager) Storager(ctx context.Context, baseURL string, options []storage.Option) (storage.Storager, error)
- func (m *Manager) Upload(ctx context.Context, URL string, mode os.FileMode, reader io.Reader, ...) error
- type Retry
- type Storager
Constants ¶
View Source
const ( //RangeHeader represents a range header RangeHeader = "Range" RangeHeaderTmpl = "bytes=%d-%d" )
RangeHeader represents a range header
Variables ¶
This section is empty.
Functions ¶
func NewStreamReader ¶ added in v0.6.0
func NewStreamReader(stream *option.Stream, reedSeeker io.ReadSeeker) io.ReadCloser
func NewUploader ¶
func NewUploader(manager storage.Manager) storage.BatchUploader
NewUploader creates a new batch uploader
Types ¶
type Manager ¶
Manager represents Storager base manager
func New ¶
func New(manager storage.Manager, scheme string, provider func(ctx context.Context, baseURL string, options ...storage.Option) (storage.Storager, error), options []storage.Option) *Manager
New creates base Storager base Manager
func (*Manager) Create ¶
func (m *Manager) Create(ctx context.Context, URL string, mode os.FileMode, isDir bool, options ...storage.Option) error
Create creates a resource
func (*Manager) Download ¶
func (m *Manager) Download(ctx context.Context, object storage.Object, options ...storage.Option) (io.ReadCloser, error)
Download downloads content
func (*Manager) DownloadWithURL ¶
func (m *Manager) DownloadWithURL(ctx context.Context, URL string, options ...storage.Option) (io.ReadCloser, error)
DownloadWithURL downloads content
func (*Manager) IsAuthChanged ¶ added in v0.5.0
func (*Manager) List ¶
func (m *Manager) List(ctx context.Context, URL string, options ...storage.Option) ([]storage.Object, error)
List lists content for supplied URL
func (*Manager) Object ¶ added in v0.9.0
func (m *Manager) Object(ctx context.Context, URL string, options ...storage.Option) (storage.Object, error)
Object retuns an object for supplied URL or error
type Retry ¶ added in v0.8.0
type Retry struct { Count int Initial time.Duration Max time.Duration Multiplier float64 // contains filtered or unexported fields }
Retry represents abstraction holding sleep duration between retries (back-off)
Click to show internal directories.
Click to hide internal directories.