From 45e457711e8df05c2effa643611b7ef217eaf1bd Mon Sep 17 00:00:00 2001 From: Renato Almeida Date: Tue, 28 Nov 2023 13:00:42 +0000 Subject: [PATCH] chore(redis): redis cliente to own package (#156) * chore(redis): move redis client to own package * ioutil is deprecated --- pkg/{common/clients/redis_client.go => redis/client.go} | 4 ++-- .../clients/redis_configuration.go => redis/configuration.go} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename pkg/{common/clients/redis_client.go => redis/client.go} (98%) rename pkg/{common/clients/redis_configuration.go => redis/configuration.go} (100%) diff --git a/pkg/common/clients/redis_client.go b/pkg/redis/client.go similarity index 98% rename from pkg/common/clients/redis_client.go rename to pkg/redis/client.go index a935e78..87ce6b8 100644 --- a/pkg/common/clients/redis_client.go +++ b/pkg/redis/client.go @@ -4,7 +4,7 @@ import ( "context" "crypto/tls" "crypto/x509" - "io/ioutil" + "os" "time" "github.com/redis/go-redis/v9" @@ -54,7 +54,7 @@ func NewRedisClient(config RedisConfiguration, logger logging.Logger) RedisClien func newRedisClusterClient(config RedisConfiguration, logger logging.Logger) RedisClient { // CA and Cert configuration for TLS connection certPool := x509.NewCertPool() - caCert, err := ioutil.ReadFile(config.CACert) + caCert, err := os.ReadFile(config.CACert) if err != nil { logger.Fatalf("Error to read CA Cert file from: %s. Err: %v", config.CACert, err) } diff --git a/pkg/common/clients/redis_configuration.go b/pkg/redis/configuration.go similarity index 100% rename from pkg/common/clients/redis_configuration.go rename to pkg/redis/configuration.go