cluster

package
v0.3.13 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 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.NodeInfo) *rony.NodeInfo
	ServerID() string
	RaftState() rony.RaftState
	ReplicaSet() uint64
	GatewayAddr() []string
	TunnelAddr() []string
	RaftPort() int
}

type Mode added in v0.1.5

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 added in v0.1.5

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