container

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain added in v0.0.2

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

func NewChain added in v0.0.2

func NewChain(handlers ...Handler) *Chain

func (*Chain) Next added in v0.0.2

func (c *Chain) Next(value interface{})

func (*Chain) Use added in v0.0.2

func (c *Chain) Use(handler Handler)

type Handler added in v0.0.2

type Handler func(value interface{}) (handled bool)

type Map

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

func NewMap

func NewMap() *Map

func (*Map) Delete

func (m *Map) Delete(key interface{})

func (*Map) Exists

func (m *Map) Exists(key interface{}) (exists bool)

func (*Map) Get

func (m *Map) Get(key interface{}) (value interface{}, exists bool)

func (*Map) Length

func (m *Map) Length() uint64

func (*Map) Set

func (m *Map) Set(key interface{}, value interface{})

type Queue

type Queue interface {
	Push(value interface{})
	Pop() (value interface{})
	Length() (len uint32)
}

func NewLocklessQueue

func NewLocklessQueue() Queue

type Set

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

非线程安全版本,如需要线程安全版本,需要自行加锁 注意不同类型的同一个值是不同的item,如a int64 = 8 与 b int32 = 8 不是同一个值

func NewSet

func NewSet(values ...interface{}) *Set

func (*Set) Add

func (set *Set) Add(items ...interface{})

func (*Set) Clear

func (set *Set) Clear()

func (*Set) Contains

func (set *Set) Contains(items ...interface{}) bool

func (*Set) Empty

func (set *Set) Empty() bool

func (*Set) Remove

func (set *Set) Remove(items ...interface{})

func (*Set) Size

func (set *Set) Size() int

Jump to

Keyboard shortcuts

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