Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrEnvNotExists error = errors.New(".env file is not exists")
)
Functions ¶
This section is empty.
Types ¶
type AppConfig ¶
type AppConfig struct {
Port int `env:"PORT" env-default:"443"`
Host string `env:"HOST" env-default:"localhost"`
Env string `env:"ENV" env-default:"development"`
AdminUser struct {
Email string `env:"ADMIN_EMAIL" env-default:"admin"`
Password string `env:"ADMIN_PWD" env-default:"admin"`
}
}
AppConfig is general config for application
type Config ¶
type Config struct {
App AppConfig
Logger LoggerConfig
MySQL MySQLConfig
Session SessionConfig
TLS TLSConfig
SMTP SMTPConfig
}
Config fo application
type LoggerConfig ¶
type LoggerConfig struct {
LogLevel string `env:"LOG_LEVEL" env-default:"development"`
LogFilePath string `env:"LOG_FILE" env-default:"./tmp/log.log"`
MaxSize int `env:"LOG_MAXSIZE" env-default:"100"`
MaxBackups int `env:"LOG_MAXBACKUP" env-default:"3"`
MaxAge int `env:"LOG_MAXAGE" env-default:"24"`
Compress bool `env:"LOG_COMPRESS" env-default:"true"`
}
LoggerConfig is config for logging part
type MySQLConfig ¶
type MySQLConfig struct {
Driver string `env:"MYSQL_DRIVER" env-default:"mysql"`
DSN string `env:"MYSQL_DSN" env-default:"root:486464@tcp(localhost:3306)/neuronews?parseTime=true"`
}
MySQLConfig is config fo MySQL part
type SMTPConfig ¶
type SMTPConfig struct {
Host string `env:"SMTP_HOST"`
Port int `env:"SMTP_PORT"`
Username string `env:"SMTP_USERNAME"`
Password string `env:"SMTP_PASSWORD"`
Sender string `env:"SMTP_SENDER"`
}
SMTPConfig is config for SMTP part
type SessionConfig ¶
type SessionConfig struct {
Secret string `env:"SESSION_SECRET" env-default:"s6Ndh+pPbnzHbS*+9Pk8qGWhTzbpa@ge"`
}
SessionConfig is config for session part
Click to show internal directories.
Click to hide internal directories.