1
0

nginx.go 1015 B

12345678910111213141516171819202122232425262728
  1. package settings
  2. type Nginx struct {
  3. AccessLogPath string `json:"access_log_path" protected:"true"`
  4. ErrorLogPath string `json:"error_log_path" protected:"true"`
  5. LogDirWhiteList []string `json:"log_dir_white_list" protected:"true"`
  6. ConfigDir string `json:"config_dir" protected:"true"`
  7. ConfigPath string `json:"config_path" protected:"true"`
  8. PIDPath string `json:"pid_path" protected:"true"`
  9. TestConfigCmd string `json:"test_config_cmd" protected:"true"`
  10. ReloadCmd string `json:"reload_cmd" protected:"true"`
  11. RestartCmd string `json:"restart_cmd" protected:"true"`
  12. StubStatusPort uint `json:"stub_status_port" binding:"omitempty,min=1,max=65535"`
  13. ContainerName string `json:"container_name" protected:"true"`
  14. }
  15. var NginxSettings = &Nginx{}
  16. func (n *Nginx) GetStubStatusPort() uint {
  17. if n.StubStatusPort == 0 {
  18. return 51820
  19. }
  20. return n.StubStatusPort
  21. }
  22. func (n *Nginx) RunningInAnotherContainer() bool {
  23. return n.ContainerName != ""
  24. }