Documentation
¶
Index ¶
- type Callback
- type Impl
- func (p *Impl) Cap() int
- func (p *Impl) Clear()
- func (p *Impl) ForEach(cb Callback)
- func (p *Impl) Get(key interface{}) interface{}
- func (p *Impl) GetOrPut(key, value interface{}) (interface{}, bool, *gerr.GatewayDError)
- func (p *Impl) Pool() *sync.Map
- func (p *Impl) Pop(key interface{}) interface{}
- func (p *Impl) Put(key, value interface{}) *gerr.GatewayDError
- func (p *Impl) Remove(key interface{})
- func (p *Impl) Size() int
- type Pool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Impl ¶
type Impl struct {
// contains filtered or unexported fields
}
func (*Impl) ForEach ¶
ForEach iterates over the pool and calls the callback function for each key/value pair.
func (*Impl) Get ¶
func (p *Impl) Get(key interface{}) interface{}
Get returns the value for the given key.
func (*Impl) GetOrPut ¶
func (p *Impl) GetOrPut(key, value interface{}) (interface{}, bool, *gerr.GatewayDError)
GetOrPut returns the value for the given key if it exists, otherwise it adds the key/value pair to the pool.
func (*Impl) Pop ¶
func (p *Impl) Pop(key interface{}) interface{}
Pop removes the key/value pair from the pool and returns the value.
func (*Impl) Put ¶
func (p *Impl) Put(key, value interface{}) *gerr.GatewayDError
Put adds a new key/value pair to the pool.
type Pool ¶
type Pool interface {
ForEach(Callback)
Pool() *sync.Map
Put(key, value interface{}) *gerr.GatewayDError
Get(key interface{}) interface{}
GetOrPut(key, value interface{}) (interface{}, bool, *gerr.GatewayDError)
Pop(key interface{}) interface{}
Remove(key interface{})
Size() int
Clear()
Cap() int
}
Click to show internal directories.
Click to hide internal directories.