mirror of
https://github.com/twofas/2fas-server.git
synced 2024-12-12 12:09:56 +01:00
20 lines
310 B
Go
20 lines
310 B
Go
|
package redis
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"github.com/go-redis/redis/v8"
|
||
|
)
|
||
|
|
||
|
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,
|
||
|
})
|
||
|
}
|