Discover Packages
github.com/slava02/helperbot
configs
package
Version:
v0.0.0-...-ebfe39f
Opens a new window with list of versions in this module.
Published: May 11, 2024
License: MIT
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package configs implement configurations that the application needs.
type App struct {
Name string `env:"BOT_NAME,required"`
Token string `env:"BOT_APITOKEN,required"`
Driver string `env:"BOT_DB_DRIVER,required"`
}
New returns the config, if can't open .env file or parse environment variables it returns an error.
TODO: разобраться как работают прод и дев режимы
make sure to delete the .env file and pass production mode in production.
type MySQL struct {
Username string `env:"BOT_MYSQL_USERNAME,required"`
Password string `env:"BOT_MYSQL_PASSWORD,required"`
Protocol string `env:"BOT_MYSQL_PROTOCOL,required"`
Host string `env:"BOT_MYSQL_HOST,required"`
Port string `env:"BOT_MYSQL_PORT,required"`
DBName string `env:"BOT_MYSQL_DBNAME,required"`
}
type MySQLite struct {
Path string `env:"BOT_MYSQLite_PATH,required"`
DBName string `env:"BOT_MYSQLite_DBNAME,required"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.