package global

import (
	"mtp20access/config"
	"mtp20access/publish"

	"github.com/go-redis/redis/v8"
	"github.com/spf13/viper"
	"github.com/streadway/amqp"
	"go.uber.org/zap"
	"golang.org/x/sync/singleflight"
	"xorm.io/xorm"
)

type RabbitMQ struct {
	Connection *amqp.Connection
	Channel    *amqp.Channel
}

var (
	M2A_DB                  *xorm.Engine
	M2A_REDIS               *redis.Client
	M2A_CONFIG              config.Server
	M2A_VP                  *viper.Viper
	M2A_LOG                 *zap.Logger
	M2A_Concurrency_Control = &singleflight.Group{}

	M2A_RABBITMQ     *RabbitMQ
	M2A_FuncodeTopic map[string][]int // 总线主题与REQ Funcode的MAP， key:主题

	M2A_Publish *publish.Publisher
)
