pool

package
v0.0.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2022 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Callback

type Callback func(key, value interface{}) bool

type Impl

type Impl struct {
	// contains filtered or unexported fields
}

func NewPool

func NewPool() *Impl

func (*Impl) Clear

func (p *Impl) Clear()

func (*Impl) ForEach

func (p *Impl) ForEach(cb Callback)

func (*Impl) Get

func (p *Impl) Get(key interface{}) interface{}

func (*Impl) GetOrPut

func (p *Impl) GetOrPut(key, value interface{}) (interface{}, bool)

func (*Impl) Pool

func (p *Impl) Pool() *sync.Map

func (*Impl) Pop

func (p *Impl) Pop(key interface{}) interface{}

func (*Impl) Put

func (p *Impl) Put(key, value interface{})

func (*Impl) Remove

func (p *Impl) Remove(key interface{})

func (*Impl) Size

func (p *Impl) Size() int

type Pool

type Pool interface {
	ForEach(Callback)
	Pool() *sync.Map
	Put(key, value interface{})
	Get(key interface{}) interface{}
	GetOrPut(key, value interface{}) (interface{}, bool)
	Pop(key interface{}) interface{}
	Remove(key interface{})
	Size() int
	Clear()
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL