conf.go 263 B

1234567891011121314151617181920
  1. package httpstream
  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 Sock Input is nil")
  11. }
  12. if c.Addr == "" {
  13. c.Addr = ":18123"
  14. }
  15. return nil
  16. }