Documentation
¶
Index ¶
- type Checker
- type Map
- func (cm *Map) Delete(key string) bool
- func (cm *Map) Get(key string) (interface{}, bool)
- func (cm *Map) GetAll() ([]interface{}, bool)
- func (cm *Map) Iter() <-chan MapItem
- func (cm *Map) Keys() (keys []string)
- func (cm *Map) Pop(key string) (interface{}, bool)
- func (cm *Map) Set(key string, value interface{})
- func (cm *Map) Size() int
- type MapItem
- type Slice
- func (cs *Slice) Append(item interface{})
- func (cs *Slice) Check(value interface{}, f Checker) bool
- func (cs *Slice) Delete(value interface{}, f Checker) error
- func (cs *Slice) Get(value interface{}, f Checker) interface{}
- func (cs *Slice) GetAll() ([]interface{}, bool)
- func (cs *Slice) GetOne() (interface{}, bool)
- func (cs *Slice) Iter() <-chan SliceItem
- func (cs *Slice) Pop() (interface{}, error)
- func (cs *Slice) PopAll() ([]interface{}, error)
- func (cs *Slice) Size() int
- type SliceItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Checker ¶
type Checker func(interface{}, interface{}) bool
Checker is a function type. You can see it as a function that you have to implement for each structure you want to add inside the slice. It should be passed as parameter at the Check() or Get() methods.
type Map ¶
Map type that can be safely shared between goroutines that require read/write access to a map
func (*Map) Iter ¶
Iter iterates over the items in a concurrent map. Each item is sent over a channel, so that we can iterate over the map using the builtin range keyword.
type MapItem ¶
type MapItem struct { Key string Value interface{} }
MapItem represents a concurrent map item
type Slice ¶
Slice type that can be safely shared between goroutines
func (*Slice) Append ¶
func (cs *Slice) Append(item interface{})
Append adds an item to the concurrent slice
func (*Slice) Get ¶
Get will return the interface corresponding with the value and the Checker given. If no Checker is given, then we're comparing interface.
func (*Slice) GetAll ¶
GetAll returns all items in the concurrent slice present when the caller calls it
func (*Slice) Iter ¶
Iter iterates over the items in the concurrent slice Each item is sent over a channel, so that we can iterate over the slice using the built-in range keyword