Documentation ¶
Index ¶
- func Connect(addr string) error
- func ConnectConfig(addr string, config *nsq.Config) error
- func MultiPublish(topic string, body [][]byte) error
- func MultiPublishAsync(topic string, body [][]byte, doneChan chan *nsq.ProducerTransaction, ...) error
- func Publish(topic string, body []byte) error
- func PublishAsync(topic string, body []byte, doneChan chan *nsq.ProducerTransaction, ...) error
- func PublishJSON(topic string, v interface{}) error
- func PublishJSONAsync(topic string, v interface{}, doneChan chan *nsq.ProducerTransaction, ...) error
- type Producer
- func (p *Producer) Connect(addr string) (err error)
- func (p *Producer) ConnectConfig(addr string, config *nsq.Config) (err error)
- func (p *Producer) PublishJSON(topic string, v interface{}) error
- func (p *Producer) PublishJSONAsync(topic string, v interface{}, doneChan chan *nsq.ProducerTransaction, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectConfig ¶
ConnectConfig method initialize the connection to nsq with config
func MultiPublish ¶
MultiPublish - sends multiple message to to nsq topic
func MultiPublishAsync ¶
func MultiPublishAsync(topic string, body [][]byte, doneChan chan *nsq.ProducerTransaction, args ...interface{}) error
MultiPublishAsync - sends multiple message to nsq topic asynchronously
func PublishAsync ¶
func PublishAsync(topic string, body []byte, doneChan chan *nsq.ProducerTransaction, args ...interface{}) error
PublishAsync - sends a message to nsq topic asynchronously
func PublishJSON ¶
PublishJSON - sends message to nsq topic in json format
func PublishJSONAsync ¶
func PublishJSONAsync(topic string, v interface{}, doneChan chan *nsq.ProducerTransaction, args ...interface{}) error
PublishJSONAsync - sends message to nsq topic in json format asynchronously
Types ¶
type Producer ¶
Producer inherets the nsq Producer object
var DefaultProducer *Producer
Instantiates the Producer object
func (*Producer) ConnectConfig ¶
ConnectConfig method initialize the connection to nsq with config.
func (*Producer) PublishJSON ¶
PublishJSON - sends message to nsq topic in json format
func (*Producer) PublishJSONAsync ¶
func (p *Producer) PublishJSONAsync(topic string, v interface{}, doneChan chan *nsq.ProducerTransaction, args ...interface{}) error
PublishJSONAsync - sends message to nsq topic in json format asynchronously