Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrMapCap on param validate ErrMapCap = errors.New("map cap too large or too small") // ErrKeyLen on param validate ErrKeyLen = errors.New("key too long or too short") // ErrValLen on param validate ErrValLen = errors.New("value too large or too small") // ErrKeyNot on get and not add ErrKeyNot = errors.New("key not found in map") // ErrDbSize on open an exist db ErrDbSize = errors.New("database size mismatch") // ErrDbFull on add a new key ErrDbFull = errors.New("no more space in map") // ErrTryEnd on add or delete ErrTryEnd = errors.New("cannot add after too many tries") )
Functions ¶
This section is empty.
Types ¶
type Map ¶
type Map struct {
// contains filtered or unexported fields
}
Map is a shared map
func Create ¶
func Create(path string, mapCap, keyLen, valueLen, maxTry int, wait time.Duration) (m *Map, err error)
Create or open a shared map database
func (*Map) Delete ¶
Delete a key return false on failure, maybe because of: too many tries on a highly parallel situation, or hash func failed
Click to show internal directories.
Click to hide internal directories.