Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotExist = errors.New("object does not exist")
)
Functions ¶
This section is empty.
Types ¶
type ErrRangeNotSatisfiable ¶ added in v0.0.18
type ErrRangeNotSatisfiable struct {
Range Range
}
ErrRangeNotSatisfiable is returned when the byte range option falls outside of the total size of the object.
func (ErrRangeNotSatisfiable) Error ¶ added in v0.0.18
func (e ErrRangeNotSatisfiable) Error() string
type GetConfig ¶
func NewGetConfig ¶
func NewGetConfig() GetConfig
type ListableStore ¶ added in v0.2.3
type ListableStore interface {
Store
// Exists checks if an object with the given key exists.
Exists(ctx context.Context, key string) (bool, error)
// ListPrefix returns an iterator over all object keys with the given prefix.
// The iterator yields (key, error) pairs. Errors during listing are yielded
// and iteration stops.
ListPrefix(ctx context.Context, prefix string) iter.Seq2[string, error]
}
ListableStore extends Store with the ability to list objects by prefix and check for existence. This is implemented by stores that support efficient prefix-based queries (like S3/MinIO).
type Object ¶
type Object interface {
// Size returns the total size of the object in bytes.
Size() int64
Body() io.ReadCloser
}
type Store ¶
type Store interface {
// Put stores an object with the given key and size from the provided reader.
// The size parameter should match the actual bytes to be read from data.
Put(ctx context.Context, key string, size uint64, data io.Reader) error
// Get retrieves the object identified by the given key.
// Returns an Object for reading the data, or an error if retrieval fails.
// Use GetOption functions like WithRange to retrieve partial objects.
Get(ctx context.Context, key string, opts ...GetOption) (Object, error)
// Delete an object from the store by the given key.
Delete(ctx context.Context, key string) error
}
Directories
¶
| Path | Synopsis |
|---|---|
|
Package flatfs is a Datastore implementation that stores all objects in a two-level directory structure in the local file system, regardless of the hierarchy of the keys.
|
Package flatfs is a Datastore implementation that stores all objects in a two-level directory structure in the local file system, regardless of the hierarchy of the keys. |
Click to show internal directories.
Click to hide internal directories.