Documentation
¶
Index ¶
- func DumpJSON(r interface{}) string
- func SortUint64s(a []uint64)
- type ID
- type IDSet
- func (s IDSet) Add(ids ...ID)
- func (s IDSet) Clone() IDSet
- func (s IDSet) Del(ids ...ID)
- func (s IDSet) Has(ids ...ID) bool
- func (s IDSet) MarshalJSON() ([]byte, error)
- func (s IDSet) Members() []ID
- func (s IDSet) Size() int
- func (s IDSet) SortedMembers() []ID
- func (s IDSet) String() string
- func (s IDSet) StringWithSeparator(args ...string) string
- func (s *IDSet) UnmarshalJSON(data []byte) error
- type Uint64Slice
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DumpJSON ¶
func DumpJSON(r interface{}) string
DumpJSON dumps a json-compatible struct in human-readable form
func SortUint64s ¶
func SortUint64s(a []uint64)
SortUint64s sorts a slice of uint64 in increasing order.
Types ¶
type ID ¶ added in v0.2.0
type ID = int
ID is nn integer id, used to identify packages, CPUs, nodes, etc.
const ( // Unknown represents an unknown id. Unknown ID = -1 )
type IDSet ¶ added in v0.2.0
type IDSet map[ID]struct{}
IDSet is an unordered set of integer ids.
func NewIDSetFromIntSlice ¶ added in v0.2.0
NewIDSetFromIntSlice creates a new unordered set from an integer slice.
func (IDSet) MarshalJSON ¶ added in v0.2.0
MarshalJSON is the JSON marshaller for IDSet.
func (IDSet) Members ¶ added in v0.2.0
Members returns all ids in the set as a randomly ordered slice.
func (IDSet) SortedMembers ¶ added in v0.2.0
SortedMembers returns all ids in the set as a sorted slice.
func (IDSet) StringWithSeparator ¶ added in v0.2.0
StringWithSeparator returns the set as a string, separated with the given separator.
func (*IDSet) UnmarshalJSON ¶ added in v0.2.0
UnmarshalJSON is the JSON unmarshaller for IDSet.
type Uint64Slice ¶
type Uint64Slice []uint64
Uint64Slice implmenents sort.Interface for a slice of uint64.
func (Uint64Slice) Less ¶
func (s Uint64Slice) Less(i, j int) bool
Less returns true if element at 'i' is less than the element at 'j'