Documentation ¶
Overview ¶
Package prefixed implements a blob.Store interface that delegates to another Store, with keys namespaced by a fixed prefix concatenated with each key.
Index ¶
- type Store
- func (s *Store) Delete(ctx context.Context, key string) error
- func (s *Store) Get(ctx context.Context, key string) ([]byte, error)
- func (s *Store) Len(ctx context.Context) (int64, error)
- func (s *Store) List(ctx context.Context, start string, f func(string) error) error
- func (s *Store) Put(ctx context.Context, opts blob.PutOptions) error
- func (s *Store) Size(ctx context.Context, key string) (int64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements the blob.Store interface by delegating to an underlying store, but with each key prefixed by a fixed non-empty string. This allows multiple consumers to share non-overlapping namespaces within a single storage backend.
func New ¶
New creates a Store associated with the specified prefix and store. This function will panic if prefix == "".
func (*Store) Len ¶
Len implements part of blob.Store by delegation. It reports the total number of keys in the underlying store, not only those with the chosen prefix.
func (*Store) List ¶
List implements part of blob.Store by delegation. It filters the underlying list results to include only keys prefixed for this store.