Versions in this module Expand all Collapse all v0 v0.0.1 Dec 10, 2019 Changes in this version + const EndpointPrefix + const LivenessEndpoint + const ManagementEndpoint + const RaftEndpoint + const SerfEndpoint + const SerfStatusKey + const ZeroconfManagementKind + const ZeroconfSerfKind + var SerfAlive = serf.StatusAlive.String() + var SerfFailed = serf.StatusFailed.String() + var SerfLeft = serf.StatusLeft.String() + type Cluster interface + Events func() <-chan Event + GetEndpoint func(nodeID string, endpointName string) string + Leader func() string + Name func() string + NodeID func() string + Nodes func() []string + Role func() NodeRole + SetEndpoint func(name string, endpoint string) + Start func() error + State func() NodeState + Stop func() + func NewCluster(params Parameters, shardManager sharding.ShardMap) Cluster + type Event struct + Role NodeRole + State NodeState + type GRPCServerParameters struct + CertFile string + Endpoint string + KeyFile string + TLS bool + type LeaderChangedEvent struct + type LeaderLostEvent struct + type LivenessChecker interface + Add func(id string, endpoint string) + AliveEvents func() <-chan string + Clear func() + DeadEvents func() <-chan string + Remove func(id string) + Shutdown func() + func NewLivenessChecker(interval time.Duration, retries int) LivenessChecker + type LocalLivenessEndpoint interface + Stop func() + func NewLivenessClient(ep string) LocalLivenessEndpoint + type LocalNodeStoppedEvent struct + type LogMessage struct + AckEndpoint string + Data []byte + Index uint64 + MessageType LogMessageType + func NewLogMessage(t LogMessageType, endpoint string, data []byte) LogMessage + func (m *LogMessage) MarshalBinary() ([]byte, error) + func (m *LogMessage) UnmarshalBinary(buf []byte) error + type LogMessageType byte + const ProposedShardMap + const ShardMapCommitted + type NodeAddedEvent struct + type NodeEvent struct + Event SerfEventType + Node SerfMember + type NodeRemovedEvent struct + type NodeRetiredEvent struct + type NodeRole int32 + const Follower + const Leader + const NonMember + const NonVoter + const Unknown + func (n NodeRole) String() string + type NodeState int32 + const Invalid + const Joining + const Operational + const Resharding + const Starting + const Stopping + const Voting + func (n NodeState) String() string + type Parameters struct + AckTimeout time.Duration + AutoJoin bool + Interface string + LeaderEndpoint string + LivenessEndpoint string + LivenessInterval time.Duration + LivenessRetries int + Management GRPCServerParameters + Metrics string + Name string + NodeID string + NonMember bool + NonVoting bool + Raft RaftParameters + Serf SerfParameters + Verbose bool + ZeroConf bool + func (p *Parameters) Final() + type RaftEventType int + const RaftBecameFollower + const RaftBecameLeader + const RaftClusterSizeChanged + const RaftLeaderLost + const RaftReceivedLog + const RaftUndefinedEvent + func (r RaftEventType) String() string + type RaftNode struct + Nodes toolbox.StringSet + func NewRaftNode() *RaftNode + func (r *RaftNode) AddClusterNode(nodeID string, endpoint string) error + func (r *RaftNode) AppendLogEntry(data []byte) (uint64, error) + func (r *RaftNode) Apply(l *raft.Log) interface{} + func (r *RaftNode) DisableNode(id string) + func (r *RaftNode) EnableNode(id string) + func (r *RaftNode) Endpoint() string + func (r *RaftNode) Events() <-chan RaftEventType + func (r *RaftNode) GetLogMessages(startingIndex uint64) []LogMessage + func (r *RaftNode) LastLogIndex() uint64 + func (r *RaftNode) Leader() bool + func (r *RaftNode) LeaderNodeID() string + func (r *RaftNode) LocalNodeID() string + func (r *RaftNode) RefreshNodes() + func (r *RaftNode) RemoveClusterNode(nodeID string, endpoint string) error + func (r *RaftNode) Restore(io.ReadCloser) error + func (r *RaftNode) Snapshot() (raft.FSMSnapshot, error) + func (r *RaftNode) Start(nodeID string, cfg RaftParameters) error + func (r *RaftNode) StepDown() error + func (r *RaftNode) Stop(removeWhenStopping bool) error + type RaftParameters struct + Bootstrap bool + DebugLog bool + DiskStore bool + RaftEndpoint string + Verbose bool + type SerfEventType int + const SerfNodeJoined + const SerfNodeLeft + const SerfNodeUpdated + func (s SerfEventType) String() string + type SerfMember struct + NodeID string + State string + Tags map[string]string + type SerfNode struct + func NewSerfNode() *SerfNode + func (s *SerfNode) Events() <-chan NodeEvent + func (s *SerfNode) LoadMembers() []SerfMember + func (s *SerfNode) Node(nodeID string) SerfMember + func (s *SerfNode) Nodes() []SerfMember + func (s *SerfNode) PublishTags() error + func (s *SerfNode) SetTag(name, value string) + func (s *SerfNode) Size() int + func (s *SerfNode) Start(nodeID string, cfg SerfParameters) error + func (s *SerfNode) Stop() error + type SerfParameters struct + Endpoint string + JoinAddress string + Verbose bool + func (s *SerfParameters) Final()