Documentation
¶
Overview ¶
Collection is just wrapper around hashmap. Storage could contain multiple collections.
Implementation of FNV-1a hash alghorithm ¶
Implementation of Striped Hashmap data structure.
Storage is a heart of ghost. Storage contains all collections and interaction methods. Storage is singleton.
Index ¶
Constants ¶
View Source
const ( INIT_SIZE uint32 = 64 // Default number of buckets THRESHOLD float32 = 0.75 // Threshold load factor to rehash table LOCKS_NUM = 1024 // Size of the lock array )
Variables ¶
This section is empty.
Functions ¶
func ByteArrayToUint64 ¶
func NewHashMap ¶
func NewHashMap() *hashMap
func UintToByteArray ¶
Types ¶
type Collection ¶
type Collection struct { Name string // contains filtered or unexported fields }
func (*Collection) Del ¶
func (c *Collection) Del(key string)
func (*Collection) Set ¶
func (c *Collection) Set(key, val string)
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func (*Storage) AddCollection ¶
func (s *Storage) AddCollection(name string) (*Collection, error)
Add new collection to the Storage.
func (*Storage) DelCollection ¶
Delete collection from the Storage.
func (*Storage) GetCollection ¶
func (s *Storage) GetCollection(name string) *Collection
Get collection from the Storage. Return *colleciton or nil.
Click to show internal directories.
Click to hide internal directories.