Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetFileTimeout ¶
SetFileTimeout sets when the file will automatically close after the timeout duration has passed with no activity on the datastore file. Any new activity will restart the timeout. Shorter timeout means fewer open files, but less concurrency due to locking on open.
Types ¶
type DS ¶
DS is a datstore, holds the pointer to the underlying kv file, and keeps track of when a file times-out and needs to be closed and when it's in use
type KvIterator ¶
KvIterator is a key value iterator
func (*KvIterator) Err ¶
func (i *KvIterator) Err() error
Err returns any errors that may have happened during iterating
func (*KvIterator) Next ¶
func (i *KvIterator) Next() bool
Next gets the next value from the iterator
func (*KvIterator) Value ¶
func (i *KvIterator) Value() []byte
Value returns the current value in the iterator
type Storer ¶
type Storer interface { Get(key []byte) ([]byte, error) Put(key, value []byte) error Delete(key []byte) error Max() ([]byte, error) //Max Key in store Min() ([]byte, error) //Min Key in store Iter(from, to []byte) (Iterator, error) }
Storer is the interface that is needed to run a freehold instance an any datastores in it