Versions in this module Expand all Collapse all v1 v1.4.5 Jul 11, 2021 Changes in this version + const BitsPerByte + const NumBits + var Empty = ID + var ShortEmpty = ShortID + func EqualSubset(start, stop int, id1, id2 ID) bool + func Equals(a, b []ID) bool + func FirstDifferenceSubset(start, stop int, id1, id2 ID) (int, bool) + func IsSortedAndUniqueIDs(ids []ID) bool + func IsSortedAndUniqueShortIDs(ids []ShortID) bool + func IsUniqueShortIDs(ids []ShortID) bool + func SortIDs(ids []ID) + func SortShortIDs(ids []ShortID) + func UnsortedEquals(a, b []ID) bool + type Aliaser struct + func (a *Aliaser) Alias(id ID, alias string) error + func (a *Aliaser) Aliases(id ID) []string + func (a *Aliaser) Initialize() + func (a *Aliaser) Lookup(alias string) (ID, error) + func (a *Aliaser) PrimaryAlias(id ID) (string, error) + func (a *Aliaser) RemoveAliases(id ID) + type Bag struct + func (b *Bag) Add(ids ...ID) + func (b *Bag) AddCount(id ID, count int) + func (b *Bag) Count(id ID) int + func (b *Bag) Equals(oIDs Bag) bool + func (b *Bag) Filter(start, end int, id ID) Bag + func (b *Bag) Len() int + func (b *Bag) List() []ID + func (b *Bag) Mode() (ID, int) + func (b *Bag) SetThreshold(threshold int) + func (b *Bag) Split(index uint) [2]Bag + func (b *Bag) String() string + func (b *Bag) Threshold() Set + type BitSet uint64 + func (bs *BitSet) Add(i uint) + func (bs *BitSet) Clear() + func (bs *BitSet) Difference(s BitSet) + func (bs *BitSet) Intersection(s BitSet) + func (bs *BitSet) Remove(i uint) + func (bs *BitSet) Union(s BitSet) + func (bs BitSet) Contains(i uint) bool + func (bs BitSet) Len() int + func (bs BitSet) String() string + type ID [32]byte + func FromString(idStr string) (ID, error) + func GenerateTestID() ID + func ToID(bytes []byte) (ID, error) + func (id *ID) UnmarshalJSON(b []byte) error + func (id ID) Bit(i uint) int + func (id ID) Hex() string + func (id ID) MarshalJSON() ([]byte, error) + func (id ID) Prefix(prefixes ...uint64) ID + func (id ID) String() string + type QueueSet struct + func (qs *QueueSet) Append(id ID) + func (qs *QueueSet) GetTail() ID + func (qs *QueueSet) SetHead(id ID) + type Set map[ID]struct + func NewSet(size int) Set + func (ids *Set) Add(idList ...ID) + func (ids *Set) Clear() + func (ids *Set) Contains(id ID) bool + func (ids *Set) Overlaps(big Set) bool + func (ids *Set) Remove(idList ...ID) + func (ids *Set) Union(set Set) + func (ids Set) CappedList(size int) []ID + func (ids Set) Equals(oIDs Set) bool + func (ids Set) Len() int + func (ids Set) List() []ID + func (ids Set) String() string + type ShortBag struct + func (b *ShortBag) Add(ids ...ShortID) + func (b *ShortBag) AddCount(id ShortID, count int) + func (b *ShortBag) Count(id ShortID) int + func (b *ShortBag) Equals(oIDs ShortBag) bool + func (b *ShortBag) Len() int + func (b *ShortBag) List() []ShortID + func (b *ShortBag) PrefixedString(prefix string) string + func (b *ShortBag) Remove(id ShortID) + func (b *ShortBag) String() string + type ShortID [20]byte + func GenerateTestShortID() ShortID + func ShortFromPrefixedString(idStr, prefix string) (ShortID, error) + func ShortFromString(idStr string) (ShortID, error) + func ToShortID(bytes []byte) (ShortID, error) + func (id *ShortID) UnmarshalJSON(b []byte) error + func (id ShortID) Bytes() []byte + func (id ShortID) Hex() string + func (id ShortID) MarshalJSON() ([]byte, error) + func (id ShortID) PrefixedString(prefix string) string + func (id ShortID) String() string + type ShortSet map[ShortID]struct + func NewShortSet(size int) ShortSet + func (ids *ShortSet) Add(idList ...ShortID) + func (ids *ShortSet) Clear() + func (ids *ShortSet) Contains(id ShortID) bool + func (ids *ShortSet) Remove(idList ...ShortID) + func (ids *ShortSet) Union(idSet ShortSet) + func (ids ShortSet) CappedList(size int) []ShortID + func (ids ShortSet) Equals(oIDs ShortSet) bool + func (ids ShortSet) Len() int + func (ids ShortSet) List() []ShortID + func (ids ShortSet) String() string + type UniqueBag map[ID]BitSet + func (b *UniqueBag) Add(setID uint, idSet ...ID) + func (b *UniqueBag) Bag(alpha int) Bag + func (b *UniqueBag) Difference(diff *UniqueBag) + func (b *UniqueBag) DifferenceSet(id ID, set BitSet) + func (b *UniqueBag) GetSet(id ID) BitSet + func (b *UniqueBag) List() []ID + func (b *UniqueBag) RemoveSet(id ID) + func (b *UniqueBag) String() string + func (b *UniqueBag) UnionSet(id ID, set BitSet)