Documentation
¶
Index ¶
- Constants
- Variables
- func Clear()
- func IsNotFound(err error) bool
- func MustPath(elem ...string) string
- func MustURI(s Storage, key ...string) string
- func Path(elem ...string) (string, error)
- func Register(storageType string, newFn NewFunc)
- func Set(storageName string, s Storage) error
- func SetFromConfig(configs ...Config) error
- func SetFromViper(keys ...string) error
- func URI(s Storage, key ...string) (string, error)
- type Checksum
- type Config
- type GetOption
- type GetOptions
- type MigrateResult
- type NewFunc
- type ObjectMeta
- type PutOption
- type PutOptions
- type ReplicaHealth
- type Storage
- type StorageLocator
Constants ¶
View Source
const DefaultBackendsKey = "storage.backends"
Variables ¶
Functions ¶
func IsNotFound ¶
func SetFromConfig ¶
func SetFromViper ¶
Types ¶
type GetOptions ¶
type GetOptions struct {
TrySaveFilePath string
}
type MigrateResult ¶
type MigrateResult struct {
Success []ObjectMeta
Failed map[string]error
}
type ObjectMeta ¶
func (ObjectMeta) String ¶
func (o ObjectMeta) String() string
type PutOption ¶
type PutOption func(*PutOptions)
func WithExpectedETag ¶
func WithOverwrite ¶
func WithSHA256 ¶
func WithSHA256() PutOption
type ReplicaHealth ¶
type ReplicaHealth struct {
Healthy bool `json:"healthy" bson:"healthy"`
CheckedAt time.Time `json:"checked_at" bson:"checked_at"`
}
func NewHealthy ¶
func NewHealthy(healthy bool) ReplicaHealth
type Storage ¶
type Storage interface {
Type() string
Name() string
CanRePut() bool
Put(ctx context.Context, key string, r io.Reader, opts ...PutOption) (*ObjectMeta, error)
Get(ctx context.Context, key string, opts ...GetOption) (io.ReadCloser, *ObjectMeta, error)
Stat(ctx context.Context, key string) (*ObjectMeta, error)
Exists(ctx context.Context, key string) (bool, error)
List(ctx context.Context, prefix string) ([]ObjectMeta, error)
Delete(ctx context.Context, key string) error
Copy(ctx context.Context, srcKey, dstKey string, opts ...PutOption) (*ObjectMeta, error)
Move(ctx context.Context, srcKey, dstKey string, opts ...PutOption) (*ObjectMeta, error)
}
type StorageLocator ¶
type StorageLocator struct {
Backend string `json:"backend,omitempty" bson:"backend"`
Key string `json:"key,omitempty" bson:"key"`
ReplicaHealth
}
Click to show internal directories.
Click to hide internal directories.