deving
This commit is contained in:
24
internal/impl/impl.go
Normal file
24
internal/impl/impl.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package impl
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"git.apinb.com/bsm-sdk/core/cache/redis"
|
||||
"git.apinb.com/bsm-sdk/core/with"
|
||||
"git.apinb.com/senlinai/site/internal/config"
|
||||
cache "github.com/patrickmn/go-cache"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
var (
|
||||
RedisService *redis.RedisClient
|
||||
DBService *gorm.DB
|
||||
MemoryService *cache.Cache
|
||||
)
|
||||
|
||||
func NewImpl() {
|
||||
// with activating
|
||||
MemoryService = cache.New(5*time.Minute, 10*time.Minute)
|
||||
RedisService = with.RedisCache(config.Spec.Cache) // redis cache
|
||||
DBService = with.Databases(config.Spec.Databases, nil) // model
|
||||
}
|
||||
Reference in New Issue
Block a user