fix: issues
This commit is contained in:
@@ -14,9 +14,16 @@ type Config struct {
|
||||
BotToken string `mapstructure:"bot_token"`
|
||||
SessionFile string `mapstructure:"session_file"`
|
||||
LogFile string `mapstructure:"log_file"`
|
||||
MaxSize string `mapstructure:"max_size"`
|
||||
DSN string `mapstructure:"dsn"`
|
||||
}
|
||||
|
||||
// GetMaxSize
|
||||
func (c *Config) GetMaxSize() uint {
|
||||
// parse 50m to 50 * 1024 * 1024
|
||||
return viper.GetSizeInBytes(c.MaxSize)
|
||||
}
|
||||
|
||||
func Load(path string) error {
|
||||
// Load the config file
|
||||
viper.SetConfigFile(path)
|
||||
|
||||
Reference in New Issue
Block a user