Documentation ¶
Index ¶
- Constants
- type Message
- type PubSub
- func (p *PubSub) GetTopics() []string
- func (p *PubSub) ListPeers(topic string) []peer.ID
- func (p *PubSub) Publish(topic string, data []byte) error
- func (p *PubSub) Subscribe(topic string) (*Subscription, error)
- func (p *PubSub) SubscribeByTopicDescriptor(td *pb.TopicDescriptor) (*Subscription, error)
- type PubSubNotif
- func (p *PubSubNotif) ClosedStream(n inet.Network, s inet.Stream)
- func (p *PubSubNotif) Connected(n inet.Network, c inet.Conn)
- func (p *PubSubNotif) Disconnected(n inet.Network, c inet.Conn)
- func (p *PubSubNotif) Listen(n inet.Network, _ ma.Multiaddr)
- func (p *PubSubNotif) ListenClose(n inet.Network, _ ma.Multiaddr)
- func (p *PubSubNotif) OpenedStream(n inet.Network, s inet.Stream)
- type RPC
- type Subscription
Constants ¶
View Source
const ID = protocol.ID("/floodsub/1.0.0")
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PubSub ¶
type PubSub struct {
// contains filtered or unexported fields
}
func NewFloodSub ¶
NewFloodSub returns a new FloodSub management object
func (*PubSub) Subscribe ¶
func (p *PubSub) Subscribe(topic string) (*Subscription, error)
Subscribe returns a new Subscription for the given topic
func (*PubSub) SubscribeByTopicDescriptor ¶
func (p *PubSub) SubscribeByTopicDescriptor(td *pb.TopicDescriptor) (*Subscription, error)
SubscribeByTopicDescriptor lets you subscribe a topic using a pb.TopicDescriptor
type PubSubNotif ¶
type PubSubNotif PubSub
func (*PubSubNotif) ClosedStream ¶
func (p *PubSubNotif) ClosedStream(n inet.Network, s inet.Stream)
func (*PubSubNotif) Disconnected ¶
func (p *PubSubNotif) Disconnected(n inet.Network, c inet.Conn)
func (*PubSubNotif) ListenClose ¶
func (p *PubSubNotif) ListenClose(n inet.Network, _ ma.Multiaddr)
func (*PubSubNotif) OpenedStream ¶
func (p *PubSubNotif) OpenedStream(n inet.Network, s inet.Stream)
type Subscription ¶
type Subscription struct {
// contains filtered or unexported fields
}
func (*Subscription) Cancel ¶
func (sub *Subscription) Cancel()
func (*Subscription) Topic ¶
func (sub *Subscription) Topic() string
Click to show internal directories.
Click to hide internal directories.