Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( PUT_ERR = errors.New("Key is already in use") REMOVE_ERR = errors.New("Cannot remove an element that does not exist") EXIST_ERR = errors.New("Element does not exist") GET_ERR = errors.New("Could not get value from the memDB") )
View Source
var (
DB_ERR = errors.New("DB could not be loaded: ")
)
Functions ¶
Types ¶
type MemDb ¶
type MemDb struct {
// contains filtered or unexported fields
}
A db only stored on the memory. Will be used for storing data that the hard disk doesnt need to store.
func (*MemDb) Get ¶
Gets data from the memDB based on the given key. Returns the data and any errors that occured.
func (*MemDb) Has ¶
Checks if a key already exists. This func is public as it is protected with locks.
func (*MemDb) Put ¶
Adds a key and data pair to the mempool, but will not overide if the key is already used. Returns any errors.
Click to show internal directories.
Click to hide internal directories.