Documentation ¶
Overview ¶
Package filestore implements the blob.Store interface using files. The store comprises a directory with subdirectories keyed by a prefix of the encoded blob key.
Index ¶
- func Opener(_ context.Context, addr string) (blob.Store, error)
- type Store
- func (s *Store) Delete(_ context.Context, key string) error
- func (s *Store) Get(_ context.Context, key string) ([]byte, error)
- func (s *Store) Len(ctx context.Context) (int64, error)
- func (s *Store) List(_ context.Context, start string, f func(string) error) error
- func (s *Store) Put(_ context.Context, opts blob.PutOptions) error
- func (s *Store) Size(_ context.Context, key string) (int64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
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 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) Get ¶
Get implements part of blob.Store. It linearizes to the point at which opening the key path for reading returns.
func (*Store) Len ¶
Len implements part of blob.Store. It is implemented using List, so it linearizes in the same manner.
func (*Store) List ¶
List implements part of blob.Store. 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.