Documentation
¶
Overview ¶
Package types declares various data types and implements type-checking functions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ID ¶
type ID uint64
ID represents a generic identifier which is canonically stored as a uint64 but is typically represented as a base-16 string for input/output
func IDFromString ¶
IDFromString attempts to create an ID from a base-16 string.
type Set ¶
type Set interface {
Add(string)
Remove(string)
Contains(val ...string) bool
Equals(Set) bool
Length() int
Values() []string
Copy() Set
Sub(Set) Set
// ContainsAll returns whether the set contains all given values
// Deprecated: Use Contains instead.
ContainsAll(values []string) bool
}
func NewUnsafeSet ¶
type ThreadsafeSet ¶ added in v3.7.0
type ThreadsafeSet interface {
Set
}
func NewThreadsafeSet ¶
func NewThreadsafeSet(values ...string) ThreadsafeSet
type URLsMap ¶
URLsMap is a map from a name to its URLs.
func NewURLsMap ¶
NewURLsMap returns a URLsMap instantiated from the given string, which consists of discovery-formatted names-to-URLs, like: mach0=http://1.1.1.1:2380,mach0=http://2.2.2.2::2380,mach1=http://3.3.3.3:2380,mach2=http://4.4.4.4:2380
func NewURLsMapFromStringMap ¶
NewURLsMapFromStringMap takes a map of strings and returns a URLsMap. The string values in the map can be multiple values separated by the sep string.
type Uint64Slice ¶
type Uint64Slice []uint64
Uint64Slice implements sort interface
func (Uint64Slice) Len ¶
func (p Uint64Slice) Len() int
func (Uint64Slice) Less ¶
func (p Uint64Slice) Less(i, j int) bool
func (Uint64Slice) Swap ¶
func (p Uint64Slice) Swap(i, j int)