package Nats

import (
	"Cold_GoodsOrder/conf"
	"Cold_GoodsOrder/lib"
	"fmt"
	"github.com/nats-io/nats.go"
)

func Init() {
	fmt.Println("============Nats init============")
	var err error
	// 连接Nats服务器
	lib.Nats, err = nats.Connect("nats://" + conf.NatsServer_Url)
	if err != nil {
		fmt.Println("nats 连接失败！")
		panic(err)
	}
	fmt.Println("nats OK！")

}
