Documentation ¶
Index ¶
- type NilStorer
- func (ns *NilStorer) ClearCache()
- func (ns *NilStorer) Close() error
- func (ns *NilStorer) DestroyUnit() error
- func (ns *NilStorer) Get(_ []byte) ([]byte, error)
- func (ns *NilStorer) GetBulkFromEpoch(_ [][]byte, _ uint32) ([]data.KeyValuePair, error)
- func (ns *NilStorer) GetFromEpoch(_ []byte, _ uint32) ([]byte, error)
- func (ns *NilStorer) GetOldestEpoch() (uint32, error)
- func (ns *NilStorer) Has(_ []byte) error
- func (ns *NilStorer) IsInterfaceNil() bool
- func (ns *NilStorer) Put(_, _ []byte) error
- func (ns *NilStorer) PutInEpoch(_, _ []byte, _ uint32) error
- func (ns *NilStorer) RangeKeys(_ func(key []byte, val []byte) bool)
- func (ns *NilStorer) Remove(_ []byte) error
- func (ns *NilStorer) RemoveFromCurrentEpoch(_ []byte) error
- func (ns *NilStorer) SearchFirst(_ []byte) ([]byte, error)
- type Unit
- func (u *Unit) ClearCache()
- func (u *Unit) Close() error
- func (u *Unit) DestroyUnit() error
- func (u *Unit) Get(key []byte) ([]byte, error)
- func (u *Unit) GetBulkFromEpoch(keys [][]byte, _ uint32) ([]data.KeyValuePair, error)
- func (u *Unit) GetFromEpoch(key []byte, _ uint32) ([]byte, error)
- func (u *Unit) GetOldestEpoch() (uint32, error)
- func (u *Unit) Has(key []byte) error
- func (u *Unit) IsInterfaceNil() bool
- func (u *Unit) Put(key, data []byte) error
- func (u *Unit) PutInEpoch(key, data []byte, _ uint32) error
- func (u *Unit) RangeKeys(handler func(key []byte, value []byte) bool)
- func (u *Unit) Remove(key []byte) error
- func (u *Unit) RemoveFromCurrentEpoch(key []byte) error
- func (u *Unit) SearchFirst(key []byte) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NilStorer ¶
type NilStorer struct { }
NilStorer resembles a disabled implementation of the Storer interface
func (*NilStorer) DestroyUnit ¶
DestroyUnit will do nothing
func (*NilStorer) GetBulkFromEpoch ¶
GetBulkFromEpoch will do nothing
func (*NilStorer) GetFromEpoch ¶
GetFromEpoch will do nothing
func (*NilStorer) GetOldestEpoch ¶
GetOldestEpoch will return an error that signals that the oldest epoch fetching is not available
func (*NilStorer) IsInterfaceNil ¶
IsInterfaceNil returns true if there is no value under the interface
func (*NilStorer) PutInEpoch ¶
PutInEpoch will do nothing
func (*NilStorer) RemoveFromCurrentEpoch ¶
RemoveFromCurrentEpoch will do nothing
type Unit ¶
type Unit struct {
// contains filtered or unexported fields
}
Unit represents a storer's data bank holding the cache and persistence unit
func NewStorageUnit ¶
NewStorageUnit is the constructor for the storage unit, creating a new storage unit from the given cacher and persister.
func (*Unit) DestroyUnit ¶
DestroyUnit cleans up the cache, and the db
func (*Unit) Get ¶
Get searches the key in the cache. In case it is not found, it further searches it in the associated database. In case it is found in the database, the cache is updated with the value as well.
func (*Unit) GetBulkFromEpoch ¶
GetBulkFromEpoch will call the Get method for all keys as this storer doesn't handle epochs
func (*Unit) GetFromEpoch ¶
GetFromEpoch will call the Get method as this storer doesn't handle epochs
func (*Unit) GetOldestEpoch ¶
GetOldestEpoch will return an error that signals that the oldest epoch fetching is not available
func (*Unit) Has ¶
Has checks if the key is in the Unit. It first checks the cache. If it is not found, it checks the db
func (*Unit) IsInterfaceNil ¶
IsInterfaceNil returns true if there is no value under the interface
func (*Unit) PutInEpoch ¶
PutInEpoch will call the Put method as this storer doesn't handle epochs
func (*Unit) RangeKeys ¶
RangeKeys can iterate over the persisted (key, value) pairs calling the provided handler
func (*Unit) Remove ¶
Remove removes the data associated to the given key from both cache and persistence medium
func (*Unit) RemoveFromCurrentEpoch ¶
RemoveFromCurrentEpoch removes the data associated to the given key from both cache and persistence medium