style(files): reorganize everything

This commit is contained in:
Anhgelus Morhtuuzh 2025-05-13 12:50:20 +02:00
parent 0a445aa1c7
commit c408afc879
Signed by: anhgelus
GPG key ID: CAD341EFA92DDDE5
13 changed files with 422 additions and 389 deletions

28
config/redis.go Normal file
View file

@ -0,0 +1,28 @@
package config
import (
"github.com/anhgelus/gokord"
"github.com/anhgelus/gokord/utils"
"github.com/redis/go-redis/v9"
)
var redisClient *redis.Client
func GetRedisClient() (*redis.Client, error) {
if redisClient == nil {
var err error
redisClient, err = gokord.BaseCfg.GetRedisCredentials().Connect()
return redisClient, err
}
return redisClient, nil
}
func CloseRedisClient() {
if redisClient == nil {
return
}
err := redisClient.Close()
if err != nil {
utils.SendAlert("exp/member.go - Closing redis client", err.Error())
}
}