rafty

package module
v0.0.0-...-ca330d1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

README

rafty

My personal raft implementation based on hasicorps raft package. But with gRPC native transportation.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RPC

type RPC struct {
	Command         interface{}
	Reader          io.Reader // Only when installing a snapshot.
	ResponseChannel chan<- RPCResponse
}

func (*RPC) Respond

func (r *RPC) Respond(response interface{}, err error)

type RPCResponse

type RPCResponse struct {
	Response interface{}
	Error    error
}

type Raft

type Raft struct {
	// contains filtered or unexported fields
}

type RaftState

type RaftState uint32
const (
	// Follower is the state of an established node receiving it's state from the leader.
	Follower RaftState = iota

	// Candidate is the state of a node in transition.
	Candidate

	// Leader is the state of the node that dictates the state of the cluster.
	Leader

	// Shutdown is the terminal state of a raft node.
	Shutdown
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL