Create redis session engine

This commit is contained in:
Eden Kirin
2023-10-25 10:56:38 +02:00
parent c7955104ae
commit 7fdf131d53
5 changed files with 79 additions and 15 deletions

View File

@ -10,13 +10,6 @@ import (
)
type configStruct struct {
Database struct {
Host string `yaml:"host"`
Port string `yaml:"port"`
Name string `yaml:"name"`
Username string `yaml:"username"`
Password string `yaml:"password" json:"-"`
} `yaml:"database"`
Application struct {
SecretKey string `yaml:"secretKey" json:"-"`
LogLevel string `yaml:"logLevel"`
@ -27,6 +20,21 @@ type configStruct struct {
IsProduction bool `yaml:"isProduction"`
LoopDelay uint32 `yaml:"loopDelay"`
} `yaml:"application"`
Database struct {
Host string `yaml:"host"`
Port string `yaml:"port"`
Name string `yaml:"name"`
Username string `yaml:"username"`
Password string `yaml:"password" json:"-"`
} `yaml:"database"`
Redis struct {
Host string `yaml:"host"`
Port int `yaml:"port"`
Username string `yaml:"username"`
Password string `yaml:"password" json:"-"`
Database string `yaml:"database"`
Prefix string `yaml:"prefix"`
} `yaml:"redis"`
SMTP struct {
Host string `yaml:"host"`
Port int `yaml:"port"`
@ -81,6 +89,7 @@ func Init() {
maskedCfg := Config
maskedCfg.Database.Password = "**password hidden**"
maskedCfg.Redis.Password = "**password hidden**"
maskedCfg.SMTP.Password = "**password hidden**"
maskedCfg.Application.SecretKey = "**secret key hidden**"