container

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Iterator

type Iterator[Elem any] struct {
	// contains filtered or unexported fields
}

Iterator 是一个迭代器, 它能按照你自己设置的规则返回每一次的数据 它的实现不是goroutine安全的

func NewIterator

func NewIterator[Elem any](iterate func() (Elem, bool)) *Iterator[Elem]

func (*Iterator[Elem]) Next

func (iter *Iterator[Elem]) Next() bool

func (*Iterator[Elem]) Take

func (iter *Iterator[Elem]) Take() Elem

type MutexMap

type MutexMap[Key comparable, Value any] struct {
	// contains filtered or unexported fields
}

func (*MutexMap[Key, Value]) Delete

func (m *MutexMap[Key, Value]) Delete(k Key)

func (*MutexMap[Key, Value]) Len

func (m *MutexMap[Key, Value]) Len() int

func (*MutexMap[Key, Value]) Load

func (m *MutexMap[Key, Value]) Load(k Key) Value

func (*MutexMap[Key, Value]) LoadOk

func (m *MutexMap[Key, Value]) LoadOk(k Key) (Value, bool)

func (*MutexMap[Key, Value]) Range

func (m *MutexMap[Key, Value]) Range(fn func(key Key, v Value) bool)

func (*MutexMap[Key, Value]) Store

func (m *MutexMap[Key, Value]) Store(k Key, v Value)

type RWMutexMap

type RWMutexMap[Key any, Value any] struct {
	// contains filtered or unexported fields
}

func (*RWMutexMap[Key, Value]) Delete

func (m *RWMutexMap[Key, Value]) Delete(k Key)

func (*RWMutexMap[Key, Value]) Len

func (m *RWMutexMap[Key, Value]) Len() int

func (*RWMutexMap[Key, Value]) Load

func (m *RWMutexMap[Key, Value]) Load(k Key) Value

func (*RWMutexMap[Key, Value]) LoadOk

func (m *RWMutexMap[Key, Value]) LoadOk(k Key) (Value, bool)

func (*RWMutexMap[Key, Value]) Store

func (m *RWMutexMap[Key, Value]) Store(k Key, v Value)

type Slice

type Slice[V comparable] []V

func (*Slice[V]) Append

func (s *Slice[V]) Append(v []V)

func (*Slice[V]) AppendS

func (s *Slice[V]) AppendS(vs ...V)

func (*Slice[V]) Cap

func (s *Slice[V]) Cap() int

func (*Slice[V]) Len

func (s *Slice[V]) Len() int

func (*Slice[V]) Reset

func (s *Slice[V]) Reset()

func (*Slice[V]) Unique

func (s *Slice[V]) Unique()

type SliceMap

type SliceMap[K comparable, V any] struct {
	// contains filtered or unexported fields
}

func NewSliceMap

func NewSliceMap[K comparable, V any](size int) *SliceMap[K, V]

func (*SliceMap[K, V]) Cap

func (m *SliceMap[K, V]) Cap() int

func (*SliceMap[K, V]) Delete

func (m *SliceMap[K, V]) Delete(key K)

func (*SliceMap[K, V]) Len

func (m *SliceMap[K, V]) Len() int

func (*SliceMap[K, V]) Load

func (m *SliceMap[K, V]) Load(key K) V

func (*SliceMap[K, V]) LoadOk

func (m *SliceMap[K, V]) LoadOk(key K) (V, bool)

func (*SliceMap[K, V]) Range

func (m *SliceMap[K, V]) Range(fn func(K, V) bool)

func (*SliceMap[K, V]) Reset

func (m *SliceMap[K, V]) Reset()

func (*SliceMap[K, V]) Store

func (m *SliceMap[K, V]) Store(key K, value V)

type SyncMap118

type SyncMap118[Key comparable, Value any] struct {
	SMap sync.Map
	// contains filtered or unexported fields
}

func (*SyncMap118[Key, Value]) Delete

func (s *SyncMap118[Key, Value]) Delete(k Key)

func (*SyncMap118[Key, Value]) Len

func (s *SyncMap118[Key, Value]) Len() int

func (*SyncMap118[Key, Value]) LoadOk

func (s *SyncMap118[Key, Value]) LoadOk(k Key) (Value, bool)

func (*SyncMap118[Key, Value]) Store

func (s *SyncMap118[Key, Value]) Store(k Key, v Value)

Jump to

Keyboard shortcuts

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