Documentation
¶
Index ¶
- Constants
- type Gossip
- func (g *Gossip) Close() (err error)
- func (g *Gossip) IsGossipRunning() bool
- func (g *Gossip) NodeInfo() warpnet.NodeInfo
- func (g *Gossip) NotSubscribers(topicName string) []warpnet.WarpAddrInfo
- func (g *Gossip) Publish(msg event.Message, topics ...string) (err error)
- func (g *Gossip) PublishRaw(topicName string, data []byte) (err error)
- func (g *Gossip) Run(node GossipNodeConnector) (err error)
- func (g *Gossip) SelfPublish(data []byte) error
- func (g *Gossip) Subscribe(handlers ...TopicHandler) (err error)
- func (g *Gossip) SubscribeRaw(topicName string, h func([]byte) error) (err error)
- func (g *Gossip) Subscribers(topicName string) []warpnet.WarpAddrInfo
- func (g *Gossip) Unsubscribe(topics ...string) (err error)
- type GossipNodeConnector
- type TopicHandler
Constants ¶
View Source
const ( ErrPubsubNotInit warpnet.WarpError = "gossip: service not initialized" ErrAlreadyRunning warpnet.WarpError = "gossip: pubsub is already running" ErrListenerMalformed warpnet.WarpError = "gossip: pubsub listener not initialized properly" ErrPubsubEmptyTopic warpnet.WarpError = "gossip: topic name is empty" ErrPubsubNoPathFound warpnet.WarpError = "gossip: user update message has no path" ErrPubsubEmptyMessage warpnet.WarpError = "gossip: empty message" )
Variables ¶
This section is empty.
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) IsGossipRunning ¶ added in v0.5.8
func (*Gossip) NotSubscribers ¶ added in v0.5.8
func (g *Gossip) NotSubscribers(topicName string) []warpnet.WarpAddrInfo
func (*Gossip) PublishRaw ¶ added in v0.5.159
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 (*Gossip) Subscribe ¶ added in v0.5.8
func (g *Gossip) Subscribe(handlers ...TopicHandler) (err error)
func (*Gossip) SubscribeRaw ¶ added in v0.5.159
func (*Gossip) Subscribers ¶ added in v0.5.8
func (g *Gossip) Subscribers(topicName string) []warpnet.WarpAddrInfo
func (*Gossip) Unsubscribe ¶ added in v0.5.8
type GossipNodeConnector ¶ added in v0.3.112
type TopicHandler ¶ added in v0.3.112
type TopicHandler struct {
TopicName string
Handler topicHandler
}
func NewDiscoveryRelayTopicHandler ¶ added in v0.5.134
func NewDiscoveryRelayTopicHandler() TopicHandler
NewDiscoveryRelayTopicHandler acts only as relay
func NewDiscoveryTopicHandler ¶ added in v0.3.113
func NewDiscoveryTopicHandler(discHandler discovery.DiscoveryHandler) TopicHandler
Click to show internal directories.
Click to hide internal directories.