Documentation ¶
Index ¶
- Constants
- Variables
- func NewConsumer(topic, ch string) (*nsq.Consumer, error)
- func Publish[T Message](host string, topic string, message T) error
- func StopProducers()
- type BroadCastMessage
- type ConnDelegate
- func (d *ConnDelegate) OnBackoff(*nsq.Conn)
- func (d *ConnDelegate) OnClose(*nsq.Conn)
- func (d *ConnDelegate) OnContinue(*nsq.Conn)
- func (d *ConnDelegate) OnError(*nsq.Conn, []byte)
- func (d *ConnDelegate) OnHeartbeat(*nsq.Conn)
- func (d *ConnDelegate) OnIOError(*nsq.Conn, error)
- func (d *ConnDelegate) OnMessage(*nsq.Conn, *nsq.Message)
- func (d *ConnDelegate) OnMessageFinished(*nsq.Conn, *nsq.Message)
- func (d *ConnDelegate) OnMessageRequeued(*nsq.Conn, *nsq.Message)
- func (d *ConnDelegate) OnResponse(*nsq.Conn, []byte)
- func (d *ConnDelegate) OnResume(*nsq.Conn)
- type ExchangeMessage
- type Handler
- type Message
- type PrivateMessage
- type User
Constants ¶
View Source
const ( SignalClearConsumers string = "SIGNAL_CLEAR_CONSUMERS" SignalAddConsumers string = "SIGNAL_ADD_CONSUMERS" )
View Source
const (
SignalClearConsumersComplete string = "ccc"
)
Variables ¶
View Source
var CleanUpChans map[uint]map[string]chan bool
user id -> group topic -> complete
Functions ¶
func NewConsumer ¶
func StopProducers ¶
func StopProducers()
Types ¶
type BroadCastMessage ¶
type ConnDelegate ¶
type ConnDelegate struct{}
func (*ConnDelegate) OnBackoff ¶
func (d *ConnDelegate) OnBackoff(*nsq.Conn)
func (*ConnDelegate) OnClose ¶
func (d *ConnDelegate) OnClose(*nsq.Conn)
func (*ConnDelegate) OnContinue ¶
func (d *ConnDelegate) OnContinue(*nsq.Conn)
func (*ConnDelegate) OnError ¶
func (d *ConnDelegate) OnError(*nsq.Conn, []byte)
func (*ConnDelegate) OnHeartbeat ¶
func (d *ConnDelegate) OnHeartbeat(*nsq.Conn)
func (*ConnDelegate) OnIOError ¶
func (d *ConnDelegate) OnIOError(*nsq.Conn, error)
func (*ConnDelegate) OnMessage ¶
func (d *ConnDelegate) OnMessage(*nsq.Conn, *nsq.Message)
func (*ConnDelegate) OnMessageFinished ¶
func (d *ConnDelegate) OnMessageFinished(*nsq.Conn, *nsq.Message)
func (*ConnDelegate) OnMessageRequeued ¶
func (d *ConnDelegate) OnMessageRequeued(*nsq.Conn, *nsq.Message)
func (*ConnDelegate) OnResponse ¶
func (d *ConnDelegate) OnResponse(*nsq.Conn, []byte)
func (*ConnDelegate) OnResume ¶
func (d *ConnDelegate) OnResume(*nsq.Conn)
type ExchangeMessage ¶
type ExchangeMessage struct { Type string `json:"type"` UserID uint `json:"user_id"` TargetID uint `json:"target_id"` TargetType string `json:"target_type"` Topic string `json:"topic"` PostbackTopic string `json:"postback_topic"` PostbackCh string `json:"postback_ch"` PostbackMsg *PrivateMessage `json:"postback_message"` }
type Message ¶
type Message interface { *BroadCastMessage | *ExchangeMessage | *PrivateMessage }
type PrivateMessage ¶
Click to show internal directories.
Click to hide internal directories.