set

package
v1.11.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 2, 2023 License: Apache-2.0 Imports: 0 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnySet added in v1.3.0

type AnySet struct {
	// contains filtered or unexported fields
}

AnySet is a set stores interface{}

func NewAnySet added in v1.3.0

func NewAnySet(eq func(a interface{}, b interface{}) bool, aa ...interface{}) *AnySet

NewAnySet builds a AnySet

func (*AnySet) Difference added in v1.3.0

func (s *AnySet) Difference(rhs *AnySet) *AnySet

Difference returns the difference of two sets

func (*AnySet) Exist added in v1.3.0

func (s *AnySet) Exist(val interface{}) bool

Exist checks whether `val` exists in `s`.

func (*AnySet) Insert added in v1.3.0

func (s *AnySet) Insert(val interface{})

Insert inserts `val` into `s`.

func (*AnySet) Intersection added in v1.3.0

func (s *AnySet) Intersection(rhs *AnySet) *AnySet

Intersection returns the intersection of two sets

func (*AnySet) Remove added in v1.3.0

func (s *AnySet) Remove(val interface{})

Remove removes `val` from `s`

func (*AnySet) Slice added in v1.3.0

func (s *AnySet) Slice() []interface{}

Slice converts the set to a slice

type StringSet

type StringSet map[string]struct{}

StringSet is a string set.

func NewStringSet

func NewStringSet(ss ...string) StringSet

NewStringSet builds a string set.

func (StringSet) Difference

func (s StringSet) Difference(rhs StringSet) StringSet

Difference returns the difference of two sets

func (StringSet) Exist

func (s StringSet) Exist(val string) bool

Exist checks whether `val` exists in `s`.

func (StringSet) Insert

func (s StringSet) Insert(val string)

Insert inserts `val` into `s`.

func (StringSet) Intersection

func (s StringSet) Intersection(rhs StringSet) StringSet

Intersection returns the intersection of two sets

func (StringSet) Join added in v1.3.0

func (s StringSet) Join(add StringSet) StringSet

Join add all elements of `add` to `s`.

func (StringSet) Remove

func (s StringSet) Remove(val string)

Remove removes `val` from `s`

func (StringSet) Slice added in v1.0.6

func (s StringSet) Slice() []string

Slice converts the set to a slice

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL