Documentation
¶
Index ¶
- Constants
- Variables
- type Log
- type Node
- func (node *Node) AppendEntriesRPC(ctx context.Context, in *pb.AppendEntriesReq) (*pb.AppendEntriesResp, error)
- func (node *Node) AppendEntry() error
- func (node *Node) Canvass() error
- func (node *Node) CanvassRPC(ctx context.Context, in *pb.CanvassReq) (*pb.CanvassResp, error)
- func (node *Node) Run()
- func (node *Node) SetLogRPC(ctx context.Context, in *pb.LogReq) (*pb.LogResp, error)
- type NodeConf
Constants ¶
View Source
const ( FOLLOWER = iota CANDIDATE LEADER )
View Source
const (
INTERVAL = 5 //heartbeat INTERVAL
)
View Source
const ZERO_REPLACE_NUM = 10000000
fix golang pointer convert 0 error
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Node ¶
func (*Node) AppendEntriesRPC ¶
func (node *Node) AppendEntriesRPC(ctx context.Context, in *pb.AppendEntriesReq) (*pb.AppendEntriesResp, error)
func (*Node) AppendEntry ¶
func (*Node) CanvassRPC ¶
func (node *Node) CanvassRPC(ctx context.Context, in *pb.CanvassReq) (*pb.CanvassResp, error)
Click to show internal directories.
Click to hide internal directories.