Initial commit

Signed-off-by: Yuan Si <do4suki@gmail.com>
This commit is contained in:
2023-03-20 23:12:06 +08:00
commit 7f2cd4d7fe
28 changed files with 1887 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
package handler
import (
"context"
"honoka-chan/config"
"github.com/redis/go-redis/v9"
)
var (
nonce = 0
redisCli *redis.Client
redisCtx = context.Background()
)
func init() {
redisCli = redis.NewClient(&redis.Options{
Addr: config.Conf.Redis.Host + ":" + config.Conf.Redis.Port,
Password: config.Conf.Redis.Pass,
DB: config.Conf.Redis.Db,
})
_, err := redisCli.Ping(redisCtx).Result()
if err != nil {
panic(err)
}
}