Documentation ¶
Index ¶
- type Broker
- func (b *Broker) Publish(ctx context.Context, in *pb.PublishRequest) (*pb.PublishResponse, error)
- func (b *Broker) Start() error
- func (b *Broker) Stop() error
- func (b *Broker) Subscribe(in *pb.SubscribeRequest, stream pb.PubSubService_SubscribeServer) error
- func (b *Broker) Unsubscribe(ctx context.Context, in *pb.UnsubscribeRequest) (*pb.UnsubscribeResponse, error)
- type Consumer
- type Publisher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Broker ¶
type Broker struct { pb.UnimplementedPubSubServiceServer // contains filtered or unexported fields }
func (*Broker) Publish ¶
func (b *Broker) Publish(ctx context.Context, in *pb.PublishRequest) (*pb.PublishResponse, error)
func (*Broker) Subscribe ¶
func (b *Broker) Subscribe(in *pb.SubscribeRequest, stream pb.PubSubService_SubscribeServer) error
func (*Broker) Unsubscribe ¶
func (b *Broker) Unsubscribe(ctx context.Context, in *pb.UnsubscribeRequest) (*pb.UnsubscribeResponse, error)
type Consumer ¶
type Consumer struct { ID uint32 Messages chan *pb.Message // Channel to receive messages from the broker. // contains filtered or unexported fields }
func NewConsumer ¶
NewConsumer creates a new consumer which connects to the broker at the given address.
func (*Consumer) Unsubscribe ¶
Unsubscribe unsubscribes from the given topic.
type Publisher ¶
type Publisher struct {
// contains filtered or unexported fields
}
func NewPublisher ¶
NewPublisher creates a new publisher which connects to the broker at the given address.
Click to show internal directories.
Click to hide internal directories.