Documentation ¶
Index ¶
- Variables
- func AscLess[V constraints.Ordered](v1, v2 V) bool
- func DescLess[V constraints.Ordered](v1, v2 V) bool
- type Set
- func (s *Set[V]) Add(values ...V)
- func (s Set[V]) AddSet(another Set[V])
- func (s Set[V]) Clone() Set[V]
- func (s Set[V]) Contains(value V) bool
- func (s Set[V]) ContainsAll(values ...V) bool
- func (s Set[V]) ContainsAllOfSet(another Set[V]) bool
- func (s Set[V]) ContainsAny(values ...V) bool
- func (s Set[V]) ContainsAnyOfSet(another Set[V]) bool
- func (s Set[V]) List() []V
- func (s Set[V]) MarshalJSON() ([]byte, error)
- func (s *Set[V]) Remove(values ...V)
- func (s Set[V]) RemoveSet(another Set[V])
- func (s *Set[V]) UnmarshalJSON(data []byte) error
- type SortableSet
- type T
- func (set *T) Add(es ...interface{})
- func (set *T) AddSet(another T)
- func (set T) Clone() T
- func (set T) Contains(e interface{}) bool
- func (set T) ContainsAll(es ...interface{}) bool
- func (set T) ContainsAny(es ...interface{}) bool
- func (set T) List() interface{}
- func (set *T) New(t reflect.Type)
- func (set *T) Remove(es ...interface{})
- func (set *T) RemoveSet(another T)
Constants ¶
This section is empty.
Variables ¶
View Source
var MarshalOrder = 0
MarshalOrder can change the order of the elements when marshaling. 1 for desc 2 for asc 0 or other value for no certain order
Functions ¶
func AscLess ¶ added in v0.2.7
func AscLess[V constraints.Ordered](v1, v2 V) bool
func DescLess ¶ added in v0.2.7
func DescLess[V constraints.Ordered](v1, v2 V) bool
Types ¶
type Set ¶ added in v0.2.0
type Set[V comparable] map[V]struct{}
func Diff ¶ added in v0.2.0
func Diff[V comparable](s1, s2 Set[V]) (both, only1, only2 Set[V])
func Intersect ¶ added in v0.2.2
func Intersect[V comparable](s1, s2 Set[V]) Set[V]
func Of ¶ added in v0.2.0
func Of[V comparable](values ...V) Set[V]
func Subtract ¶ added in v0.2.0
func Subtract[V comparable](s1, s2 Set[V]) Set[V]
func Union ¶ added in v0.2.0
func Union[V comparable](s1, s2 Set[V]) Set[V]
func (Set[V]) ContainsAll ¶ added in v0.2.0
func (Set[V]) ContainsAllOfSet ¶ added in v0.2.0
func (Set[V]) ContainsAny ¶ added in v0.2.0
func (Set[V]) ContainsAnyOfSet ¶ added in v0.2.0
func (Set[V]) MarshalJSON ¶ added in v0.2.0
func (*Set[V]) UnmarshalJSON ¶ added in v0.2.0
type SortableSet ¶ added in v0.2.1
type SortableSet[V constraints.Ordered] map[V]struct{}
func (SortableSet[V]) MarshalJSON ¶ added in v0.2.1
func (s SortableSet[V]) MarshalJSON() ([]byte, error)
func (SortableSet[V]) OrderedList ¶ added in v0.2.7
func (s SortableSet[V]) OrderedList(less func(v1, v2 V) bool) []V
OrderedList return an ordered list can use AscLess, DescLess as less function
func (*SortableSet[V]) UnmarshalJSON ¶ added in v0.2.1
func (s *SortableSet[V]) UnmarshalJSON(data []byte) error
type T ¶
type T struct {
// contains filtered or unexported fields
}
func TIntersect ¶ added in v0.2.2
func (T) ContainsAll ¶
func (T) ContainsAny ¶
Click to show internal directories.
Click to hide internal directories.