1
0
Fork 0
mirror of https://github.com/eosswedenorg/thalos synced 2026-07-03 11:53:41 +02:00

app/config/config.go: Adding User field to RedisConfig

This commit is contained in:
Henrik Hautakoski 2023-07-13 06:57:28 +02:00
parent 8ab7d852a7
commit 500cddc082
4 changed files with 7 additions and 0 deletions

View file

@ -13,6 +13,7 @@ import (
type RedisConfig struct { type RedisConfig struct {
Addr string `yaml:"addr"` Addr string `yaml:"addr"`
User string `yaml:"user"`
Password string `yaml:"password"` Password string `yaml:"password"`
DB int `yaml:"db"` DB int `yaml:"db"`
CacheID string `yaml:"cache_id"` CacheID string `yaml:"cache_id"`

View file

@ -63,6 +63,7 @@ func TestParse(t *testing.T) {
}, },
Redis: RedisConfig{ Redis: RedisConfig{
Addr: "localhost:6379", Addr: "localhost:6379",
User: "myuser",
Password: "passwd", Password: "passwd",
DB: 4, DB: 4,
Prefix: "some::ship", Prefix: "some::ship",
@ -89,6 +90,7 @@ telegram:
channel: -123456789 channel: -123456789
redis: redis:
addr: "localhost:6379" addr: "localhost:6379"
user: "myuser"
password: "passwd" password: "passwd"
db: 4 db: 4
prefix: "some::ship" prefix: "some::ship"

View file

@ -239,6 +239,7 @@ func main() {
// Connect to redis // Connect to redis
rdb := redis.NewClient(&redis.Options{ rdb := redis.NewClient(&redis.Options{
Addr: conf.Redis.Addr, Addr: conf.Redis.Addr,
Username: conf.Redis.User,
Password: conf.Redis.Password, Password: conf.Redis.Password,
DB: conf.Redis.DB, DB: conf.Redis.DB,
}) })

View file

@ -53,6 +53,9 @@ redis:
# Address (and port) to redis server # Address (and port) to redis server
addr: "localhost:6379" addr: "localhost:6379"
# Username to use when authenticating
user: ""
# Password to use when authenticating # Password to use when authenticating
pasword: "" pasword: ""