yamldef.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. package main
  2. type ConfigYAML struct {
  3. Frontend FrontendYAML `yaml:"frontend"`
  4. Backend BackendYAML `yaml:"backend"`
  5. }
  6. type FrontendYAML struct {
  7. Enable bool `yaml:"enable"`
  8. EntryPoint string `yaml:"entry"`
  9. ListenAddr string `yaml:"listen"`
  10. WWWRoot string `yaml:"wwwroot"`
  11. BackendProxy BackendProxyYAML `yaml:"backend_proxy"`
  12. ShellLog LumberjackLoggerYAML `yaml:"shell_log"`
  13. }
  14. type BackendYAML struct {
  15. Enable bool `yaml:"enable"`
  16. EntryPoint string `yaml:"entry"`
  17. ListenAddr string `yaml:"listen"`
  18. ShellLog LumberjackLoggerYAML `yaml:"shell_log"`
  19. }
  20. type BackendProxyYAML struct {
  21. Prefix string `yaml:"prefix"`
  22. ProxyTaret string `yaml:"target"`
  23. }
  24. type LumberjackLoggerYAML struct {
  25. FileName string `yaml:"file"`
  26. MaxSize int `yaml:"max_size"`
  27. MaxAge int `yaml:"max_age"`
  28. MaxBackups int `yaml:"max_backups"`
  29. UseLocalTime bool `yaml:"use_local_time"`
  30. Compress bool `yaml:"compress_history"`
  31. }