Documentation
¶
Index ¶
- Variables
- type Constructable
- type Destroyable
- type Group
- func (g *Group[K, V]) Add(id K, e V) (err error)
- func (g *Group[K, V]) CallWithLock(f func(d map[K]V) (e V, err error)) (V, error)
- func (g *Group[K, V]) Get(id K) (e V, err error)
- func (g *Group[K, V]) GetKeys() []K
- func (g *Group[K, V]) GetMap() map[K]V
- func (g *Group[K, V]) GetValues() []V
- func (g *Group[K, V]) Iterator() chan V
- func (g *Group[K, V]) Remove(id K) (err error)
- func (g *Group[K, V]) Search(key any, result chan V, f SearchFunction)
- func (g *Group[K, V]) SearchOne(key any, f SearchFunction) (d V)
- func (g *Group[K, V]) Size() int
- func (g *Group[K, V]) Tick()
- func (g *Group[K, V]) Truncate()
- type Registry
- func (r *Registry[G, I, V]) Add(key G, id I, e V) error
- func (r *Registry[G, I, V]) AddIndex(id uint64, key I)
- func (r *Registry[G, I, V]) AsyncIterator(keys ...G) chan V
- func (r *Registry[G, I, V]) AsyncTick(keys ...G)
- func (r *Registry[G, I, V]) DeleteGroup(key G)
- func (r *Registry[G, I, V]) Get(key G, id I) (e V, err error)
- func (r *Registry[G, I, V]) GetGroup(key G) (group *Group[I, V])
- func (r *Registry[G, I, V]) GetGroups(keys ...G) (groups []*Group[I, V])
- func (r *Registry[G, I, V]) GetIndex(id uint64) I
- func (r *Registry[G, I, V]) GetKeys() []G
- func (r *Registry[G, I, V]) GetValues(key G) []V
- func (r *Registry[G, I, V]) Iterator(keys ...G) chan V
- func (r *Registry[G, I, V]) LatestID() uint64
- func (r *Registry[G, I, V]) NextID() uint64
- func (r *Registry[G, I, V]) RemIndex(id uint64)
- func (r *Registry[G, I, V]) Remove(key G, id I) error
- func (r *Registry[G, I, V]) RemoveIDEverywhere(id I) error
- func (r *Registry[G, I, V]) SearchInGroup(key G, f SearchFunction) chan V
- func (r *Registry[G, I, V]) SearchOne(key G, f SearchFunction) V
- func (r *Registry[G, I, V]) SetLatestID(id uint64)
- func (r *Registry[G, I, V]) Size() int
- func (r *Registry[G, I, V]) TickGroup(key G)
- func (r *Registry[G, I, V]) TickGroups(keys ...G)
- func (r *Registry[G, I, V]) TruncateGroup(key G)
- type SearchFunction
- type Ticker
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotFoundEntity = errors.New("not found entity")
)
All kinds of errors for memory
View Source
var Nothing = struct{}{}
Nothing empty struct
Functions ¶
This section is empty.
Types ¶
type Constructable ¶
type Constructable interface {
Construct() error
}
Constructable able to be construct in memory
type Destroyable ¶
type Destroyable interface {
Destroy() error
}
Destroyable able to be destroyed in memory
type Group ¶
type Group[K comparable, V any] struct { // contains filtered or unexported fields }
Group contains all entities for given type
func (*Group[K, V]) CallWithLock ¶
func (*Group[K, V]) Search ¶
func (g *Group[K, V]) Search(key any, result chan V, f SearchFunction)
func (*Group[K, V]) SearchOne ¶
func (g *Group[K, V]) SearchOne(key any, f SearchFunction) (d V)
type Registry ¶
type Registry[G comparable, I comparable, V any] struct { // contains filtered or unexported fields }
func NewRegistry ¶
func NewRegistry[G comparable, I comparable, V any]() *Registry[G, I, V]
func (*Registry[G, I, V]) AsyncIterator ¶
func (r *Registry[G, I, V]) AsyncIterator(keys ...G) chan V
func (*Registry[G, I, V]) DeleteGroup ¶
func (r *Registry[G, I, V]) DeleteGroup(key G)
func (*Registry[G, I, V]) RemoveIDEverywhere ¶
func (*Registry[G, I, V]) SearchInGroup ¶
func (r *Registry[G, I, V]) SearchInGroup(key G, f SearchFunction) chan V
func (*Registry[G, I, V]) SearchOne ¶
func (r *Registry[G, I, V]) SearchOne(key G, f SearchFunction) V
func (*Registry[G, I, V]) SetLatestID ¶
func (*Registry[G, I, V]) TickGroups ¶
func (r *Registry[G, I, V]) TickGroups(keys ...G)
func (*Registry[G, I, V]) TruncateGroup ¶
func (r *Registry[G, I, V]) TruncateGroup(key G)
type SearchFunction ¶
type SearchFunction func(key interface{}, id interface{}, data interface{}) bool
SearchFunction describe specification for filter function
Click to show internal directories.
Click to hide internal directories.