feat(sms): add sms login method
This commit is contained in:
27
config/redis.go
Normal file
27
config/redis.go
Normal file
@ -0,0 +1,27 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/redis/go-redis/v9"
|
||||
)
|
||||
|
||||
var (
|
||||
RDC *redis.Client
|
||||
CTX = context.Background()
|
||||
)
|
||||
|
||||
func InitRedis() {
|
||||
RDC = redis.NewClient(&redis.Options{
|
||||
Addr: fmt.Sprintf("%s:%d", Conf.Redis.Host, Conf.Redis.Port),
|
||||
Password: Conf.Redis.Passwd,
|
||||
DB: Conf.Redis.DB,
|
||||
})
|
||||
}
|
||||
|
||||
func CloseRedis() {
|
||||
err := RDC.Close()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user