Versions in this module Expand all Collapse all v1 v1.0.1 Jul 28, 2020 Changes in this version + var ErrClosed = errors.New("datastore closed") + type Datastore struct + DB *badger.DB + func NewDatastore(path string, options *Options) (*Datastore, error) + func (d *Datastore) Batch() (ds.Batch, error) + func (d *Datastore) Close() error + func (d *Datastore) CollectGarbage() (err error) + func (d *Datastore) Delete(key ds.Key) error + func (d *Datastore) DiskUsage() (uint64, error) + func (d *Datastore) Get(key ds.Key) (value []byte, err error) + func (d *Datastore) GetExpiration(key ds.Key) (time.Time, error) + func (d *Datastore) GetSize(key ds.Key) (size int, err error) + func (d *Datastore) Has(key ds.Key) (bool, error) + func (d *Datastore) NewTransaction(readOnly bool) (ds.Txn, error) + func (d *Datastore) Put(key ds.Key, value []byte) error + func (d *Datastore) PutWithTTL(key ds.Key, value []byte, ttl time.Duration) error + func (d *Datastore) Query(q dsq.Query) (dsq.Results, error) + func (d *Datastore) SetTTL(key ds.Key, ttl time.Duration) error + func (d *Datastore) Sync(prefix ds.Key) error + type Options struct + GcDiscardRatio float64 + GcInterval time.Duration + GcSleep time.Duration + var DefaultOptions Options