Documentation ¶
Index ¶
- func RanksToUint32(in []Rank) []uint32
- type Rank
- type RankList
- type RankSet
- func (rs *RankSet) Add(rank Rank)
- func (rs *RankSet) Count() int
- func (rs *RankSet) Delete(rank Rank)
- func (rs *RankSet) MarshalJSON() ([]byte, error)
- func (rs *RankSet) Merge(other *RankSet)
- func (rs *RankSet) RangedString() string
- func (rs *RankSet) Ranks() (out []Rank)
- func (rs *RankSet) Replace(other *RankSet)
- func (rs *RankSet) String() string
- func (rs *RankSet) UnmarshalJSON(data []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RanksToUint32 ¶
RanksToUint32 is a convenience method to convert a slice of system ranks to a slice of uint32s.
Types ¶
type Rank ¶
type Rank uint32
Rank is used to uniquely identify a server within a cluster.
func CheckRankMembership ¶
CheckRankMembership compares two Rank slices and returns a Rank slice with any ranks found in the second slice that do not exist in the first slice.
func NewRankPtr ¶
NewRankPtr creates a Rank representation of the given uint32 and returns a pointer to it.
func ParseRanks ¶
ParseRanks takes a string representation of a list of ranks e.g. 1-4,6 and returns a slice of Rank type or error.
func RanksFromUint32 ¶
RanksFromUint32 is a convenience method to convert a slice of uint32s to a slice of system ranks.
func (*Rank) RemoveFromList ¶
RemoveFromList removes given rank from provided list and returns modified list.
Ignores miss in list.
func (*Rank) UnmarshalYAML ¶
UnmarshalYAML converts YAML representation into a system Rank.
type RankList ¶
type RankList []Rank
RankList provides convenience methods for working with Rank slices.
type RankSet ¶
type RankSet struct {
// contains filtered or unexported fields
}
RankSet implements a set of unique ranks in a condensed format.
func CreateRankSet ¶
CreateRankSet creates a new HostList with ranks rather than hostnames from the supplied string representation.
func MustCreateRankSet ¶
MustCreateRankSet is like CreateRankSet but will panic on error.
func RankSetFromRanks ¶
RankSetFromRanks returns a RankSet created from the supplied Rank slice.
func (*RankSet) MarshalJSON ¶
func (*RankSet) RangedString ¶
RangedString returns a ranged string representation of the RankSet.