gossip

package
v1.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 28, 2024 License: Apache-2.0, MIT Imports: 17 Imported by: 0

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

func (*Memberlist) Shutdown

func (m *Memberlist) Shutdown()

nolint:errcheck

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)

type NodeInfo

type NodeInfo struct {
	PeerIpAddresses []string
	IpAddress       string
}

Metadata related to the current node

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL