webForwarding.go 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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,hostname_rfc1123|ip"`
  7. BackendList []BackendList `form:"backendList" json:"backendList" validate:"required,dive"`
  8. AllowIpList []string `form:"allowIpList" json:"allowIpList" validate:"dive,ip"`
  9. DenyIpList []string `form:"denyIpList" json:"denyIpList" validate:"dive,ip"`
  10. AccessRule string `form:"accessRule" json:"accessRule"`
  11. IsHttps int `form:"isHttps" json:"isHttps" default:"0"`
  12. Comment string `form:"comment" json:"comment" validate:"max=50"`
  13. HttpsCert string `form:"httpsCert" json:"httpsCert"`
  14. HttpsKey string `form:"httpsKey" json:"httpsKey"`
  15. SslCertId int64 `form:"sslCertId" json:"sslCertId"`
  16. }
  17. type DeleteWebForwardingRequest struct {
  18. Ids []int `form:"ids" json:"ids" validate:"required,min=1,dive,required"`
  19. Uid int `form:"uid" json:"uid" validate:"required"`
  20. HostId int `form:"hostId" json:"hostId" validate:"required"`
  21. }
  22. type WebForwardingRequest struct {
  23. HostId int `form:"hostId" json:"hostId" validate:"required"`
  24. Uid int `form:"uid" json:"uid" validate:"required"`
  25. WebForwardingData WebForwardingDataRequest `form:"data" json:"data" validate:"required"`
  26. }
  27. type BackendList struct {
  28. Addr string `json:"addr,omitempty" form:"addr" validate:"required,hostport"`
  29. CustomHost string `json:"customHost,omitempty" form:"customHost" validate:"omitempty,hostname_rfc1123"`
  30. IsHttps int `json:"isHttps,omitempty" form:"isHttps" default:"0"`
  31. }