2fas-server/internal/common/redis/client.go

21 lines
311 B
Go
Raw Permalink Normal View History

2022-12-31 10:22:38 +01:00
package redis
import (
"fmt"
2024-01-02 09:48:34 +01:00
"github.com/redis/go-redis/v9"
2022-12-31 10:22:38 +01:00
)
var (
DefaultPassword = ""
DefaultDb = 0
)
func New(host string, port int) *redis.Client {
return redis.NewClient(&redis.Options{
Addr: fmt.Sprintf("%s:%d", host, port),
Password: DefaultPassword,
DB: DefaultDb,
})
}