Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExternalIP ¶
ExternalIP returns the first non-loopback IPv4 address
Types ¶
type Gossip ¶
type Gossip struct { Enabled bool // contains filtered or unexported fields }
Gossip is a struct that represents a gossip-based membership protocol implementation using the Memberlist library. It contains the following fields:
- Enabled: a boolean that indicates if the gossip protocol is enabled.
- memberList: a pointer to the memberlist.Memberlist instance, which manages the cluster membership and communication between nodes.
func InitMemberList ¶
InitMemberList initializes a memberlist instance with the provided seed nodes and config.
func (*Gossip) SyncMemberList ¶
SyncMemberList returns a list of all nodes in the cluster.
type IGossip ¶
type IGossip interface { // SyncMemberList retrieves the current list of nodes in the // gossip cluster and returns them as a slice of strings. SyncMemberList() (nodes []string) // Shutdown gracefully stops the gossip protocol and performs // any necessary cleanup. It returns an error if the shutdown // process encounters any issues. Shutdown() error }
IGossip is an interface that represents the basic operations of a gossip-based membership protocol. Implementations of this interface should provide mechanisms for synchronizing cluster membership and managing the lifecycle of the gossip protocol.
Click to show internal directories.
Click to hide internal directories.