Documentation
¶
Index ¶
- type Config
- type Node
- func (n *Node) IsLeader() bool
- func (n *Node) LeaderCh() <-chan bool
- func (n *Node) NotifyJoin(node *memberlist.Node)
- func (n *Node) NotifyLeave(node *memberlist.Node)
- func (n *Node) NotifyUpdate(_ *memberlist.Node)
- func (n *Node) RaftApply(request any, timeout time.Duration) (any, error)
- func (n *Node) Start(ctx context.Context) error
- func (n *Node) Stop(ctx context.Context) (shutdownErr error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
NodeID string
AdvertiseAddr string
AdvertisePort int
AdvertiseAddrProbeHost string
DiscoveryPort int
DiscoveryMethod discovery.DiscoveryMethod
DataDir string
Services []fsm.FSMService
Serializer serializer.Serializer
SnapshotEnabled bool
Bootstrap bool
FormationTimeout time.Duration
Logger hclog.Logger
}
func DefaultConfig ¶
func DefaultConfig() *Config
type Node ¶
type Node struct {
ID string
// contains filtered or unexported fields
}
func (*Node) NotifyJoin ¶
func (n *Node) NotifyJoin(node *memberlist.Node)
NotifyJoin triggered when a new Node has been joined to the cluster (discovery only) and capable of joining the Node to the raft cluster
func (*Node) NotifyLeave ¶
func (n *Node) NotifyLeave(node *memberlist.Node)
NotifyLeave triggered when a Node becomes unavailable after a period of time it will remove the unavailable Node from the Raft cluster
func (*Node) NotifyUpdate ¶
func (n *Node) NotifyUpdate(_ *memberlist.Node)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.