| 123456789101112131415161718192021222324 |
- // Author: simon (ynwdlxm@163.com)
- // Date: 2025/7/21 12:42
- // Desc:
- package bootstrap
- import (
- "fmt"
- "github.com/runningwater/gohub/pkg/cache"
- "github.com/runningwater/gohub/pkg/config"
- )
- func SetupCache() {
- // 初始化缓存的专用 redis client
- rds := cache.NewRedisStore(
- fmt.Sprintf("%v:%v", config.GetString("redis.host"), config.GetString("redis.port")),
- config.GetString("redis.username"),
- config.GetString("redis.password"),
- config.GetInt("redis.database_cache"),
- )
- cache.InitWithCacheStore(rds)
- }
|