Documentation ¶
Index ¶
- type Database
- func (this *Database) CloseDatabase() error
- func (this *Database) DeleteValue(key string) error
- func (this *Database) EraseAfterCloseDatabse() error
- func (this *Database) EraseDatabase() error
- func (this *Database) GetRawIterator() iterator.Iterator
- func (this *Database) GetValue(key string) (string, error)
- func (this *Database) GetValueInBytes(key string) ([]byte, error)
- func (this *Database) InitDB(homedir string) error
- func (this *Database) IterateFrom(startKey string, callback func(string) error) error
- func (this *Database) IterateThrough(startKey string, endKey string, callback func(string) error) error
- func (this *Database) ListOfKeys() ([]*string, error)
- func (this *Database) PutValue(key string, value string) error
- func (this *Database) PutValueInBytes(key string, value []byte) error
- func (this *Database) Ready() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶ added in v0.1.0
type Database struct {
// contains filtered or unexported fields
}
func GetInstance
deprecated
func GetInstance() *Database
Deprecated: The db implementation was designed to be a Singleton However, this need to be a client rules, so we need to give the possibility to build an instance with `NewInstance` method and if the client want to use the Singleton pattern it need to implement the pattern.
func NewInstance ¶ added in v0.1.0
func (*Database) CloseDatabase ¶ added in v0.1.0
Close connection with the database
func (*Database) DeleteValue ¶ added in v0.1.0
Delete value with the specified key
func (*Database) EraseAfterCloseDatabse ¶ added in v0.1.0
Close and erase the database
func (*Database) EraseDatabase ¶ added in v0.1.0
Erase the root of the database
func (*Database) GetRawIterator ¶ added in v0.1.0
Take as result the raw iterator to iterate over the database content The user need to take kare of the Release at the end of the usage
func (*Database) GetValue ¶ added in v0.1.0
Get a value as string with the specified key, or return a not nil error in case of error.
func (*Database) GetValueInBytes ¶ added in v0.1.0
Get a value as bytes with the specified key, or return a not nil error.
func (*Database) IterateFrom ¶ added in v0.1.0
Iterate through the index from startKey, and run the callback specified by the user, a not nil value is returned if any error occurs.
func (*Database) IterateThrough ¶ added in v0.1.0
func (this *Database) IterateThrough(startKey string, endKey string, callback func(string) error) error
Iterate through the index from startKey included to endKey not included, and execute the callback defined from the user.
func (*Database) ListOfKeys ¶ added in v0.1.0
Take as result the list of keys that are in the stored in the database
func (*Database) PutValueInBytes ¶ added in v0.1.0
Put a value defined in bytes in the db with the specified key