sets

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2022 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MultiSet

type MultiSet map[string]Set

func (MultiSet) Add

func (s MultiSet) Add(key string, values ...string) MultiSet

func (MultiSet) AddIfNotExists

func (s MultiSet) AddIfNotExists(key, value string) bool

AddIfNotExists returns true if the key was added, false if it already existed

func (MultiSet) Clone

func (s MultiSet) Clone() MultiSet

func (MultiSet) Delete

func (s MultiSet) Delete(keys ...string) MultiSet

func (MultiSet) DeleteValues

func (s MultiSet) DeleteValues(key string, values ...string) MultiSet

func (MultiSet) Equal

func (s MultiSet) Equal(os MultiSet) bool

func (MultiSet) Has

func (s MultiSet) Has(key, sub string) bool

func (MultiSet) Keys

func (s MultiSet) Keys() []string

func (MultiSet) Len

func (s MultiSet) Len() int

func (MultiSet) MarshalJSON

func (s MultiSet) MarshalJSON() ([]byte, error)

func (MultiSet) Match

func (s MultiSet) Match(fn func(key string, s Set) bool, all bool) bool

func (MultiSet) Merge

func (s MultiSet) Merge(o MultiSet) MultiSet

func (MultiSet) MergeSet

func (s MultiSet) MergeSet(key string, o Set) MultiSet

func (*MultiSet) Set

func (s *MultiSet) Set(key string, values ...string) MultiSet

func (MultiSet) SortedKeys

func (s MultiSet) SortedKeys() []string

func (MultiSet) String

func (s MultiSet) String() string

func (MultiSet) Values

func (s MultiSet) Values(key string) Set

type SafeSet

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

func SafeSetOf

func SafeSetOf(keys ...string) *SafeSet

func (*SafeSet) Add

func (ss *SafeSet) Add(keys ...string) *SafeSet

func (*SafeSet) AddIfNotExists

func (ss *SafeSet) AddIfNotExists(key string) bool

func (*SafeSet) Clone

func (ss *SafeSet) Clone() *SafeSet

func (*SafeSet) Delete

func (ss *SafeSet) Delete(keys ...string) *SafeSet

func (*SafeSet) Has

func (ss *SafeSet) Has(key string) bool

func (*SafeSet) Keys

func (ss *SafeSet) Keys() []string

func (*SafeSet) Len

func (ss *SafeSet) Len() int

func (*SafeSet) MarshalJSON

func (ss *SafeSet) MarshalJSON() ([]byte, error)

func (*SafeSet) Merge

func (ss *SafeSet) Merge(o Set) *SafeSet

func (*SafeSet) MergeSafe

func (ss *SafeSet) MergeSafe(o *SafeSet) *SafeSet

func (*SafeSet) Set

func (ss *SafeSet) Set(keys ...string) *SafeSet

func (*SafeSet) SortedKeys

func (ss *SafeSet) SortedKeys() []string

func (*SafeSet) UnmarshalJSON

func (ss *SafeSet) UnmarshalJSON(data []byte) error

type Set

type Set map[string]struct{}

Set is a simple set.

func SetOf

func SetOf(keys ...string) Set

func (Set) Add

func (s Set) Add(keys ...string) Set

func (*Set) AddIfNotExists

func (s *Set) AddIfNotExists(key string) bool

AddIfNotExists returns true if the key was added, false if it already existed

func (Set) Clone

func (s Set) Clone() Set

func (Set) Delete

func (s Set) Delete(keys ...string) Set

func (Set) Equal

func (s Set) Equal(os Set) bool

func (Set) Has

func (s Set) Has(key string) bool

func (Set) Keys

func (s Set) Keys() []string

func (Set) Len

func (s Set) Len() int

func (Set) MarshalJSON

func (s Set) MarshalJSON() ([]byte, error)

func (Set) Merge

func (s Set) Merge(os ...Set) Set

func (*Set) Set

func (s *Set) Set(keys ...string) Set

func (Set) SortedKeys

func (s Set) SortedKeys() []string

func (Set) String

func (s Set) String() string

func (*Set) UnmarshalJSON

func (s *Set) UnmarshalJSON(data []byte) (err error)

Jump to

Keyboard shortcuts

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