global.go 702 B

123456789101112131415161718192021222324252627282930
  1. package global
  2. import (
  3. "mtp20access/config"
  4. "github.com/go-redis/redis/v8"
  5. "github.com/spf13/viper"
  6. "github.com/streadway/amqp"
  7. "go.uber.org/zap"
  8. "golang.org/x/sync/singleflight"
  9. "xorm.io/xorm"
  10. )
  11. type RabbitMQ struct {
  12. Connection *amqp.Connection
  13. Channel *amqp.Channel
  14. }
  15. var (
  16. M2A_DB *xorm.Engine
  17. M2A_REDIS *redis.Client
  18. M2A_CONFIG config.Server
  19. M2A_VP *viper.Viper
  20. M2A_LOG *zap.Logger
  21. M2A_Concurrency_Control = &singleflight.Group{}
  22. M2A_RABBITMQ *RabbitMQ
  23. M2A_Clients map[int]*Client // key:SessionID
  24. M2A_FuncodeTopic map[string][]int // 总线主题与REQ Funcode的MAP, key:主题
  25. )