cdn.go 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. package v1
  2. type User struct {
  3. ID int64 `json:"id" form:"id"`
  4. Username string `json:"username" form:"username"`
  5. Password string `json:"password" form:"password"`
  6. Fullname string `json:"fullname" form:"fullname"`
  7. Mobile string `json:"mobile" form:"mobile"`
  8. Tel string `json:"tel" form:"tel"`
  9. Email string `json:"email" form:"email"`
  10. Remark string `json:"remark" form:"remark"`
  11. Source string `json:"source" form:"source"` // 用户来源
  12. NodeClusterId int64 `json:"nodeClusterId" form:"nodeClusterId"` // 节点集群ID
  13. }
  14. type Group struct {
  15. Name string `json:"name" form:"name"`
  16. }
  17. type Plan struct {
  18. UserId int64 `json:"userId" form:"userId"`
  19. PlanId int64 `json:"planId" form:"planId"`
  20. DayTo string `json:"dayTo" form:"dayTo"` // 结束日期,格式:YYYY-MM-DD,适用于按带宽和流量计费的套餐
  21. Period string `json:"period" form:"period"` // 周期类型:yearly、seasonally、monthly,适用于按时间周期计费的套餐
  22. CountPeriod int64 `json:"countPeriod" form:"countPeriod"` // 周期数量,适用于带宽和流量计费
  23. Name string `json:"name" form:"name"` // 备注名称
  24. IsFree bool `json:"isFree" form:"isFree"` // 可选项,是否免费
  25. PeriodDayTo string `json:"periodDayTo" form:"periodDayTo"` // 可选项, 按周期计费的套餐结束日期
  26. }
  27. type RenewalPlan struct {
  28. UserPlanId int64 `json:"userPlanId" form:"userPlanId"`
  29. DayTo string `json:"dayTo" form:"dayTo"` // 结束日期,格式:YYYY-MM-DD,适用于按带宽和流量计费的套餐
  30. Period string `json:"period" form:"period"` // 周期类型:yearly、seasonally、monthly,适用于按时间周期计费的套餐
  31. CountPeriod int64 `json:"countPeriod" form:"countPeriod"` // 周期数量,适用于带宽和流量计费
  32. IsFree bool `json:"isFree" form:"isFree"` // 可选项,是否免费
  33. PeriodDayTo string `json:"periodDayTo" form:"periodDayTo"` // 可选项, 按周期计费的套餐结束日期
  34. }
  35. type Website struct {
  36. UserId int64 `json:"userId" form:"userId"` //可选项,用户ID,如果不想指定用户,此值可以为0
  37. AdminId int64 `json:"adminId" form:"adminId"` //可选项,管理员ID
  38. Type string `json:"type" form:"type"` // 类型:httpProxy(HTTP反向代理,一般CDN服务都选这个)、httpWeb(静态文件服务,只会从服务器上读取文件内容,不会转发到源站)、tcpProxy(TCP反向代理)、udpProxy(UDP反向代理)
  39. Name string `json:"name" form:"name"` // 网站名称
  40. Description string `json:"description" form:"description"` // 可选项,网站描述
  41. ServerNamesJSON []byte `json:"serverNamesJSON,omitempty" form:"serverNamesJSON"` // 域名列表 json:server_names
  42. HttpJSON []byte `json:"httpJSON,omitempty" form:"httpJSON"` // HTTP协议设置,当type为httpProxy或者httpWeb时填写 json:http_protocol
  43. HttpsJSON []byte `json:"httpsJSON,omitempty" form:"httpsJSON"` // HTTPS协议设置,当type为httpProxy或者httpWeb时填写 json:https_protocol
  44. TcpJSON []byte `json:"tcpJSON,omitempty" form:"tcpJSON"` // TCP协议设置,当type为tcpProxy时填写 json:tcp_protocol
  45. TlsJSON []byte `json:"tlsJSON,omitempty" form:"tlsJSON"` // TLS协议设置,当type为tcpProxy时填写 json:tls_protocol
  46. UdpJSON []byte `json:"udpJSON,omitempty" form:"udpJSON"` // UDP协议设置,当type为udpProxy时填写 json:udp_protocol
  47. WebId int64 `json:"webId" form:"webId"` // 可选项,Web配置ID,当type为httpProxy或者httpWeb时填写,可以通过 /HTTPWebService/createHTTPWeb 接口创建;如果你需要配置缓存等信息时需要在 HTTPWebService 接口操作=
  48. ReverseProxyJSON []byte `json:"reverseProxyJSON,omitempty" form:"reverseProxyJSON"` // 反向代理(包含源站)配置引用,此项可以在创建网站后再设置 json:reverse_proxy_ref
  49. ServerGroupIds []int64 `json:"serverGroupIds" form:"serverGroupIds"` // 可选项,所属网站分组ID列表
  50. UserPlanId int64 `json:"userPlanId" form:"userPlanId"` // 可选项,套餐ID
  51. NodeClusterId int64 `json:"nodeClusterId" form:"nodeClusterId"` // 所部署的集群ID
  52. IncludeNodesJSON string `json:"includeNodesJSON" form:"includeNodesJSON"` // 备用参数,不用填写
  53. ExcludeNodesJSON string `json:"excludeNodesJSON" form:"excludeNodesJSON"` // 备用参数,不用填写
  54. }
  55. type TypeJSON struct {
  56. IsOn bool `json:"isOn" form:"isOn"` // 是否开启
  57. Listen []Listen `json:"listen" form:"listen"` // 监听端口
  58. SslPolicyRef SslPolicyRef `json:"sslPolicyRef" form:"sslPolicyRef"` // SSL策略
  59. }
  60. type Listen struct {
  61. Protocol string `json:"protocol" form:"protocol"` // 协议类型:tcp、udp
  62. Host string `json:"host" form:"host"` // 监听地址
  63. Port string `json:"portRange" form:"portRange"` // 端口
  64. }
  65. type SslPolicyRef struct {
  66. IsOn bool `json:"isOn" form:"isOn"` // 是否开启 isOn
  67. SslPolicyId int64 `json:"sslPolicyId" form:"sslPolicyId"` // SSL策略ID
  68. }
  69. type EditWebsite struct {
  70. Id int64 `json:"id" form:"id"`
  71. TypeJSON []byte `json:"typeJSON" form:"typeJSON"`
  72. }
  73. type ProxyJson struct {
  74. ServerId int64 `json:"serverId" form:"serverId"` // 网站ID
  75. JSON byte `json:"JSON" form:"JSON"` // TCP协议设置
  76. }
  77. type Origin struct {
  78. OriginId int64 `json:"originId" form:"originId"`
  79. Name string `json:"name" form:"name"` // 源站名称
  80. Addr Addr `json:"addr" form:"addr"` // 源站地址
  81. OssJSON []byte `json:"ossJSON" form:"ossJSON"` // Oss配置 json:oss_config
  82. Description string `json:"description" form:"description"` // 备注
  83. Weight int64 `json:"weight" form:"weight"` // 权重
  84. IsOn bool `json:"isOn" form:"isOn"` // 是否开启
  85. Domains []string `json:"domains" form:"domains"` // 域名
  86. CertRefJSON []byte `json:"certRefJSON" form:"certRefJSON"` // 证书引用,可选项
  87. Host string `json:"host" form:"host"` // 回源主机域名,可选项
  88. FollowPort bool `json:"followPort" form:"followPort"` // 是否跟随端口,可选项
  89. Http2Enabled bool `json:"http2Enabled" form:"http2Enabled"` //可选项,是否支持HTTP/2,只在HTTPS源站时生效
  90. TlsSecurityVerifyMode string `json:"tlsSecurityVerifyMode" form:"tlsSecurityVerifyMode"` // // 安全校验模式:auto系统默认,force强校验,skip不校验
  91. }
  92. type Addr struct {
  93. Protocol string `json:"protocol" form:"protocol"` // 协议类型:tcp、udp
  94. Host string `json:"host" form:"host"` // 监听地址
  95. Port string `json:"portRange" form:"portRange"` // 端口
  96. }
  97. type SSlCert struct {
  98. IsOn bool `json:"isOn" form:"isOn"` //是否开启
  99. UserId int64 `json:"userId" form:"userId"` //用户id
  100. Name string `json:"name" form:"name"` //证书名称
  101. Description string `json:"description" form:"description"` //证书描述
  102. IsCA bool `json:"isCA" form:"isCA"` //是否是CA证书
  103. CertData []byte `json:"certData" form:"certData"` //证书内容
  104. KeyData []byte `json:"keyData" form:"keyData"` //证书内容
  105. TimeBeginAt int64 `json:"timeBeginAt" form:"timeBeginAt"` //证书生效时间
  106. TimeEndAt int64 `json:"timeEndAt" form:"timeEndAt"` //证书失效时间
  107. DnsNames []string `json:"dnsNames" form:"dnsNames"` // 包含的DNS域名
  108. CommonNames []string `json:"commonNames" form:"commonNames"` // 包含的COMMON域名
  109. IsSelfSigned bool `json:"isSelfSigned" form:"isSelfSigned"` //是否是自签名证书
  110. }
  111. type EditServerNames struct {
  112. ServerId int64 `json:"serverId" form:"serverId"`
  113. ServerNamesJSON []byte `json:"serverNamesJSON" form:"serverNamesJSON"`
  114. }