Documentation ¶
Index ¶
- type KeyType
- type KeyTypeSet
- func (set *KeyTypeSet) Add(items ...KeyType)
- func (set *KeyTypeSet) Clear()
- func (set *KeyTypeSet) Contains(items ...KeyType) bool
- func (set *KeyTypeSet) Empty() bool
- func (set *KeyTypeSet) FromJSON(data []byte) error
- func (set *KeyTypeSet) Remove(items ...KeyType)
- func (set *KeyTypeSet) Size() int
- func (set *KeyTypeSet) String() string
- func (set *KeyTypeSet) ToJSON() ([]byte, error)
- func (set *KeyTypeSet) Values() []KeyType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeyTypeSet ¶
type KeyTypeSet struct {
// contains filtered or unexported fields
}
KeyTypeSet holds elements in go's native map
func NewKeyTypeSet ¶
func NewKeyTypeSet(values ...KeyType) *KeyTypeSet
NewKeyTypeSet instantiates a new empty set and adds the passed values, if any, to the set
func (*KeyTypeSet) Add ¶
func (set *KeyTypeSet) Add(items ...KeyType)
Add adds the items (one or more) to the set.
func (*KeyTypeSet) Contains ¶
func (set *KeyTypeSet) Contains(items ...KeyType) bool
Contains check if items (one or more) are present in the set. All items have to be present in the set for the method to return true. Returns true if no arguments are passed at all, i.e. set is always superset of empty set.
func (*KeyTypeSet) Empty ¶
func (set *KeyTypeSet) Empty() bool
Empty returns true if set does not contain any elements.
func (*KeyTypeSet) FromJSON ¶
func (set *KeyTypeSet) FromJSON(data []byte) error
FromJSON populates the set from the input JSON representation.
func (*KeyTypeSet) Remove ¶
func (set *KeyTypeSet) Remove(items ...KeyType)
Remove removes the items (one or more) from the set.
func (*KeyTypeSet) Size ¶
func (set *KeyTypeSet) Size() int
Size returns number of elements within the set.
func (*KeyTypeSet) String ¶
func (set *KeyTypeSet) String() string
String returns a string representation of container
func (*KeyTypeSet) ToJSON ¶
func (set *KeyTypeSet) ToJSON() ([]byte, error)
ToJSON outputs the JSON representation of the set.
func (*KeyTypeSet) Values ¶
func (set *KeyTypeSet) Values() []KeyType
Values returns all items in the set.