add initial application structure with configuration, logging, and health check endpoints
This commit is contained in:
17
internal/infra/cache/redis.go
vendored
Normal file
17
internal/infra/cache/redis.go
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
package cache
|
||||
|
||||
import (
|
||||
"github.com/redis/go-redis/v9"
|
||||
|
||||
"epic-ent/internal/config"
|
||||
)
|
||||
|
||||
func NewRedis(cfg *config.Config) (*redis.Client, error) {
|
||||
rdb := redis.NewClient(&redis.Options{
|
||||
Addr: cfg.Redis.Addr,
|
||||
Password: cfg.Redis.Password,
|
||||
DB: cfg.Redis.DB,
|
||||
})
|
||||
|
||||
return rdb, nil
|
||||
}
|
||||
Reference in New Issue
Block a user