Documentation ¶
Overview ¶
Package filestore implements the blob.KV interface using files. The store comprises a directory with subdirectories keyed by a prefix of the encoded blob key.
Index ¶
- func Opener(ctx context.Context, addr string) (blob.KV, error)
- type KV
- func (s KV) Delete(_ context.Context, key string) error
- func (s KV) Dir() string
- func (s KV) Get(_ context.Context, key string) ([]byte, error)
- func (s KV) Len(ctx context.Context) (int64, error)
- func (s KV) List(_ context.Context, start string, f func(string) error) error
- func (s KV) Put(_ context.Context, opts blob.PutOptions) error
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type KV ¶ added in v0.7.0
type KV struct {
// contains filtered or unexported fields
}
KV implements the [blob.kV] interface using a directory structure with one file per stored blob. Keys are encoded in hex and used to construct file and directory names relative to a root directory, similar to a Git local object store.
func (KV) Get ¶ added in v0.7.0
Get implements part of blob.KV. It linearizes to the point at which opening the key path for reading returns.
func (KV) Len ¶ added in v0.7.0
Len implements part of blob.KV. It is implemented using List, so it linearizes in the same manner.
func (KV) List ¶ added in v0.7.0
List implements part of blob.KV. If any concurrent Put operation on a key later than the current scan position succeeds, List linearizes immediately prior to the earliest such Put operation. Otherwise, List may be linearized to any point during its execution.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements the blob.Store interface using a directory structure with one file per stored blob. Keys are encoded in hex and used to construct the file and directory names relative to a root directory, similar to a Git local object store.
func New ¶
New creates a Store associated with the specified root directory, which is created if it does not already exist.
func (Store) Close ¶
Close implements part of the blob.StoreCloser interface. This implementation always reports nil.
func (Store) Keyspace ¶ added in v0.8.0
Keyspace implements part of the blob.Store interface.