Documentation ¶
Overview ¶
Package encoded implements a blob.Store that applies a reversible encoding such as compression to the data. Storage is delegated to an underlying blob.Store implementation to which the encoding is opaque.
Index ¶
- type Codec
- type Store
- func (s *Store) Close(ctx context.Context) error
- 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
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 Store ¶
type Store struct {
// contains filtered or unexported fields
}
A Store wraps an existing blob.Store implementation in which blobs 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) Delete ¶
Delete implements part of the blob.Store interface. It delegates directly to the underlying store.
func (*Store) Len ¶
Len implements part of the blob.Store interface. It delegates directly to the underlying store.