pubsub

package
v0.5.21 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2025 License: AGPL-3.0, AGPL-3.0-or-later Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PubSubDiscoveryTopic = "peer-discovery"
)

Variables

View Source
var ErrTopicClosed = pubsub.ErrTopicClosed

Functions

This section is empty.

Types

type Gossip added in v0.5.8

type Gossip struct {
	// contains filtered or unexported fields
}

func NewGossip added in v0.5.8

func NewGossip(
	ctx context.Context,
	handlers ...TopicHandler,
) *Gossip

func (*Gossip) Close added in v0.5.8

func (g *Gossip) Close() (err error)

func (*Gossip) IsGossipRunning added in v0.5.8

func (g *Gossip) IsGossipRunning() bool

func (*Gossip) NodeInfo added in v0.5.8

func (g *Gossip) NodeInfo() warpnet.NodeInfo

func (*Gossip) NotSubscribers added in v0.5.8

func (g *Gossip) NotSubscribers(topicName string) []warpnet.WarpAddrInfo

func (*Gossip) Publish added in v0.5.8

func (g *Gossip) Publish(msg event.Message, topics ...string) (err error)

func (*Gossip) Run added in v0.5.8

func (g *Gossip) Run(node GossipNodeConnector) (err error)

func (*Gossip) SelfPublish added in v0.5.8

func (g *Gossip) SelfPublish(data []byte) error

func (*Gossip) Subscribe added in v0.5.8

func (g *Gossip) Subscribe(handlers ...TopicHandler) (err error)

func (*Gossip) Subscribers added in v0.5.8

func (g *Gossip) Subscribers(topicName string) []warpnet.WarpAddrInfo

func (*Gossip) Unsubscribe added in v0.5.8

func (g *Gossip) Unsubscribe(topics ...string) (err error)

type GossipNodeConnector added in v0.3.112

type GossipNodeConnector interface {
	Node() warpnet.P2PNode
	NodeInfo() warpnet.NodeInfo
	SelfStream(path stream.WarpRoute, data any) (_ []byte, err error)
}

type TopicHandler added in v0.3.112

type TopicHandler struct {
	TopicName string
	Handler   topicHandler
}

func NewDiscoveryTopicHandler added in v0.3.113

func NewDiscoveryTopicHandler(handler topicHandler) TopicHandler

Jump to

Keyboard shortcuts

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