chore(config): remove unused redis and s3 client constructors
All checks were successful
Build Backend / build (push) Successful in 2m25s
Build Backend / build-docker (push) Successful in 1m34s

Remove `NewRedis` and `NewS3` factory functions from the config package
to eliminate unused initialization logic and reduce dependency bloat.
This commit is contained in:
2026-05-14 02:26:28 +08:00
parent 9a1851f023
commit 570b2d7afe
2 changed files with 0 additions and 55 deletions

View File

@@ -1,10 +1,7 @@
package config
import (
"context"
"fmt"
"github.com/redis/go-redis/v9"
)
// RedisConfig Redis 配置
@@ -62,19 +59,3 @@ type MiniredisConfig struct {
Port int `mapstructure:"port"`
}
// NewRedis 创建 Redis 客户端(真实 Redis
func NewRedis(cfg *RedisConfig) (*redis.Client, error) {
client := redis.NewClient(&redis.Options{
Addr: cfg.Redis.Addr(),
Password: cfg.Redis.Password,
DB: cfg.Redis.DB,
PoolSize: cfg.PoolSize,
})
ctx := context.Background()
if err := client.Ping(ctx).Err(); err != nil {
return nil, fmt.Errorf("failed to connect to redis: %w", err)
}
return client, nil
}