Skip to content

Commit

Permalink
change config
Browse files Browse the repository at this point in the history
  • Loading branch information
sevennt committed Nov 8, 2023
1 parent 61846bf commit 58b1068
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
5 changes: 3 additions & 2 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ type config struct {
Addr string // Addr stub 模式下实例配置地址
Mode string // Mode Redis模式 cluster|stub|sentinel
MasterName string // MasterName 哨兵主节点名称,sentinel模式下需要配置此项
Username string // Username sentinel 模式下用户密码
Password string // Password cluster|stub|sentinel 模式下密码
SentinelUsername string // SentinelUsername sentinel 模式下用户密码
SentinelPassword string // SentinelPassword sentinel 模式下密码
Password string // Password cluster|stub 模式下密码
DB int // DB,默认为0, 一般应用不推荐使用DB分片
PoolSize int // PoolSize 集群内每个节点的最大连接池限制
MaxRetries int // MaxRetries 网络相关的错误最大重试次数 默认8次
Expand Down
5 changes: 3 additions & 2 deletions container.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,9 @@ func (c *Container) buildSentinel() *redis.Client {
sentinelClient := redis.NewFailoverClient(&redis.FailoverOptions{
MasterName: c.config.MasterName,
SentinelAddrs: c.config.Addrs,
SentinelPassword: c.config.Password,
SentinelUsername: c.config.Username,
SentinelUsername: c.config.SentinelUsername,
SentinelPassword: c.config.SentinelPassword,
Password: c.config.Password,
DB: c.config.DB,
MaxRetries: c.config.MaxRetries,
DialTimeout: c.config.DialTimeout,
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ require (
github.com/go-redis/redis/extra/rediscmd/v8 v8.11.4
github.com/go-redis/redis/v8 v8.11.4
github.com/gotomicro/ego v1.0.3
github.com/json-iterator/go v1.1.12
github.com/spf13/cast v1.3.1
github.com/stretchr/testify v1.7.0
go.opentelemetry.io/otel v1.4.1
Expand All @@ -29,7 +30,6 @@ require (
github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99 // indirect
github.com/google/uuid v1.1.2 // indirect
github.com/gotomicro/logrotate v0.0.0-20211108024517-45d1f9a03ff5 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.3.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
Expand Down
6 changes: 0 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,6 @@ github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2z
github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gotomicro/ego v1.0.0 h1:2v7im+ovFMyZDGCG90+fQb8wXySA9fbZGHw3VnCActU=
github.com/gotomicro/ego v1.0.0/go.mod h1:Pjt+5kIVGMqzpKYMxeN4s/Dc2TrNO9R58yQwt9zoXck=
github.com/gotomicro/ego v1.0.1 h1:TId194gdnP43RNwh4xBU/MC8Tc6R8nJ5v3BZtf6movE=
github.com/gotomicro/ego v1.0.1/go.mod h1:Pjt+5kIVGMqzpKYMxeN4s/Dc2TrNO9R58yQwt9zoXck=
github.com/gotomicro/ego v1.0.2 h1:ScGEaP1MVT4w6kPa8AB8sqRdDiCWN4p1g7AwBCzrU1s=
github.com/gotomicro/ego v1.0.2/go.mod h1:Pjt+5kIVGMqzpKYMxeN4s/Dc2TrNO9R58yQwt9zoXck=
github.com/gotomicro/ego v1.0.3 h1:wSuS/AI3HV8r5Gro5oG2qlCAfQ/skDDs6GXedEqJRj4=
github.com/gotomicro/ego v1.0.3/go.mod h1:Pjt+5kIVGMqzpKYMxeN4s/Dc2TrNO9R58yQwt9zoXck=
github.com/gotomicro/logrotate v0.0.0-20211108024517-45d1f9a03ff5 h1:y9nw0S0zlla/SBt1GGaTNNCF+781epJ62MntVVbekqQ=
Expand Down

0 comments on commit 58b1068

Please sign in to comment.