Documentation ¶
Index ¶
- Variables
- type Datastore
- func (d *Datastore) Batch(ctx context.Context) (ds.Batch, error)
- func (d *Datastore) Close() (err error)
- func (a Datastore) Delete(ctx context.Context, key key.Key) (err error)
- func (d *Datastore) DiskUsage(ctx context.Context) (uint64, error)
- func (a Datastore) Get(ctx context.Context, key key.Key) (value []byte, err error)
- func (a Datastore) GetSize(ctx context.Context, key key.Key) (size int, err error)
- func (a Datastore) Has(ctx context.Context, key key.Key) (exists bool, err error)
- func (d *Datastore) NewTransaction(ctx context.Context, readOnly bool) (ds.Txn, error)
- func (a Datastore) Put(ctx context.Context, key key.Key, value []byte) (err error)
- func (a Datastore) Query(ctx context.Context, q dsq.Query) (dsq.Results, error)
- func (a Datastore) Sync(ctx context.Context, prefix key.Key) error
- type Options
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnimplemented = errors.New("method not implemented") ErrKeyTypeNotMatch = errors.New("key type does not match") )
Functions ¶
This section is empty.
Types ¶
type Datastore ¶
func NewDatastore ¶
NewDatastore returns a new datastore backed by leveldb
for path == "", an in memory backend will be chosen
func (*Datastore) DiskUsage ¶
DiskUsage returns the current disk size used by this levelDB. For in-mem datastores, it will return 0.
func (*Datastore) NewTransaction ¶
type Options ¶
type Options struct { opt.Options // SyncWrites is whether to sync underlying writes from the OS buffer cache // through to actual disk, if applicable. Setting SyncWrites can result in // slower writes. // // If false, and the machine crashes, then some recent writes may be lost. // Note that if it is just the process that crashes (and the machine does // not) then no writes will be lost. // // In other words, SyncWrites being false has the same semantics as a write // system call. SyncWrites being true means write followed by fsync. // // The default value is true. SyncWrites bool }
Options extends syndtr/goleveldb/opt.Options
Click to show internal directories.
Click to hide internal directories.