Documentation ¶
Index ¶
Constants ¶
View Source
const ( RoleMaster = "master" RoleSlave = "slave" )
View Source
const ( MinSlotID = 0 MaxSlotID = 16383 )
Variables ¶
View Source
var ( ErrEntryNoExists = errors.New("the entry does not exist") ErrEntryExisted = errors.New("the entry already existed") ErrIndexOutOfRange = errors.New("index out of range") ErrShardNoMatchPromoteNode = errors.New("no match promote node in shard") ErrShardNoReplica = errors.New("no replica in shard") )
View Source
var ErrSlotOutOfRange = errors.New("slot id was out of range, should be between 0 and 16383")
View Source
var (
NodeIdLen = 40
)
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct { Name string `json:"name"` Version int64 `json:"version"` Shards []Shard `json:"shards"` Config ClusterConfig `json:"config"` }
func ParseCluster ¶
ParseCluster will parse the cluster string into cluster topology.
func (*Cluster) CheckOverlap ¶
func (*Cluster) ToSlotString ¶
type ClusterConfig ¶
type NodeInfo ¶
type Shard ¶
type Shard struct { Nodes []NodeInfo `json:"nodes"` SlotRanges []SlotRange `json:"slot_ranges"` ImportSlot int `json:"import_slot"` MigratingSlot int `json:"migrating_slot"` }
func (*Shard) HasOverlap ¶
func (*Shard) ToSlotsString ¶
type SlotRange ¶
func MergeSlotRanges ¶
func NewSlotRange ¶
func ParseSlotRange ¶
func RemoveSlotRanges ¶
func SpiltSlotRange ¶
func (*SlotRange) HasOverlap ¶
func (*SlotRange) MarshalJSON ¶
func (*SlotRange) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.