zmqcluster

package module
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2025 License: MPL-2.0 Imports: 8 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster interface {
	UpdatePeers(peers []string)
	SendMessageToPeer(peer string, message []byte)
	BroadcastMessage(message []byte)
	Start() error
	Stop()
	AddListenerSync(listener ClusterListener)
	AddListener(listener ClusterListener)
	SetMyIP(ip string)
	MyIP() string
	MyTcpPort() string
}

type ClusterListener

type ClusterListener interface {
	OnMessage(identity []byte, message []byte)
	OnMessageSent(peer string, message []byte)
	OnNewPeerConnected(c Cluster, peer string)
}

type ZmqCluster

type ZmqCluster struct {
	phony.Inbox
	// contains filtered or unexported fields
}

func NewZmqCluster

func NewZmqCluster(identity, bindAddr string) *ZmqCluster

func (*ZmqCluster) AddListener

func (z *ZmqCluster) AddListener(listener ClusterListener)

func (*ZmqCluster) AddListenerSync

func (z *ZmqCluster) AddListenerSync(listener ClusterListener)

func (*ZmqCluster) BroadcastMessage

func (z *ZmqCluster) BroadcastMessage(message []byte)

func (*ZmqCluster) MyIP added in v0.0.5

func (z *ZmqCluster) MyIP() string

func (*ZmqCluster) MyTcpPort added in v0.0.7

func (z *ZmqCluster) MyTcpPort() string

func (*ZmqCluster) SendMessageToPeer

func (z *ZmqCluster) SendMessageToPeer(peer string, message []byte)

func (*ZmqCluster) SetMyIP added in v0.0.5

func (z *ZmqCluster) SetMyIP(myIP string)

func (*ZmqCluster) Start

func (z *ZmqCluster) Start() error

func (*ZmqCluster) Stop

func (z *ZmqCluster) Stop()

func (*ZmqCluster) UpdatePeers

func (z *ZmqCluster) UpdatePeers(peers []string)

UpdatePeers adds new connections and removes ones not present in the input

Jump to

Keyboard shortcuts

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