Documentation
¶
Index ¶
- func Compare(a, b Guid) int
- func Equal(a, b Guid) bool
- type Guid
- type HashSet
- func (hs HashSet) Add(item Guid) bool
- func (hs HashSet) Clear()
- func (hs HashSet) Contains(item Guid) bool
- func (hs HashSet) ExceptWith(other []Guid)
- func (hs HashSet) ExceptWithSet(other HashSet)
- func (hs HashSet) IntersectWith(other []Guid)
- func (hs HashSet) IntersectWithSet(other HashSet)
- func (hs HashSet) IsEmpty() bool
- func (hs HashSet) IsProperSubsetOf(other []Guid) bool
- func (hs HashSet) IsProperSubsetOfSet(other HashSet) bool
- func (hs HashSet) IsProperSupersetOf(other []Guid) bool
- func (hs HashSet) IsProperSupersetOfSet(other HashSet) bool
- func (hs HashSet) IsSubsetOf(other []Guid) bool
- func (hs HashSet) IsSubsetOfSet(other HashSet) bool
- func (hs HashSet) IsSupersetOf(other []Guid) bool
- func (hs HashSet) IsSupersetOfSet(other HashSet) bool
- func (hs HashSet) Keys() []Guid
- func (hs HashSet) Overlaps(other []Guid) bool
- func (hs HashSet) OverlapsSet(other HashSet) bool
- func (hs HashSet) Remove(item Guid) bool
- func (hs HashSet) RemoveWhere(predicate func(Guid) bool) int
- func (hs HashSet) SetEquals(other []Guid) bool
- func (hs HashSet) SetEqualsSet(other HashSet) bool
- func (hs HashSet) SymmetricExceptWith(other []Guid)
- func (hs HashSet) SymmetricExceptWithSet(other HashSet)
- func (hs HashSet) UnionWith(other []Guid)
- func (hs HashSet) UnionWithSet(other HashSet)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Guid ¶
type Guid [16]byte
Guid is a standard 128-bit UUID value (16-bytes) that can handle alternate wire serialization encodings.
func FromBytes ¶
FromBytes creates a new Guid from a byte slice. Only first 16 bytes of slice are used. Returns an error if slice length is less than 16. Bytes are copied from the slice.
func (Guid) Compare ¶ added in v0.5.0
Compare returns an integer comparing this Guid (g) to other Guid. The result will be 0 if g==other, -1 if this g < other, and +1 if g > other.
func (Guid) Components ¶ added in v0.5.0
Components gets the Guid value as its constituent components.
func (Guid) Equal ¶ added in v0.5.0
Equal returns true if this Guid and other Guid values are equal.
func (Guid) IsZero ¶ added in v0.3.0
IsZero determines if the Guid value is its zero value, i.e., empty.
type HashSet ¶
type HashSet map[Guid]void
HashSet represents a distinct collection of Guid values, i.e., a set. A HashSet is not sorted and will not contain duplicate elements. The methods of the HashSet are not intrinsically thread-safe procedures, to guarantee thread safety, you should initiate a lock before calling a method.
func NewHashSet ¶
NewHashSet creates a new set containing all elements in the specified slice. Returns a new HashSet that contain the specified slice items.
func (HashSet) Add ¶
Add adds the specified element to a set. Returns true if item was added to the set; otherwise, false.
func (HashSet) Contains ¶
Contains determines whether a set contains the specified element. Returns true if the set contains the specified element; otherwise, false.
func (HashSet) ExceptWith ¶
ExceptWith removes all elements in the specified slice from the current set.
func (HashSet) ExceptWithSet ¶
ExceptWithSet removes all elements in the specified set from the current set.
func (HashSet) IntersectWith ¶
IntersectWith modifies the current set to contain only elements that are present in the set and in the specified slice.
func (HashSet) IntersectWithSet ¶
IntersectWithSet modifies the current set to contain only elements that are present in the set and in the specified set.
func (HashSet) IsEmpty ¶
IsEmpty determines if set contains no elements. Returns true if the set is empty, i.e., has a length of zero; otherwise, false.
func (HashSet) IsProperSubsetOf ¶
IsProperSubsetOf determines whether a set is a proper subset of the specified slice. Returns true if the set is a proper subset of other slice items; otherwise, false.
func (HashSet) IsProperSubsetOfSet ¶
IsProperSubsetOfSet determines whether a set is a proper subset of the specified set. Returns true if the set is a proper subset of other set; otherwise, false.
func (HashSet) IsProperSupersetOf ¶
IsProperSupersetOf determines whether a set is a proper superset of the specified slice. Returns true if the set is a proper superset of other slice items; otherwise, false.
func (HashSet) IsProperSupersetOfSet ¶
IsProperSupersetOfSet determines whether a set is a proper superset of the specified set. Returns true if the set is a proper superset of other set; otherwise, false.
func (HashSet) IsSubsetOf ¶
IsSubsetOf determines whether a set is a subset of the specified slice. Returns true if the set is a subset of other slice items; otherwise, false.
func (HashSet) IsSubsetOfSet ¶
IsSubsetOfSet determines whether a set is a subset of the specified set. Returns true if the set is a subset of other set; otherwise, false.
func (HashSet) IsSupersetOf ¶
IsSupersetOf determines whether a set is a superset of the specified slice. Returns true if the set is a superset of other slice items; otherwise, false.
func (HashSet) IsSupersetOfSet ¶
IsSupersetOfSet determines whether a set is a superset of the specified set. Returns true if the set is a superset of other set; otherwise, false.
func (HashSet) Keys ¶
Keys copies the elements of a set to a slice. Returns a slice containing the elements of the set.
func (HashSet) Overlaps ¶
Overlaps determines whether the current set and a specified slice share common elements. Returns true if the current set and other slice items share at least one common element; otherwise, false.
func (HashSet) OverlapsSet ¶
OverlapsSet determines whether the current set and a specified set share common elements. Returns true if the current set and other set share at least one common element; otherwise, false.
func (HashSet) Remove ¶
Remove removes the specified element from a set. Returns true if item was removed from the set; otherwise, false.
func (HashSet) RemoveWhere ¶
RemoveWhere removes all elements that match the conditions defined by the specified predicate from a set. Returns number of elements that were removed from the set.
func (HashSet) SetEquals ¶
SetEquals determines whether a set and the specified slice contain the same elements. Returns true if the set is equal to other slice items; otherwise, false.
func (HashSet) SetEqualsSet ¶
SetEqualsSet determines whether a set and the specified set contain the same elements. Returns true if the set is equal to other set; otherwise, false.
func (HashSet) SymmetricExceptWith ¶
SymmetricExceptWith modifies the current set to contain only elements that are present either in the set or in the specified slice, but not both.
func (HashSet) SymmetricExceptWithSet ¶
SymmetricExceptWithSet modifies the current set to contain only elements that are present either in the set or in the specified set, but not both.
func (HashSet) UnionWith ¶
UnionWith modifies the current set to contain all elements that are present in the set, the specified slice, or both.
func (HashSet) UnionWithSet ¶
UnionWithSet modifies the current set to contain all elements that are present in the set, the specified set, or both.