Discover Packages
github.com/HuguesGuilleus/go-db.v1
package
module
Version:
v0.0.0-...-46a7a98
Opens a new window with list of versions in this module.
Published: Jun 25, 2020
License: BSD-3-Clause
Opens a new window with license information.
Imports: 7
Opens a new window with list of imports.
Imported by: 4 modules, 4 packages
The first number is the count of modules that contain a package that imports this one.
The module count is a better indicator of popularity than the package count.
A module with 100 importing packages is counted only once instead of 100 times,
reflecting the fact that the choice to use the package was likely made only once,
not 100 times.
A '?' means that the value hasn't been computed yet.
Opens a new window with list of known importers.
Jump to ...
README
Documentation
Index
Constants
Variables
Functions
Types
type DB
New(name, opt)
(db) Delete(key)
(db) DeleteAll()
(db) DeleteS(key)
(db) ForS(prefix, page, size, filter, it)
(db) Get(key, v)
(db) GetRaw(key)
(db) GetS(key, v)
(db) GetSRaw(key)
(db) New()
(db) Set(key, v)
(db) SetRaw(key, raw)
(db) SetS(key, v)
(db) SetSRaw(key, raw)
(db) Unknown(key)
(db) UnknownS(key)
type Key
Source Files
README
Documentation
¶
type DB
func (db *DB) Delete(key Key)
func (db *DB) DeleteAll()
func (db *DB) DeleteS(key string)
func (db *DB) ForS(prefix string, page, size int, filter func(string) bool, it interface{}) (total int)
func (db *DB) Get(key Key, v interface{}) (noExist bool)
func (db *DB) GetRaw(key Key) []byte
func (db *DB) GetS(key string, v interface{}) (noExist bool)
func (db *DB) GetSRaw(key string) []byte
func (db *DB) New() Key
func (db *DB) Set(key Key, v interface{})
func (db *DB) SetRaw(key Key, raw []byte)
func (db *DB) SetS(key string, v interface{})
func (db *DB) SetSRaw(key string, raw []byte)
func (db *DB) Unknown(key Key) bool
func (db *DB) UnknownS(key string) bool
type Key
DB is a data base
func (db *DB ) Delete(key Key )
Delete on element
func (db *DB ) DeleteAll()
Remove all keys in the DB.
Make an iteration on all the element in the DB that begins with prefix.
Page is the index of the page of length size. If zero, web take all keys.
We can select some elements with them key, so we use filter.
filter can be nil.
It must be a function that take a string and a other type for the value,
else it panic.
MyDB.For(func(k db.Key, v MyType){...})
total is the number of elements in the DB with prefix and that pass filter.
func (db *DB ) Get(key Key , v interface{}) (noExist bool )
Get the element with a number key and save it in v.
Get the value in without decoding with a number key.
func (db *DB ) GetS(key string , v interface{}) (noExist bool )
Get the element with a string key and save it in v.
Get the value in without decoding with a string key.
Create a new number index in the DB.
func (db *DB ) Set(key Key , v interface{})
Save with a number key, the value v in the DB with serialization.
Set with a number key, the value v without serialization.
func (db *DB ) SetS(key string , v interface{})
Save with a string key, the value v in the DB with serialization.
Set with a string key, the value v without serialization.
Return true if the key is unknown in the DB.
An number type key.
Convert a string who represent a decimal number to a key.
If error the key value if zero.
Get the key string in decimal format.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.