pubsub

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2021 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Pubsub *pubsub.PubSub
View Source
var PubsubTopicPool = make(map[string]*PubsubTopic, 0)

Functions

func GetTopics

func GetTopics() []string

func ListPeers

func ListPeers(topicname string) []peer.ID

func SendRaw

func SendRaw(topicname string, data []byte)

Types

type PubsubTopic

type PubsubTopic struct {
	Topic *pubsub.Topic
	Sub   *pubsub.Subscription
}

* 订阅主题和订阅者

func Subscribe

func Subscribe(topicname string) (*PubsubTopic, error)

* 订阅主题,可以接收发给这个主题的消息

Jump to

Keyboard shortcuts

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