Documentation
¶
Index ¶
- Variables
- type Set
- func Diff[V constraints.Ordered](s1, s2 Set[V]) (both, only1, only2 Set[V])
- func Intersection[V constraints.Ordered](s1, s2 Set[V]) Set[V]
- func Of[V constraints.Ordered](values ...V) Set[V]
- func Subtract[V constraints.Ordered](s1, s2 Set[V]) Set[V]
- func Union[V constraints.Ordered](s1, s2 Set[V]) Set[V]
- 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 (set Set[V]) MarshalJSON() ([]byte, error)
- func (s *Set[V]) Remove(values ...V)
- func (s Set[V]) RemoveSet(another Set[V])
- func (set *Set[V]) UnmarshalJSON(data []byte) error
- 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 ¶
This section is empty.
Types ¶
type Set ¶ added in v0.2.0
type Set[V constraints.Ordered] map[V]struct{}
func Diff ¶ added in v0.2.0
func Diff[V constraints.Ordered](s1, s2 Set[V]) (both, only1, only2 Set[V])
func Intersection ¶ added in v0.2.0
func Intersection[V constraints.Ordered](s1, s2 Set[V]) Set[V]
func Of ¶ added in v0.2.0
func Of[V constraints.Ordered](values ...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 T ¶
type T struct {
// contains filtered or unexported fields
}
func TIntersection ¶ added in v0.2.0
func (T) ContainsAll ¶
func (T) ContainsAny ¶
Click to show internal directories.
Click to hide internal directories.