main.go 335 B

12345678910111213141516171819
  1. package bus
  2. import (
  3. "box-cost/conf"
  4. "infish.cn/comm"
  5. )
  6. var NatsCenter *comm.NatsBus
  7. func NewNatsBus(app *conf.AppConf) *comm.NatsBus {
  8. bus, _ := comm.NewNatsBus2(app.Nats.Url, app.Nats.MaxReconnect,
  9. app.Nats.ReconnDelaySecond,
  10. []*comm.NatsStreamWather{},
  11. []*comm.NatsMsgReplyer{})
  12. NatsCenter = bus
  13. return NatsCenter
  14. }