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 ¶
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 URLs ¶
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.
func (URLsMap) String ¶
String turns URLsMap into discovery-formatted name-to-URLs sorted by name.
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)