Documentation ¶
Index ¶
- type Channel
- type ChannelIntMap
- func (m *ChannelIntMap) Copy() (c map[Channel]int)
- func (m *ChannelIntMap) Delete(key Channel)
- func (m *ChannelIntMap) Exists(key Channel) bool
- func (m *ChannelIntMap) Get(key Channel) int
- func (m *ChannelIntMap) GetEx(key Channel) (int, bool)
- func (m *ChannelIntMap) Len() int
- func (m *ChannelIntMap) Open(f func())
- func (m *ChannelIntMap) Set(key Channel, val int)
- func (m *ChannelIntMap) SetIfNotExist(key Channel, val int) int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChannelIntMap ¶
type ChannelIntMap struct { sync.Mutex // M contains the underlying map. // Goroutines which access M directly should hold // the mutex. M map[Channel]int }
ChannelIntMap is a generated thread safe map with key Channel and value int
func NewChannelIntMap ¶
func NewChannelIntMap() *ChannelIntMap
NewChannelIntMap returns an instantiated thread safe map with key Channel and value int
func (*ChannelIntMap) Copy ¶
func (m *ChannelIntMap) Copy() (c map[Channel]int)
Copy generates a copy of the map.
func (*ChannelIntMap) Delete ¶
func (m *ChannelIntMap) Delete(key Channel)
Delete removes a key from the map
func (*ChannelIntMap) Exists ¶
func (m *ChannelIntMap) Exists(key Channel) bool
Exists returns if a key exists
func (*ChannelIntMap) Get ¶
func (m *ChannelIntMap) Get(key Channel) int
Get retrieves a key from the map
func (*ChannelIntMap) GetEx ¶
func (m *ChannelIntMap) GetEx(key Channel) (int, bool)
GetEx retrieves a key from the map and whether it exists
func (*ChannelIntMap) Open ¶
func (m *ChannelIntMap) Open(f func())
Open allows a closure to safely operate on the map
func (*ChannelIntMap) Set ¶
func (m *ChannelIntMap) Set(key Channel, val int)
Set sets a key on the map
func (*ChannelIntMap) SetIfNotExist ¶
func (m *ChannelIntMap) SetIfNotExist(key Channel, val int) int
SetIfNotExist sets a key on the map if it doesn't exist. It returns the value which is set.
Click to show internal directories.
Click to hide internal directories.