Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrConflict = NewStorageErrorKind("conflict state")
View Source
var ErrInvalid = NewStorageErrorKind("invalid argument")
View Source
var ErrInvalidKey = NewStorageErrorKind("invalid key")
View Source
var ErrKeyNotExist = NewStorageErrorKind("key does not exist")
View Source
var ErrNotFound = NewStorageErrorKind("not found")
View Source
var ErrPermission = NewStorageErrorKind("permission denied")
View Source
var ErrStorage = NewStorageErrorKind("storage error") // HTTP 500
View Source
var ErrUnknown = NewStorageErrorKind("unknown error")
Functions ¶
func NormalizeKey ¶
func NormalizeMetadataKey ¶
Normalize Metadate key to Canonical Header uwu;
Types ¶
type GetOptions ¶
type GetOptions struct {
Range *Range
}
func GetOptionsOrDefault ¶
func GetOptionsOrDefault(opts *GetOptions) *GetOptions
type PutOptions ¶
func PutOptionsOrDefault ¶
func PutOptionsOrDefault(opts *PutOptions) *PutOptions
type Range ¶
zero-indexed & inclusive; https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Range
type Storage ¶
type Storage interface {
Put(ctx context.Context, key string, reader io.Reader, size int64, opts *PutOptions) error
Get(ctx context.Context, key string, opts *GetOptions) (io.ReadCloser, *Stats, error)
Delete(ctx context.Context, key string) error
Stat(ctx context.Context, key string) (*Stats, error)
}
type StorageError ¶
type StorageError struct {
// contains filtered or unexported fields
}
func AsStorageError ¶
func AsStorageError(err error) (StorageError, bool)
func (StorageError) Error ¶
func (e StorageError) Error() string
func (StorageError) Unwrap ¶
func (e StorageError) Unwrap() error
type StorageErrorKind ¶
type StorageErrorKind struct {
// contains filtered or unexported fields
}
func NewStorageErrorKind ¶
func NewStorageErrorKind(name string) *StorageErrorKind
func (*StorageErrorKind) Error ¶
func (k *StorageErrorKind) Error() string
func (*StorageErrorKind) New ¶
func (k *StorageErrorKind) New(msg string) StorageError
func (*StorageErrorKind) Newf ¶
func (k *StorageErrorKind) Newf(msg string, a ...any) StorageError
Click to show internal directories.
Click to hide internal directories.