nginx.go 1.1 KB

1234567891011121314151617181920212223242526272829
  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. SbinPath string `json:"sbin_path" protected:"true"`
  10. TestConfigCmd string `json:"test_config_cmd" protected:"true"`
  11. ReloadCmd string `json:"reload_cmd" protected:"true"`
  12. RestartCmd string `json:"restart_cmd" protected:"true"`
  13. StubStatusPort uint `json:"stub_status_port" binding:"omitempty,min=1,max=65535"`
  14. ContainerName string `json:"container_name" protected:"true"`
  15. }
  16. var NginxSettings = &Nginx{}
  17. func (n *Nginx) GetStubStatusPort() uint {
  18. if n.StubStatusPort == 0 {
  19. return 51820
  20. }
  21. return n.StubStatusPort
  22. }
  23. func (n *Nginx) RunningInAnotherContainer() bool {
  24. return n.ContainerName != ""
  25. }