Documentation ¶
Index ¶
- Variables
- func SliceContains[T comparable](data []T, value T) bool
- func SliceFindIndex[T any](data []T, cmp func(v T) bool) int
- func SliceMap[T any, U any](data []T, mapFn func(v T, i int) U) []U
- func SliceReduce[T any, U any](data []T, reduceFn func(acc U, curr T, i int) U, initial U) U
- type ConcurrentMap
- func (cm *ConcurrentMap[K, T]) AsMap() map[K]T
- func (cm *ConcurrentMap[K, T]) Delete(k K)
- func (cm *ConcurrentMap[K, T]) ForEach(fn func(k K, v T))
- func (cm *ConcurrentMap[K, T]) Get(k K) T
- func (cm *ConcurrentMap[K, T]) GetWithTest(k K) (T, bool)
- func (cm *ConcurrentMap[K, T]) HasKey(k K) bool
- func (cm *ConcurrentMap[K, T]) Keys() []K
- func (cm *ConcurrentMap[K, T]) Len() int
- func (cm *ConcurrentMap[K, T]) MarshalJSON() ([]byte, error)
- func (cm *ConcurrentMap[K, T]) Set(k K, v T)
- func (cm *ConcurrentMap[K, T]) Update(fn func(k K, v T) T)
- func (cm *ConcurrentMap[K, T]) Values() []T
- type Multidict
- type Set
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrorStopIteration = errors.New("stopped iteration")
Functions ¶
func SliceContains ¶
func SliceContains[T comparable](data []T, value T) bool
func SliceFindIndex ¶ added in v0.2.2
func SliceReduce ¶ added in v0.2.2
Types ¶
type ConcurrentMap ¶ added in v0.1.3
type ConcurrentMap[K comparable, T any] struct { sync.RWMutex // contains filtered or unexported fields }
func NewConcurrentMap ¶ added in v0.1.3
func NewConcurrentMap[K comparable, T any]() *ConcurrentMap[K, T]
func NewConcurrentMapFrom ¶ added in v0.1.3
func NewConcurrentMapFrom[K comparable, T any](data map[K]T) *ConcurrentMap[K, T]
func NewConcurrentMapFromJSON ¶ added in v0.2.7
func NewConcurrentMapFromJSON[K comparable, T any](data []byte) (*ConcurrentMap[K, T], error)
func (*ConcurrentMap[K, T]) AsMap ¶ added in v0.1.6
func (cm *ConcurrentMap[K, T]) AsMap() map[K]T
AsMap creates a shallow copy of a map wrapped by this ConcurrentMap
func (*ConcurrentMap[K, T]) Delete ¶ added in v0.1.7
func (cm *ConcurrentMap[K, T]) Delete(k K)
func (*ConcurrentMap[K, T]) ForEach ¶ added in v0.1.3
func (cm *ConcurrentMap[K, T]) ForEach(fn func(k K, v T))
func (*ConcurrentMap[K, T]) Get ¶ added in v0.1.3
func (cm *ConcurrentMap[K, T]) Get(k K) T
func (*ConcurrentMap[K, T]) GetWithTest ¶ added in v0.1.3
func (cm *ConcurrentMap[K, T]) GetWithTest(k K) (T, bool)
func (*ConcurrentMap[K, T]) HasKey ¶ added in v0.1.3
func (cm *ConcurrentMap[K, T]) HasKey(k K) bool
func (*ConcurrentMap[K, T]) Keys ¶ added in v0.1.3
func (cm *ConcurrentMap[K, T]) Keys() []K
func (*ConcurrentMap[K, T]) Len ¶ added in v0.1.7
func (cm *ConcurrentMap[K, T]) Len() int
Len returns number of key-value pairs stored in the map
func (*ConcurrentMap[K, T]) MarshalJSON ¶ added in v0.2.7
func (cm *ConcurrentMap[K, T]) MarshalJSON() ([]byte, error)
func (*ConcurrentMap[K, T]) Set ¶ added in v0.1.3
func (cm *ConcurrentMap[K, T]) Set(k K, v T)
func (*ConcurrentMap[K, T]) Update ¶ added in v0.1.3
func (cm *ConcurrentMap[K, T]) Update(fn func(k K, v T) T)
func (*ConcurrentMap[K, T]) Values ¶ added in v0.1.3
func (cm *ConcurrentMap[K, T]) Values() []T
type Multidict ¶
type Multidict[T any] struct { // contains filtered or unexported fields }
func NewMultidict ¶
type Set ¶
type Set[T constraints.Ordered] struct { // contains filtered or unexported fields }
func NewSet ¶
func NewSet[T constraints.Ordered](values ...T) *Set[T]
func (*Set[T]) ToOrderedSlice ¶
func (set *Set[T]) ToOrderedSlice() []T
Click to show internal directories.
Click to hide internal directories.