Documentation ¶
Overview ¶
Package goku is a library that implements an in memory but persistant datastore
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Goku ¶
type Goku struct {
// contains filtered or unexported fields
}
Goku is the core data strcture of the library. It stores all the key value pairs and pointers to the log file
func New ¶
New creates a new instance of Goku. Each instance has it's own private store. It creates a append log at the path given, which contains all operations performed on Goku allowing recovery of data in case of program crash.
Example:
g := goku.New(".goku_data")
func (*Goku) Add ¶
Add a key value pair to the Goku instance and also persists the operation to disk.
func (*Goku) Clear ¶
func (g *Goku) Clear()
Clear deletes all elements and truncates the log from disk.
Example:
g := goku.New(".db") defer g.Clear()
Click to show internal directories.
Click to hide internal directories.