Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
RequestActions = map[string]string{
"stats": "/stats",
"join": "/join",
"leave": "/leave",
"payload": "/payload",
"send-join": "/send/join",
"send-leave": "/send/leave",
"send-payload": "/send/payload",
}
)
Functions ¶
func NewSnapshotNoop ¶
func NewSnapshotNoop() (raft.FSMSnapshot, error)
NewSnapshotNoop is returned by an FSM in response to a SnapshotNoop It must be safe to invoke FSMSnapshot methods with concurrent calls to Apply.
Types ¶
type ApplyResponse ¶
type ApplyResponse struct { Error error Data interface{} }
ApplyResponse response from Apply raft
type CommandPayload ¶
CommandPayload is payload sent by system when calling raft.Apply(cmd []byte, timeout time.Duration)
type NodeMembershipRequest ¶
type NodeMembershipRequest struct { NodeID string `json:"node_id"` RaftAddress string `json:"raft_address"` }
func (*NodeMembershipRequest) Marshal ¶
func (req *NodeMembershipRequest) Marshal() ([]byte, error)
func (*NodeMembershipRequest) Unmarshal ¶
func (req *NodeMembershipRequest) Unmarshal(reqBody []byte) error
type ServerResponse ¶
type SnapshotNoop ¶
type SnapshotNoop struct{}
snapshotNoop handle noop snapshot
func (SnapshotNoop) Persist ¶
func (s SnapshotNoop) Persist(_ raft.SnapshotSink) error
Persist persist to disk. Return nil on success, otherwise return error.
func (SnapshotNoop) Release ¶
func (s SnapshotNoop) Release()
Release release the lock after persist snapshot. Release is invoked when we are finished with the snapshot.
Click to show internal directories.
Click to hide internal directories.