Documentation ¶
Index ¶
- Variables
- type Datastore
- func (d *Datastore) Batch() (ds.Batch, error)
- func (d *Datastore) Close() (err error)
- func (d *Datastore) Delete(key ds.Key) (err error)
- func (d *Datastore) DiskUsage() (du uint64, err error)
- func (d *Datastore) Get(key ds.Key) (value []byte, err error)
- func (d *Datastore) GetSize(key ds.Key) (size int, err error)
- func (d *Datastore) Has(key ds.Key) (exists bool, err error)
- func (d *Datastore) NewTransaction(readOnly bool) (ds.Txn, error)
- func (d *Datastore) Put(key ds.Key, value []byte) (err error)
- func (d *Datastore) Query(q dsq.Query) (dsq.Results, error)
- func (d *Datastore) Sync(prefix ds.Key) error
- type Options
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrClosed is an error message returned when the datastore is no longer open ErrClosed = errors.New("datastore closed") )
Functions ¶
This section is empty.
Types ¶
type Datastore ¶
type Datastore struct {
// contains filtered or unexported fields
}
Datastore is a go-datastore implement using leveldb
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 ¶
NewTransaction returns a new transaction handler
Click to show internal directories.
Click to hide internal directories.