Skip to content

Commit

Permalink
fix: 增加一个用户信息接口 (#793)
Browse files Browse the repository at this point in the history
  • Loading branch information
sappan authored Aug 22, 2024
1 parent 05ac714 commit c22a036
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cache/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ type Redis struct {
// RedisOpts redis 连接属性
type RedisOpts struct {
Host string `yml:"host" json:"host"`
Username string `yaml:"username" json:"username"`
Password string `yml:"password" json:"password"`
Database int `yml:"database" json:"database"`
MaxIdle int `yml:"max_idle" json:"max_idle"`
Expand All @@ -28,6 +29,7 @@ func NewRedis(ctx context.Context, opts *RedisOpts) *Redis {
conn := redis.NewUniversalClient(&redis.UniversalOptions{
Addrs: []string{opts.Host},
DB: opts.Database,
Username: opts.Username,
Password: opts.Password,
IdleTimeout: time.Second * time.Duration(opts.IdleTimeout),
MinIdleConns: opts.MaxIdle,
Expand Down

0 comments on commit c22a036

Please sign in to comment.