Documentation ¶
Index ¶
- Variables
- type ArraySet
- func (s *ArraySet[T]) Append(values ...T) error
- func (s *ArraySet[T]) CallFullCallback() error
- func (s *ArraySet[T]) Include(value T) bool
- func (s *ArraySet[T]) Index(value T) int
- func (s *ArraySet[T]) Length() int64
- func (s *ArraySet[T]) List() []T
- func (s *ArraySet[T]) Reset()
- func (s *ArraySet[T]) SetFullCallback(call func([]T, int64) error)
- func (s *ArraySet[T]) Size() int64
- type Comparable
- type IPNet
- type IPNets
- type Set
- func (s Set[T]) Clone() Set[T]
- func (s Set[T]) Delete(items ...T) Set[T]
- func (s Set[T]) Difference(s2 Set[T]) Set[T]
- func (s Set[T]) Equal(s2 Set[T]) bool
- func (s Set[T]) Has(item T) bool
- func (s Set[T]) HasAll(items ...T) bool
- func (s Set[T]) HasAny(items ...T) bool
- func (s Set[T]) Insert(items ...T) Set[T]
- func (s Set[T]) Intersection(s2 Set[T]) Set[T]
- func (s Set[T]) IsSuperset(s2 Set[T]) bool
- func (s Set[T]) Len() int
- func (s Set[T]) List() []T
- func (s Set[T]) PopAny() (T, bool)
- func (s Set[T]) SortedList() []T
- func (s Set[T]) String() string
- func (s Set[T]) Union(s2 Set[T]) Set[T]
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrorSetFull = fmt.Errorf("set Is Full")
Functions ¶
This section is empty.
Types ¶
type ArraySet ¶ added in v1.1.2
type ArraySet[T any] struct { // contains filtered or unexported fields }
func NewArraySet ¶ added in v1.1.2
func (*ArraySet[T]) CallFullCallback ¶ added in v1.1.2
func (*ArraySet[T]) SetFullCallback ¶ added in v1.1.2
type Comparable ¶
type IPNet ¶ added in v1.1.0
func ParseIPNet ¶ added in v1.2.3
func (IPNet) MarshalJSON ¶ added in v1.2.4
func (*IPNet) UnmarshalJSON ¶ added in v1.1.0
type Set ¶
type Set[T Comparable] map[T]int
func New ¶
func New[T Comparable](items ...T) Set[T]
func (Set[T]) Difference ¶
Difference returns a set of objects that are not in s2 For example: s1 = {a1, a2, a3} s2 = {a1, a2, a4, a5} s1.Difference(s2) = {a3} s2.Difference(s1) = {a4, a5}
func (Set[T]) Equal ¶
Equal returns true if and only if s1 is equal (as a set) to s2. Two sets are equal if their membership is identical. (In practice, this means same elements, order doesn't matter)
func (Set[T]) Intersection ¶
Intersection returns a new set which includes the item in BOTH s1 and s2 For example: s1 = {a1, a2} s2 = {a2, a3} s1.Intersection(s2) = {a2}
func (Set[T]) IsSuperset ¶
IsSuperset returns true if and only if s1 is a superset of s2.
func (Set[T]) SortedList ¶
func (s Set[T]) SortedList() []T
SortedList returns the slice with contents in random order.
Click to show internal directories.
Click to hide internal directories.