go-libp2p-pubsub/doc.go

28 lines
1.3 KiB
Go
Raw Normal View History

2019-01-04 11:02:08 +00:00
// The pubsub package provides facilities for the Publish/Subscribe pattern of message
// propagation, also known as overlay multicast.
// The implementation provides topic-based pubsub, with pluggable routing algorithms.
//
2019-01-11 10:03:09 +00:00
// The main interface to the library is the PubSub object.
// You can construct this object with the following constructors:
//
// - NewFloodSub creates an instance that uses the floodsub routing algorithm.
//
// - NewGossipSub creates an instance that uses the gossipsub routing algorithm.
//
// - NewRandomSub creates an instance that uses the randomsub routing algorithm.
2019-01-04 11:02:08 +00:00
//
// In addition, there is a generic constructor that creates a pubsub instance with
// a custom PubSubRouter interface. This procedure is currently reserved for internal
// use within the package.
//
2019-01-11 10:03:09 +00:00
// Once you have constructed a PubSub instance, you need to establish some connections
2019-01-04 11:02:08 +00:00
// to your peers; the implementation relies on ambient peer discovery, leaving bootstrap
// and active peer discovery up to the client.
//
2019-01-11 10:03:09 +00:00
// To publish a message to some topic, use Publish; you don't need to be subscribed
2019-01-04 11:02:08 +00:00
// to the topic in order to publish.
//
2019-01-11 10:03:09 +00:00
// To subscribe to a topic, use Subscribe; this will give you a subscription interface
2019-01-04 11:02:08 +00:00
// from which new messages can be pumped.
package pubsub