conf.go 307 B

1234567891011121314151617181920
  1. package lancermonitor
  2. import (
  3. "errors"
  4. )
  5. type Config struct {
  6. Addr string `toml:"addr"`
  7. }
  8. func (c *Config) ConfigValidate() (error) {
  9. if c == nil {
  10. return errors.New("config of LancerMonitor is nil")
  11. }
  12. if c.Addr == "" {
  13. return errors.New("addr of LancerMonitor can't be nil")
  14. }
  15. return nil
  16. }