package impl

import (
	"bsm/full/module/base/mgt/internal/config"

	"git.apinb.com/bsm-sdk/core/cache/redis"
	"git.apinb.com/bsm-sdk/core/with"
	cache "github.com/patrickmn/go-cache"
	clientv3 "go.etcd.io/etcd/client/v3"
	"gorm.io/gorm"
)

var (
	RedisService *redis.RedisClient
	EtcdService  *clientv3.Client
	MemorySerice *cache.Cache
	DBService    *gorm.DB
)

// NewImpl initializes infrastructure for standalone execution.
func NewImpl() {
	MemorySerice = with.Memory(nil)
	RedisService = with.RedisCache(config.Spec.Cache)
	WithDatabases(config.Spec.Databases, nil)
	EtcdService = with.Etcd(config.Spec.Etcd)
}
