Documentation
¶
Index ¶
- type Controller
- func (controller *Controller[K, V]) Count() int
- func (controller *Controller[K, V]) Delete(k K)
- func (controller *Controller[K, V]) Find(find func(k K, v V) bool) (v V)
- func (controller *Controller[K, V]) Get(k K) V
- func (controller *Controller[K, V]) Get2(k K) (v V, ok bool)
- func (controller *Controller[K, V]) Range(f func(K, V) bool) (int, V)
- func (controller *Controller[K, V]) RangeNoLock(f func(K, V) bool) (int, V)
- func (controller *Controller[K, V]) Set(k K, v V)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller[K comparable, V any] struct { // contains filtered or unexported fields }
func (*Controller[K, V]) Count ¶
func (controller *Controller[K, V]) Count() int
Count returns the amount of entries in the controller
func (*Controller[K, V]) Delete ¶
func (controller *Controller[K, V]) Delete(k K)
func (*Controller[K, V]) Find ¶
func (controller *Controller[K, V]) Find(find func(k K, v V) bool) (v V)
func (*Controller[K, V]) Get ¶
func (controller *Controller[K, V]) Get(k K) V
func (*Controller[K, V]) Get2 ¶
func (controller *Controller[K, V]) Get2(k K) (v V, ok bool)
func (*Controller[K, V]) Range ¶
func (controller *Controller[K, V]) Range(f func(K, V) bool) (int, V)
Range iterates over the entries and locks the entry map use return true in an iteration to continue and return false to break it returns the amount of entries iterated and the entry that broke the iteration if exists
func (*Controller[K, V]) RangeNoLock ¶
func (controller *Controller[K, V]) RangeNoLock(f func(K, V) bool) (int, V)
Works the same way as Range but doesn't lock the entry map
func (*Controller[K, V]) Set ¶
func (controller *Controller[K, V]) Set(k K, v V)
Click to show internal directories.
Click to hide internal directories.