webForwarding.go 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package v1
  2. type WebForwardingDataRequest struct {
  3. Id int `form:"id" json:"id"`
  4. CdnWebId int `form:"cdnWebId" json:"cdnWebId"`
  5. Port string `form:"port" json:"port" validate:"required,numeric,min=1,max=65535"`
  6. Domain string `form:"domain" json:"domain" validate:"omitempty,idn_fqdn|ip"`
  7. BackendList []BackendList `form:"backendList" json:"backendList" validate:"required,dive"`
  8. IsHttps int `form:"isHttps" json:"isHttps" default:"0"`
  9. Comment string `form:"comment" json:"comment" validate:"max=50"`
  10. HttpsCert string `form:"httpsCert" json:"httpsCert"`
  11. HttpsKey string `form:"httpsKey" json:"httpsKey"`
  12. SslCertId int64 `form:"sslCertId" json:"sslCertId"`
  13. Proxy bool `form:"proxy" json:"proxy" default:"false"`
  14. }
  15. type DeleteWebForwardingRequest struct {
  16. Ids []int `form:"ids" json:"ids" validate:"required,min=1,dive,required"`
  17. Uid int `form:"uid" json:"uid" validate:"required"`
  18. HostId int `form:"hostId" json:"hostId" validate:"required"`
  19. }
  20. type WebForwardingRequest struct {
  21. HostId int `form:"hostId" json:"hostId" validate:"required"`
  22. Uid int `form:"uid" json:"uid" validate:"required"`
  23. WebForwardingData WebForwardingDataRequest `form:"data" json:"data" validate:"required"`
  24. }
  25. type BackendList struct {
  26. Addr string `json:"addr,omitempty" form:"addr" validate:"required,hostport"`
  27. CustomHost string `json:"customHost,omitempty" form:"customHost" validate:"omitempty,idn_fqdn"`
  28. IsHttps int `json:"isHttps,omitempty" form:"isHttps" default:"0"`
  29. }