feat: support output

This commit is contained in:
Rogee
2024-09-02 23:55:40 +08:00
parent e953d41e7a
commit 3f1197e5d4
5 changed files with 23 additions and 6 deletions

View File

@@ -16,12 +16,13 @@ type Config struct {
LogFile string `mapstructure:"log_file"`
MaxSize string `mapstructure:"max_size"`
DSN string `mapstructure:"dsn"`
Outputs string `mapstructure:"outputs"`
}
// GetMaxSize
func (c *Config) GetMaxSize() uint {
// parse 50m to 50 * 1024 * 1024
return viper.GetSizeInBytes(c.MaxSize)
// parse 50mb to 50 * 1024 * 1024
return viper.GetSizeInBytes("max_size")
}
func Load(path string) error {