Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IMemberlist ¶
type IMemberlist interface { Dispatch(*action.BroadcastAction) GetIpAddress() string Shutdown() }
type Memberlist ¶
type Memberlist struct {
// contains filtered or unexported fields
}
func NewMemberList ¶
func NewMemberList(lf fx.Lifecycle, logger *zap.Logger, config *config.Config, broadcastHandler handler.IBroadcastActionHandler) (*Memberlist, error)
func (*Memberlist) Dispatch ¶
func (m *Memberlist) Dispatch(broadcast *action.BroadcastAction)
Broadcasts a message to peer nodes in the cluster
func (*Memberlist) GetIpAddress ¶
func (m *Memberlist) GetIpAddress() string
GetIpAddress returns the IP address of the current node
func (*Memberlist) Join ¶
func (m *Memberlist) Join() error
type MessageDelegate ¶
type MessageDelegate struct { MessageChan chan []byte Broadcasts *memberlist.TransmitLimitedQueue }
Message delegate is used to handle messages from the memberlist Based heavily on https://github.com/octu0/example-memberlist/tree/master/05-broadcast
func NewMessageDelegate ¶
func NewMessageDelegate(eventsDelegate *MessageEventDelegate) *MessageDelegate
func (*MessageDelegate) GetBroadcasts ¶
func (md *MessageDelegate) GetBroadcasts(overhead, limit int) [][]byte
func (*MessageDelegate) LocalState ¶
func (d *MessageDelegate) LocalState(join bool) []byte
func (*MessageDelegate) MergeRemoteState ¶
func (d *MessageDelegate) MergeRemoteState(buf []byte, join bool)
func (*MessageDelegate) NodeMeta ¶
func (d *MessageDelegate) NodeMeta(limit int) []byte
func (*MessageDelegate) NotifyMsg ¶
func (md *MessageDelegate) NotifyMsg(msg []byte)
type MessageEventDelegate ¶
type MessageEventDelegate struct {
Num int
}
Message delegate is used to handle messages from the memberlist Based heavily on https://github.com/octu0/example-memberlist/tree/master/05-broadcast
func NewMessageEventDelegate ¶
func NewMessageEventDelegate() *MessageEventDelegate
func (*MessageEventDelegate) NotifyJoin ¶
func (d *MessageEventDelegate) NotifyJoin(node *memberlist.Node)
func (*MessageEventDelegate) NotifyLeave ¶
func (d *MessageEventDelegate) NotifyLeave(node *memberlist.Node)
func (*MessageEventDelegate) NotifyUpdate ¶
func (d *MessageEventDelegate) NotifyUpdate(node *memberlist.Node)
Click to show internal directories.
Click to hide internal directories.