Documentation
¶
Index ¶
- func NewContext(ctx context.Context, os *ObjectStore) context.Context
- type BackendConfig
- type Config
- type ObjectStore
- func FromContext(ctx context.Context) *ObjectStore
- func FromContextOrDefault(ctx context.Context) *ObjectStore
- func GetDefault() *ObjectStore
- func MustNewObjectStore(ctx context.Context, conf Config) *ObjectStore
- func NewObjectStore(ctx context.Context, conf Config) (*ObjectStore, error)
- func NewObjectStoreFromURL(ctx context.Context, u *url.URL) (*ObjectStore, error)
- func (os *ObjectStore) Close() error
- func (os *ObjectStore) Copy(ctx context.Context, src *url.URL, dst *url.URL) error
- func (os *ObjectStore) Delete(ctx context.Context, u *url.URL) error
- func (os *ObjectStore) ListPrefix(ctx context.Context, u *url.URL, optsFunc ...types.ListOption) ([]*types.Object, error)
- func (os *ObjectStore) Move(ctx context.Context, src *url.URL, dst *url.URL) error
- func (os *ObjectStore) ReadMetadata(ctx context.Context, u *url.URL) (*types.ObjectMetadata, error)
- func (os *ObjectStore) Reader(ctx context.Context, u *url.URL) (types.Reader, error)
- func (os *ObjectStore) ReaderAt(ctx context.Context, u *url.URL) (types.ReaderAt, error)
- func (os *ObjectStore) Writer(ctx context.Context, u *url.URL) (types.Writer, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewContext ¶
func NewContext(ctx context.Context, os *ObjectStore) context.Context
Types ¶
type BackendConfig ¶
type BackendConfig struct {
Memory *memory.MemoryBackendConfig
Fs *fs.FSBackendConfig
Http *http.HTTPBackendConfig
S3 *s3.S3BackendConfig
Sftp *sftp.SFTPBackendConfig
Redis *redis.RedisBackendConfig
Git *git.GitBackendConfig
}
type Config ¶
type Config struct {
CopyBufferSize int
DefaultBackend string
BackendConfig
Backends map[string]BackendConfig
}
func (*Config) WithBackend ¶
func (c *Config) WithBackend(scheme string, backendConf BackendConfig) *Config
func (*Config) WithCopyBufferSize ¶
type ObjectStore ¶
type ObjectStore struct {
// contains filtered or unexported fields
}
func FromContext ¶
func FromContext(ctx context.Context) *ObjectStore
func FromContextOrDefault ¶
func FromContextOrDefault(ctx context.Context) *ObjectStore
func GetDefault ¶
func GetDefault() *ObjectStore
func MustNewObjectStore ¶
func MustNewObjectStore(ctx context.Context, conf Config) *ObjectStore
func NewObjectStore ¶
func NewObjectStore(ctx context.Context, conf Config) (*ObjectStore, error)
func NewObjectStoreFromURL ¶ added in v0.6.0
func (*ObjectStore) Close ¶
func (os *ObjectStore) Close() error
func (*ObjectStore) ListPrefix ¶
func (os *ObjectStore) ListPrefix(ctx context.Context, u *url.URL, optsFunc ...types.ListOption) ([]*types.Object, error)
func (*ObjectStore) ReadMetadata ¶
func (os *ObjectStore) ReadMetadata(ctx context.Context, u *url.URL) (*types.ObjectMetadata, error)
Click to show internal directories.
Click to hide internal directories.