3 Star 1 Fork 0

中光云计算(西安)有限公司 / Doraemon

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
send.go 392 Bytes
一键复制 编辑 原始数据 按行查看 历史
countpoison 提交于 2019-10-08 15:58 . update nsq
package mynsq
import (
"github.com/nsqio/go-nsq"
)
var w *nsq.Producer
var Server string
func InitNsq(server string) error {
Server = server
config := nsq.NewConfig()
s, err := nsq.NewProducer(server, config)
w = s
if err != nil {
return err
}
return err
}
func Send(topic string, msg []byte) error {
err := w.Publish(topic, msg)
if err != nil {
return err
}
return err
}
Go
1
https://gitee.com/countpoison/Doraemon.git
git@gitee.com:countpoison/Doraemon.git
countpoison
Doraemon
Doraemon
f6c0e8d84ec1

搜索帮助