Documentation ¶
Index ¶
- type Broker
- func (b *Broker) AddSubscriber() *Subscriber
- func (b *Broker) Broadcast(msg string, topics []string)
- func (b *Broker) GetSubscribers(topic string) int
- func (b *Broker) Publish(topic string, msg string)
- func (b *Broker) RemoveSubscriber(s *Subscriber)
- func (b *Broker) Subscribe(s *Subscriber, topic string)
- func (b *Broker) Unsubscribe(s *Subscriber, topic string)
- type Message
- type Subscriber
- type Subscribers
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Broker ¶
type Broker struct {
// contains filtered or unexported fields
}
func (*Broker) AddSubscriber ¶
func (b *Broker) AddSubscriber() *Subscriber
func (*Broker) GetSubscribers ¶
func (*Broker) RemoveSubscriber ¶
func (b *Broker) RemoveSubscriber(s *Subscriber)
func (*Broker) Subscribe ¶
func (b *Broker) Subscribe(s *Subscriber, topic string)
func (*Broker) Unsubscribe ¶
func (b *Broker) Unsubscribe(s *Subscriber, topic string)
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
func NewMessage ¶
func (*Message) GetMessageBody ¶
type Subscriber ¶
type Subscriber struct {
// contains filtered or unexported fields
}
func CreateNewSubscriber ¶
func CreateNewSubscriber() (string, *Subscriber)
func (*Subscriber) AddTopic ¶
func (s *Subscriber) AddTopic(topic string)
func (*Subscriber) Destruct ¶
func (s *Subscriber) Destruct()
func (*Subscriber) GetTopics ¶
func (s *Subscriber) GetTopics() []string
func (*Subscriber) Listen ¶
func (s *Subscriber) Listen(w http.ResponseWriter)
func (*Subscriber) RemoveTopic ¶
func (s *Subscriber) RemoveTopic(topic string)
func (*Subscriber) Signal ¶
func (s *Subscriber) Signal(msg *Message)
type Subscribers ¶
type Subscribers map[string]*Subscriber
Click to show internal directories.
Click to hide internal directories.