17 lines
319 B
Go
17 lines
319 B
Go
package cache
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/luxsin/app-api/internal/config"
|
|
"github.com/redis/go-redis/v9"
|
|
)
|
|
|
|
func NewClient(cfg config.RedisConfig) *redis.Client {
|
|
return redis.NewClient(&redis.Options{
|
|
Addr: fmt.Sprintf("%s:%d", cfg.Host, cfg.Port),
|
|
Password: cfg.Password,
|
|
DB: cfg.Database,
|
|
})
|
|
}
|