Documentation ¶
Index ¶
- Variables
- type Channel
- type Mq
- func (m *Mq) Channels(topic string) (channels []string)
- func (m *Mq) Close()
- func (m *Mq) GetTopic(name string) *Topic
- func (m *Mq) Publish(topic string, data []byte) error
- func (m *Mq) Subscribe(client Subscriber, topic, channel string)
- func (m *Mq) Topics() (topics []string)
- func (m *Mq) Unsubscribe(client Subscriber, topic, channel string)
- type MqClient
- func (c *MqClient) Channels(topic string) []string
- func (c *MqClient) Name() string
- func (c *MqClient) Publish(topic string, msg []byte)
- func (c *MqClient) Stop()
- func (c *MqClient) Subscribe(topic, channel string) error
- func (c *MqClient) ToSelectCase() *reflect.SelectCase
- func (c *MqClient) Topics() []string
- func (c *MqClient) Unsubscribe(topic, channel string) error
- type Msg
- type MsgId
- type Subscriber
- type Topic
- type TopicChannel
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrMqClosing = logex.Define("mq is closing")
)
Functions ¶
This section is empty.
Types ¶
type Channel ¶
func (*Channel) AddSubscriber ¶
func (ch *Channel) AddSubscriber(s Subscriber)
func (*Channel) RemoveSubscriber ¶
func (ch *Channel) RemoveSubscriber(s Subscriber) (idx int)
type Mq ¶
type Mq struct {
// contains filtered or unexported fields
}
func (*Mq) Subscribe ¶
func (m *Mq) Subscribe(client Subscriber, topic, channel string)
func (*Mq) Unsubscribe ¶
func (m *Mq) Unsubscribe(client Subscriber, topic, channel string)
type MqClient ¶
type MqClient struct { RespChan chan *Msg StopChan chan struct{} // contains filtered or unexported fields }
func NewMqClient ¶
func (*MqClient) ToSelectCase ¶
func (c *MqClient) ToSelectCase() *reflect.SelectCase
func (*MqClient) Unsubscribe ¶
type Msg ¶
func (*Msg) TopicChannel ¶
func (m *Msg) TopicChannel() *TopicChannel
type Subscriber ¶
type Subscriber interface { Name() string ToSelectCase() *reflect.SelectCase }
type Topic ¶
type Topic struct { Name string Chans []*Channel ChanSelect []reflect.SelectCase EmptyChan reflect.Value // contains filtered or unexported fields }
func (*Topic) AddSubscriber ¶
func (t *Topic) AddSubscriber(channel string, s Subscriber)
func (*Topic) RemoveSubscriber ¶
func (t *Topic) RemoveSubscriber(channel string, s Subscriber)
type TopicChannel ¶
func (*TopicChannel) String ¶
func (t *TopicChannel) String() string
Click to show internal directories.
Click to hide internal directories.