Documentation ¶
Overview ¶
Package transform implements a blob store that can transform blobs into and out of a nested store.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Flate ¶
type Flate struct {
Level int
}
Flate is a Transformer implementing RFC1951 DEFLATE compression.
type LZW ¶
LZW is a Transformer implementing lzw compression.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is a blob store wrapped a nested anchor.Store and a Transformer. Blobs are transformed according to the Transformer on their way in and out of the nested store.
func New ¶
New produces a new Store. It uses s as backing storage, containing transformed blobs and the mapping from blob refs to transformed-blob refs. Blobs are transformed into and out of s using the Transformer x. The ref mapping is a schema.Map in s whose root ref is given by the anchor name a.
type Transformer ¶
type Transformer interface { // In transforms a blob on its way into the store. In(context.Context, []byte) ([]byte, error) // Out transforms a blob on its way out of the store. Out(context.Context, []byte) ([]byte, error) }
Transformer tells how to transform a blob on its way into and out of a Store. Out should be the inverse of In.