package
1.0.9
Repository: https://github.com/lab5e/clusterfunk.git
Documentation: pkg.go.dev

# Packages

Package clusterpb contains the generate gRPC code.
Package managepb contains the protobuf-generate code for the cluster management interface.
Package metrics handles metrics for the cluster.
No description provided by the author

# Functions

GetBootstrapTime reads the cluster bootstrap time from the log message.
NewBootstrapMessage creates a new cluster bootstrap message.
NewCluster returns a new cluster (client).
NewClusterWatchdog creates a new cluster watchdog with the default timeouts and poll intervals.
NewEndpointObserver creates a new EndpointObserver instance.
NewLogMessage creates a new LogMessage instance.
NewRaftNode creates a new RaftNode instance.
NewSerfNode creates a new SerfNode instance.
NewServiceNode creates a new ServiceNode instance.
ToPublicEndpoint converts an ip:port string into a format suitable for publishing as endpoints.

# Constants

Aggressive mode, 5 ms commit timeout.
Bootstrap is a message that the leader appends to the log when the cluster is first bootstrapped.
Default timeout, 250 ms commit timeout.
DefaultPollInterval is the polling interval for the watchdog.
DefaultTimeout is the the default timeout for the watchdog.
The following are internal tags and values for nodes.
A follower in a cluster.
Invalid or unknown state.
Joining the cluster.
The current leader node.
gRPC endpoint for management.
Medium, 50 ms commit timeout.
Typically Prometheus endpoint with /metrics and /healthz.
NonMember nodes are part of the Serf cluster but not the Raft cluste.
Non voting role in cluster.
Operational, normal operation.
ProposedShardMap is the new shard map the leader proposes (dictatorship-style) to the followers.
RaftBecameFollower is emitted when the node becomes a follower.
RaftBecameLeader is emitted when the leader becomes the leader.
RaftClusterSizeChanged is emitted when a new node is added.
The following is a list of well-known endpoints on nodes.
RaftLeaderLost is emitted when the leader is lost, ie the node enters the candidate state.
RaftReceivedLog is emitted when a log entry is receievd.
RaftShutdown is emitted when the node is shutting down.
RaftUndefinedEvent is the undefined event type.
Leader is elected, resharding in progress.
These are.
A node joins the cluster.
A node has left the cluster.
A node's tags are updated.
The following is a list of well-known endpoints on nodes.
SerfStatusKey is the key for the serf status.
ShardMapCommitted is a message that will synchronize the shard map distributed in the previous message.
Starting the node.
Stopping the node.
Protocol types exposed by the endpoints.
Protocol types exposed by the endpoints.
Uknown state.
Leader election in progress.
ZeroconfManagementKind is the type used to register management endpoints in zeroconf.
ZeroconfSerfKind is the type used to register serf endpoints in zeroconf.
ZeroconfServiceKind is the type used to register (non-cluster) services.

# Variables

SerfAlive is the status of the serf node when it is alive and well.
SerfFailed is the status of the serf node when it has failed.
SerfLeft is the status of the serf node when it has left the cluster.

# Structs

ClusterWatchdog is a watchdog for the cluster nodes.
Endpoint stores information on endpoints.
Event is the interface for cluster events that are triggered.
GRPCServerParameters is a parameter struct for gRPC services The struct uses annotations from Kong (https://github.com/alecthomas/kong).
LeaderChangedEvent is emitted when the leader of the cluster has changed.
LeaderLostEvent is emitted when the leader is about to change.
LocalNodeStoppedEvent is emitted when the local node is stopping.
LogMessage is log messages sent by the leader.
Node is a temporary struct used by the SerfNode and RaftNode types for their internal memberList methods.
NodeAddedEvent is emitted when a new node is added to the cluster.
NodeEvent is used for channel notifications.
NodeRemovedEvent is emitted when a node is removed from the cluster.
NodeRetiredEvent is emitted when a node is about to be retired.
Parameters is the parameters required for the cluster.
RaftParameters is the configuration for the Raft cluster.
SerfMember holds information on members in the Serf cluster.
SerfNode is a wrapper around the Serf library.
SerfParameters holds parameters for the Serf client.
ServiceParameters is configuration parameters for service nodes, ie nodes that aren't part of the cluster but provides discoverable services to the cluster (and cluster clients).

# Interfaces

Cluster is a wrapper for the Serf and Raft libraries.
EndpointObserver observes the cluster and generates events when endpoints are registered and deregistered.
EndpointRegistrator is a type that can register endpoints; clients, services, or cluster nodes.
RaftNode is a (local) Raft node implementation.
ServiceNode is a node for services that will be discoverable but not a member of the cluster.

# Type aliases

LogMessageType is the log message type we're writing at the start of every log message.
NodeRole is the roles the node can have in the cluster.
NodeState is the enumeration of different states a node can be in.
ProtocolType is the type of protocol the endpoint supports.
RaftEventType is the event type for events emitted by the RaftNode type.
SerfEventType is the type of events the SerfNode emits.
TimingType is the timing for the Raft cluster.