cluster

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster interface {
	Raft
	Start()
	Members() []Member
	Join(addr ...string) (int, error)
	Shutdown()
	ReplicaSet() uint64
	TotalReplicas() int
	Addr() string
	SetGatewayAddrs(hostPorts []string) error
	SetTunnelAddrs(hostPorts []string) error
}

type Member

type Member interface {
	Proto(info *rony.Edge) *rony.Edge
	ServerID() string
	RaftState() rony.RaftState
	ReplicaSet() uint64
	GatewayAddr() []string
	TunnelAddr() []string
	RaftPort() int
}

type Mode

type Mode string
const (
	// SingleReplica if set then each replica set is only one node. i.e. raft is OFF.
	SingleReplica Mode = "singleReplica"
	// MultiReplica if set then each replica set is a raft cluster
	MultiReplica Mode = "multiReplica"
)

type Raft

type Raft interface {
	RaftEnabled() bool
	RaftMembers(replicaSet uint64) []Member
	RaftState() raft.RaftState
	RaftApply(cmd []byte) raft.ApplyFuture
	RaftLeaderID() string
}

type ReplicaMessageHandler

type ReplicaMessageHandler func(raftCmd *rony.RaftCommand) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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