Documentation ¶
Overview ¶
//init pu,err:=NewProducer("192.168.0.197",4150) if err!=nil{ //error } b,_:=json.Marshal(obj) //发送 err = pu.Publish("topic",b) if err!=nil{ //error }
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MessageHandler ¶
type MessageHandler struct { Channel string // contains filtered or unexported fields }
MessageHandler MessageHandler
func NewMessageHandler ¶
func NewMessageHandler(nsqServer string, channel string) (mh *MessageHandler, err error)
NewMessageHandler return new MessageHandler
func (*MessageHandler) Registry ¶
func (m *MessageHandler) Registry(topic string, ch chan []byte)
Registry Registry
Click to show internal directories.
Click to hide internal directories.