gossipCluster

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: 20 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 struct {
	cluster.ReplicaMessageHandler
	// contains filtered or unexported fields
}

Cluster

func New

func New(cfg Config) *Cluster

func (*Cluster) Addr

func (c *Cluster) Addr() string

func (*Cluster) Join

func (c *Cluster) Join(addr ...string) (int, error)

func (*Cluster) Members

func (c *Cluster) Members() []cluster.Member

func (*Cluster) RaftApply

func (c *Cluster) RaftApply(cmd []byte) raft.ApplyFuture

func (*Cluster) RaftEnabled added in v0.2.0

func (c *Cluster) RaftEnabled() bool

func (*Cluster) RaftLeaderID

func (c *Cluster) RaftLeaderID() string

func (*Cluster) RaftMembers

func (c *Cluster) RaftMembers(replicaSet uint64) []cluster.Member

func (*Cluster) RaftState

func (c *Cluster) RaftState() raft.RaftState

func (*Cluster) ReplicaSet

func (c *Cluster) ReplicaSet() uint64

func (*Cluster) SetGatewayAddrs

func (c *Cluster) SetGatewayAddrs(hostPorts []string) error

func (*Cluster) SetTunnelAddrs added in v0.1.9

func (c *Cluster) SetTunnelAddrs(hostPorts []string) error

func (*Cluster) Shutdown

func (c *Cluster) Shutdown()

func (*Cluster) Start

func (c *Cluster) Start()

func (*Cluster) TotalReplicas added in v0.2.10

func (c *Cluster) TotalReplicas() int

type Config

type Config struct {
	ServerID   []byte
	Bootstrap  bool
	RaftPort   int
	ReplicaSet uint64
	Mode       cluster.Mode
	GossipPort int
	DataPath   string
}

Config

type Member

type Member struct {
	ShardRange [2]uint32

	ClusterAddr net.IP
	ClusterPort uint16
	// contains filtered or unexported fields
}

Member

func (*Member) GatewayAddr

func (m *Member) GatewayAddr() []string

func (*Member) Proto

func (m *Member) Proto(p *rony.NodeInfo) *rony.NodeInfo

func (*Member) RaftPort

func (m *Member) RaftPort() int

func (*Member) RaftState

func (m *Member) RaftState() rony.RaftState

func (*Member) ReplicaSet

func (m *Member) ReplicaSet() uint64

func (*Member) ServerID

func (m *Member) ServerID() string

func (*Member) TunnelAddr added in v0.1.9

func (m *Member) TunnelAddr() []string

Jump to

Keyboard shortcuts

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