Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewEventPeerJoin ¶
NewEventPeerJoin creates a new EventPubSubJoin event
func NewEventPeerLeave ¶
NewEventPeerLeave creates a new EventPubSubLeave event
Types ¶
type EventPubSubJoin ¶
EventPubSubJoin Is an event triggered when a peer joins the channel
type EventPubSubLeave ¶
EventPubSubLeave Is an event triggered when a peer leave the channel
type EventPubSubMessage ¶
EventPubSubMessage Indicates a new message posted on a pubsub topic
func NewEventMessage ¶
func NewEventMessage(from core.PeerID, content []byte) *EventPubSubMessage
Creates a new Message event
type EventPubSubPayload ¶
EventPubSubPayload An event received on new messages
func NewEventPayload ¶
func NewEventPayload(payload []byte, peerid core.PeerID) *EventPubSubPayload
NewEventPayload Creates a new Message event
type PubSubInterface ¶
type PubSubInterface interface { // TopicSubscribe Subscribes to a topic TopicSubscribe(ctx context.Context, topic string) (PubSubTopic, error) }
type PubSubTopic ¶
type PubSubTopic interface { // Publish Posts a new message on a topic Publish(ctx context.Context, message []byte) error // Peers Lists peers connected to the topic Peers(ctx context.Context) ([]core.PeerID, error) // WatchPeers subscribes to peers joining or leaving the topic WatchPeers(ctx context.Context) (<-chan interface{}, error) // WatchMessages Subscribes to new messages WatchMessages(ctx context.Context) (<-chan *EventPubSubMessage, error) // Topic Returns the topic name Topic() string }
PubSubTopic is a pub sub subscription to a topic
Click to show internal directories.
Click to hide internal directories.