Versions in this module Expand all Collapse all v1 v1.0.2 Jul 31, 2023 Changes in this version type Set + func (ss Set[T]) Intersect(obj Set[T]) Set[T] v1.0.1 Jul 17, 2023 v1.0.0 Jul 17, 2023 Changes in this version + func BytesToStr(bytes []byte) string + func Clone(strSlice []T) []T + func Compact(slice *[]T) + func Contain(slice []T, s T) bool + func Dedup(slice []T) []T + func DedupSlice(slice *[]T, keyFn func(v T) string) + func Equals(a, b []T) bool + func Filter(slices *[]T, predictFn func(i int) bool) + func FilterValues(slice []T, needles ...T) []T + func Find(slice []T, s T) int + func First(strSlice []T) (ret T) + func Int32ToStrSlice(arr []int32) []string + func Int64ToStrSlice(arr []int64) []string + func InterfaceSlice(arr []T) []interface + func Last(strSlice []T) (ret T) + func Map(slice []T, fn func(v T) K) []K + func Repeat(n int, element T) []T + func Reverse(slice []T) []T + func StrToBytes(str string) []byte + type BitSet uint64 + func (bs BitSet[T]) Add(bsr *BitSetRange[T], strs ...T) BitSet[T] + func (bs BitSet[T]) Contains(bsr *BitSetRange[T], s T) bool + func (bs BitSet[T]) Difference(obj BitSet[T]) BitSet[T] + func (bs BitSet[T]) HasOverlap(obj BitSet[T]) bool + func (bs BitSet[T]) Intersect(obj BitSet[T]) BitSet[T] + func (bs BitSet[T]) Length() int + func (bs BitSet[T]) Slices(bsr *BitSetRange[T]) []T + func (bs BitSet[T]) Union(obj BitSet[T]) BitSet[T] + type BitSetRange struct + func NewBitSetRange(categories ...T) (*BitSetRange[T], error) + func (bsr *BitSetRange[T]) NewBitSet(categories ...T) BitSet[T] + type Heap struct + func NewHeap(heapSize int, cmpFunc func(i, j T) bool) *Heap[T] + func (h *Heap[T]) Cap() int + func (h *Heap[T]) IsEmpty() bool + func (h *Heap[T]) IsFull() bool + func (h *Heap[T]) Len() int + func (h *Heap[T]) Peek() (T, error) + func (h *Heap[T]) Pop() (T, error) + func (h *Heap[T]) Push(element T) error + type IntRange struct + Max int + Min int + func MergeIntRanges(rs ...*IntRange) []*IntRange + func ParseIntRange(s string) (*IntRange, error) + func ParseIntRanges(s []string) ([]*IntRange, error) + func (r *IntRange) Contains(i int) bool + func (r *IntRange) String() string + type IntRanges []*IntRange + func (rs IntRanges) Contains(i int) bool + type OrderedSet map[T]int + func NewOrderedSet(slice ...T) OrderedSet[T] + func (os OrderedSet[T]) Contain(s T) bool + func (os OrderedSet[T]) Find(s T) int + type Ring struct + Data []T + Lock sync.RWMutex + func NewRing(cap int) *Ring[T] + func (rs *Ring[T]) Append(ele ...T) + func (rs *Ring[T]) Cap() int + func (rs *Ring[T]) Get(idx int) (T, error) + func (rs *Ring[T]) Len() int + func (rs *Ring[T]) Size() int + type Set map[T]struct + func NewSet(slices ...T) Set[T] + func (ss Set[T]) Add(strs ...T) Set[T] + func (ss Set[T]) Contains(s T) bool + func (ss Set[T]) Delete(strs ...T) Set[T] + func (ss Set[T]) Difference(obj Set[T]) Set[T] + func (ss Set[T]) Exclude(obj Set[T]) Set[T] + func (ss Set[T]) HasOverlap(obj Set[T]) bool + func (ss Set[T]) Length() int + func (ss Set[T]) Merge(obj Set[T]) Set[T] + func (ss Set[T]) Slice() []T + func (ss Set[T]) Union(obj Set[T]) Set[T]