Documentation ¶
Overview ¶
Package sqlitestore implements the blob.Store interface using SQLite3.
Index ¶
- func Opener(_ context.Context, addr string) (blob.Store, error)
- type Options
- 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 ¶
func Opener ¶
Opener constructs a sqlitestore from a SQLite URI, for use with the store package. To specify the table name, prefix addr with "tablename@".
If poolsize=n is set, it is used to set the pool size. If compress=v is set, it is used to enable/disable compression (default true). Other query parameters are passed to SQLite.
Types ¶
type Options ¶
type Options struct { // The name of the SQL driver to use, default "sqlite". Driver string // The number of connections to allow in the pool. If <= 0, use runtime.NumCPU. PoolSize int // The name of the table to use for blob data. If unset, use "blobs". Table string // If true, store blobs without compression; by default blob data are // compressed with Snappy. Uncompressed bool }
Options are options for constructing 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 implements the blob.Store interface using a SQLite3 database.
Click to show internal directories.
Click to hide internal directories.