Documentation ¶
Overview ¶
Package zipstore implements a read-only view of the blob.Store interface using files stored in a ZIP archive.
Index ¶
- type Options
- type Store
- func (s Store) Close(context.Context) error
- 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, blob.PutOptions) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct { // Consider only files whose names have this prefix followed by a "/". // // As a special case, if Prefix == "" but all the entries in the archive // share a non-empty common prefix, that prefix is used. Prefix string }
Options are optional settings for a Store. A nil *Options is ready for use and provides default values as described.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
A Store wraps a zip.Reader and serves its contents as a blob.Store. The contents of the archive must follow the same layout as a filestore.Store, with keys encoded as hexadecimal.
func New ¶
func New(zf *zip.ReadCloser, opts *Options) Store
New constructs a Store from the given open zip.Reader. If opts == nil, default options are used as described by the Options type. The Store takes ownership of zf, and will close zf when the Store is closed.
func (Store) Delete ¶
Delete implements a method of the blob.Store interface. This implementation always reports an error, since the store is read-only.