Skip to content

Commit

Permalink
fix: naming on cache config
Browse files Browse the repository at this point in the history
  • Loading branch information
Bastien Rigaud committed Feb 21, 2024
1 parent 59aaabb commit c900dda
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions cache/redis/config.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package redis

type Config struct {
Host string `env:"CACHE_HOST"`
Port uint16 `env:"CACHE_PORT"`
type RedisConfig struct {
CacheHost string `env:"CACHE_HOST"`
CachePort uint16 `env:"CACHE_PORT"`
}
4 changes: 2 additions & 2 deletions cache/redis/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"github.com/rs/zerolog/log"
)

func GetConnection(ctx context.Context, cfg Config) redis.UniversalClient {
func GetConnection(ctx context.Context, cfg RedisConfig) redis.UniversalClient {
return redis.NewUniversalClient(&redis.UniversalOptions{
Addrs: []string{fmt.Sprintf("%s:%d", cfg.Host, cfg.Port)},
Addrs: []string{fmt.Sprintf("%s:%d", cfg.CacheHost, cfg.CachePort)},
DB: 0,
OnConnect: func(ctx context.Context, cn *redis.Conn) error {
log.Info().Msg("connected to the cache")
Expand Down

0 comments on commit c900dda

Please sign in to comment.