Documentation
¶
Index ¶
- func NewServer(ctx context.Context, wg *sync.WaitGroup, service Service, protocol, url string, ...) error
- type Client
- type Server
- type Service
- func (s *Service) GetTopics(ctx context.Context, req *pb.Empty) (*pb.TopicsResponse, error)
- func (s *Service) ListPeers(ctx context.Context, req *pb.ListPeersRequest) (*pb.ListPeersResponse, error)
- func (s *Service) Publish(stream pb.PubSubService_PublishServer) error
- func (s *Service) Subscribe(req *pb.SubscribeRequest, stream pb.PubSubService_SubscribeServer) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
pb.PubSubServiceClient
// contains filtered or unexported fields
}
Client is used to communicate with the gRPC Server service
type Server ¶
type Server struct {
Service
}
Server is used to run the libp2p pubsub grpc server it enables communicating pubsub messages over grpc
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is a libp2p pubsub service component
func NewService ¶
func NewService( ps *ps.PubSub, sd *discovery.RoutingDiscovery, h host.Host, l *zap.SugaredLogger, ) Service
NewService creates and returns a new libp2p pubsub service
func (*Service) GetTopics ¶
GetTopics is used to return a list of all known topics the pubsub instance is subscribed to.
func (*Service) ListPeers ¶
func (s *Service) ListPeers(ctx context.Context, req *pb.ListPeersRequest) (*pb.ListPeersResponse, error)
ListPeers is used to return a list of peers subscribed to a given topic or topics
func (*Service) Publish ¶
func (s *Service) Publish(stream pb.PubSubService_PublishServer) error
Publish is used to send a stream of messages to a pubsub topic.
func (*Service) Subscribe ¶
func (s *Service) Subscribe(req *pb.SubscribeRequest, stream pb.PubSubService_SubscribeServer) error
Subscribe is used to subscribe to a topic and receive messages
Click to show internal directories.
Click to hide internal directories.