config.go 412 B

123456789101112131415161718192021222324
  1. package fileLog
  2. import (
  3. "fmt"
  4. "github.com/BurntSushi/toml"
  5. )
  6. type Config struct {
  7. }
  8. func (c *Config) ConfigValidate() (error) {
  9. if c == nil {
  10. return fmt.Errorf("Error can't be nil")
  11. }
  12. return nil
  13. }
  14. func DecodeConfig(md toml.MetaData, primValue toml.Primitive) (c interface{}, err error) {
  15. c = new(Config)
  16. if err = md.PrimitiveDecode(primValue, c); err != nil {
  17. return nil, err
  18. }
  19. return c, nil
  20. }