package impl

import (
	"bsm/full/module/social/relation/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
	DBService    *gorm.DB
	MemorySerice *cache.Cache
)

func NewImpl() {
	// with activating
	MemorySerice = with.Memory(nil)
	RedisService = with.RedisCache(config.Spec.Cache)      // redis cache
	DBService = with.Databases(config.Spec.Databases, nil) // model
	EtcdService = with.Etcd(config.Spec.Etcd)              // etcd
}
