cdn.go 5.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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" form:"serverNamesJSON"` // 域名列表 json:server_names
  42. HttpJSON byte `json:"httpJSON" form:"httpJSON"` // HTTP协议设置,当type为httpProxy或者httpWeb时填写 json:http_protocol
  43. HttpsJSON byte `json:"httpsJSON" form:"httpsJSON"` // HTTPS协议设置,当type为httpProxy或者httpWeb时填写 json:https_protocol
  44. TcpJSON byte `json:"tcpJSON" form:"tcpJSON"` // TCP协议设置,当type为tcpProxy时填写 json:tcp_protocol
  45. TlsJSON byte `json:"tlsJSON" form:"tlsJSON"` // TLS协议设置,当type为tcpProxy时填写 json:tls_protocol
  46. UdpJSON byte `json:"udpJSON" 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" 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. }
  59. type Listen struct {
  60. Protocol string `json:"protocol" form:"protocol"` // 协议类型:tcp、udp
  61. Host string `json:"host" form:"host"` // 监听地址
  62. Port int64 `json:"port" form:"port"` // 端口
  63. }
  64. type ProxyJson struct {
  65. ServerId int64 `json:"serverId" form:"serverId"` // 网站ID
  66. JSON byte `json:"JSON" form:"JSON"` // TCP协议设置
  67. }
  68. type Origin struct {
  69. OriginId int64 `json:"originId" form:"originId"`
  70. Name string `json:"name" form:"name"` // 源站名称
  71. Addr string `json:"addr" form:"addr"` // 源站地址
  72. OssJSON byte `json:"ossJSON" form:"ossJSON"` // Oss配置 json:oss_config
  73. Description string `json:"description" form:"description"` // 备注
  74. Weight int64 `json:"weight" form:"weight"` // 权重
  75. IsOn bool `json:"isOn" form:"isOn"` // 是否开启
  76. Domains []string `json:"domains" form:"domains"` // 域名
  77. CertRefJSON byte `json:"certRefJSON" form:"certRefJSON"` // 证书引用,可选项
  78. Host string `json:"host" form:"host"` // 回源主机域名,可选项
  79. FollowPort bool `json:"followPort" form:"followPort"` // 是否跟随端口,可选项
  80. Http2Enabled bool `json:"http2Enabled" form:"http2Enabled"` //可选项,是否支持HTTP/2,只在HTTPS源站时生效
  81. TlsSecurityVerifyMode string `json:"tlsSecurityVerifyMode" form:"tlsSecurityVerifyMode"` // // 安全校验模式:auto系统默认,force强校验,skip不校验
  82. }