Documentation ¶
Overview ¶
Package encoded implements a blob.StoreCloser that applies a reversible encoding such as compression or encryption to the data.
Index ¶
- type Codec
- type KV
- func (s KV) Delete(ctx context.Context, key string) error
- func (s KV) Get(ctx context.Context, key string) ([]byte, error)
- func (s KV) Len(ctx context.Context) (int64, error)
- func (s KV) List(ctx context.Context, start string, f func(string) error) error
- func (s KV) Put(ctx context.Context, opts blob.PutOptions) error
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Codec ¶
type Codec interface { // Encode writes the encoding of src to w. After encoding, src may be garbage. Encode(w io.Writer, src []byte) error // Decode writes the decoding of src to w. After decoding, src may be garbage. Decode(w io.Writer, src []byte) error }
A Codec defines the capabilities needed to encode and decode.
type KV ¶ added in v0.7.0
type KV struct {
// contains filtered or unexported fields
}
A KV wraps an existing blob.KV implementation in which blobs are encoded using a Codec.
func NewKV ¶ added in v0.8.0
NewKV constructs a new KV that delegates to kv and uses c to encode and decode blob data. NewKV will panic if either kv or c is nil.
func (KV) Delete ¶ added in v0.7.0
Delete implements part of the blob.KV interface. It delegates directly to the underlying store.
func (KV) Len ¶ added in v0.7.0
Len implements part of the blob.KV interface. It delegates directly to the underlying store.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
A Store wraps an existing blob.Store implementation so that its key spaces are encoded using a Codec.
func New ¶
New constructs a new store that delegates to s and uses c to encode and decode blob data. New will panic if either s or c is nil.
func (Store) CAS ¶ added in v0.9.0
CAS implements a method of blob.Store.
func (Store) Close ¶
Close implements a method of the blob.StoreCloser interface.
func (Store) KV ¶ added in v0.9.0
KV implements a method of blob.Store. The concrete type of keyspaces returned is KV.