Documentation
¶
Index ¶
Constants ¶
View Source
const ( ConfAddNode ConfChangeType = 0 ConfRemoveNode ConfChangeType = 1 ConfUpdateNode ConfChangeType = 2 EntryNormal EntryType = 0 EntryConfChange EntryType = 1 PeerNormal PeerType = 0 PeerArbiter PeerType = 1 )
Variables ¶
This section is empty.
Functions ¶
func EncodeHBConext ¶
func EncodeHBConext(ctx HeartbeatContext) (buf []byte)
func ReturnMessage ¶
func ReturnMessage(msg *Message)
Types ¶
type ConfChange ¶
type ConfChange struct {
Type ConfChangeType
Peer Peer
Context []byte
}
func (*ConfChange) Decode ¶
func (c *ConfChange) Decode(datas []byte)
func (*ConfChange) String ¶
func (cc *ConfChange) String() string
type ConfChangeType ¶
type ConfChangeType byte
func (ConfChangeType) String ¶
func (t ConfChangeType) String() string
type HeartbeatContext ¶
type HeartbeatContext []uint64
func DecodeHBContext ¶
func DecodeHBContext(buf []byte) (ctx HeartbeatContext)
type Message ¶
type Message struct {
Type MsgType
ForceVote bool
Reject bool
RejectIndex uint64
ID uint64
From uint64
To uint64
Term uint64
LogTerm uint64
Index uint64
Commit uint64
SnapshotMeta SnapshotMeta
Entries []*Entry
Context []byte
Snapshot Snapshot // No need for codec
}
Message is the transport message.
func GetMessage ¶
func GetMessage() *Message
func (*Message) IsElectionMsg ¶
func (*Message) IsHeartbeatMsg ¶
func (*Message) IsResponseMsg ¶
type SnapIterator ¶
type Snapshot ¶
type Snapshot interface {
SnapIterator
ApplyIndex() uint64
Close()
}
The Snapshot interface is supplied by the application to access the snapshot data of application.
type SnapshotMeta ¶
func (*SnapshotMeta) Decode ¶
func (m *SnapshotMeta) Decode(datas []byte)
Click to show internal directories.
Click to hide internal directories.