123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231 |
- package v1
- type User struct {
- ID int64 `json:"id" form:"id"`
- Username string `json:"username" form:"username"`
- Password string `json:"password" form:"password"`
- Fullname string `json:"fullname" form:"fullname"`
- Mobile string `json:"mobile" form:"mobile"`
- Tel string `json:"tel" form:"tel"`
- Email string `json:"email" form:"email"`
- Remark string `json:"remark" form:"remark"`
- Source string `json:"source" form:"source"` // 用户来源
- NodeClusterId int64 `json:"nodeClusterId" form:"nodeClusterId"` // 节点集群ID
- }
- type Group struct {
- Name string `json:"name" form:"name"`
- }
- type Plan struct {
- UserId int64 `json:"userId" form:"userId"`
- PlanId int64 `json:"planId" form:"planId"`
- DayTo string `json:"dayTo" form:"dayTo"` // 结束日期,格式:YYYY-MM-DD,适用于按带宽和流量计费的套餐
- Period string `json:"period" form:"period"` // 周期类型:yearly、seasonally、monthly,适用于按时间周期计费的套餐
- CountPeriod int64 `json:"countPeriod" form:"countPeriod"` // 周期数量,适用于带宽和流量计费
- Name string `json:"name" form:"name"` // 备注名称
- IsFree bool `json:"isFree" form:"isFree"` // 可选项,是否免费
- PeriodDayTo string `json:"periodDayTo" form:"periodDayTo"` // 可选项, 按周期计费的套餐结束日期
- }
- type RenewalPlan struct {
- UserPlanId int64 `json:"userPlanId" form:"userPlanId"`
- DayTo string `json:"dayTo" form:"dayTo"` // 结束日期,格式:YYYY-MM-DD,适用于按带宽和流量计费的套餐
- Period string `json:"period" form:"period"` // 周期类型:yearly、seasonally、monthly,适用于按时间周期计费的套餐
- CountPeriod int64 `json:"countPeriod" form:"countPeriod"` // 周期数量,适用于带宽和流量计费
- IsFree bool `json:"isFree" form:"isFree"` // 可选项,是否免费
- PeriodDayTo string `json:"periodDayTo" form:"periodDayTo"` // 可选项, 按周期计费的套餐结束日期
- }
- type Website struct {
- UserId int64 `json:"userId" form:"userId"` //可选项,用户ID,如果不想指定用户,此值可以为0
- AdminId int64 `json:"adminId" form:"adminId"` //可选项,管理员ID
- Type string `json:"type" form:"type"` // 类型:httpProxy(HTTP反向代理,一般CDN服务都选这个)、httpWeb(静态文件服务,只会从服务器上读取文件内容,不会转发到源站)、tcpProxy(TCP反向代理)、udpProxy(UDP反向代理)
- Name string `json:"name" form:"name"` // 网站名称
- Description string `json:"description" form:"description"` // 可选项,网站描述
- ServerNamesJSON []byte `json:"serverNamesJSON,omitempty" form:"serverNamesJSON"` // 域名列表 json:server_names
- HttpJSON TypeJSON `json:"httpJSON,omitempty" form:"httpJSON"` // HTTP协议设置,当type为httpProxy或者httpWeb时填写 json:http_protocol
- HttpsJSON TypeJSON `json:"httpsJSON,omitempty" form:"httpsJSON"` // HTTPS协议设置,当type为httpProxy或者httpWeb时填写 json:https_protocol
- TcpJSON []byte `json:"tcpJSON,omitempty" form:"tcpJSON"` // TCP协议设置,当type为tcpProxy时填写 json:tcp_protocol
- TlsJSON []byte `json:"tlsJSON,omitempty" form:"tlsJSON"` // TLS协议设置,当type为tcpProxy时填写 json:tls_protocol
- UdpJSON []byte `json:"udpJSON,omitempty" form:"udpJSON"` // UDP协议设置,当type为udpProxy时填写 json:udp_protocol
- WebId int64 `json:"webId" form:"webId"` // 可选项,Web配置ID,当type为httpProxy或者httpWeb时填写,可以通过 /HTTPWebService/createHTTPWeb 接口创建;如果你需要配置缓存等信息时需要在 HTTPWebService 接口操作=
- ReverseProxyJSON []byte `json:"reverseProxyJSON,omitempty" form:"reverseProxyJSON"` // 反向代理(包含源站)配置引用,此项可以在创建网站后再设置 json:reverse_proxy_ref
- ServerGroupIds []int64 `json:"serverGroupIds" form:"serverGroupIds"` // 可选项,所属网站分组ID列表
- UserPlanId int64 `json:"userPlanId" form:"userPlanId"` // 可选项,套餐ID
- NodeClusterId int64 `json:"nodeClusterId" form:"nodeClusterId"` // 所部署的集群ID
- IncludeNodesJSON string `json:"includeNodesJSON" form:"includeNodesJSON"` // 备用参数,不用填写
- ExcludeNodesJSON string `json:"excludeNodesJSON" form:"excludeNodesJSON"` // 备用参数,不用填写
- }
- type WebsiteSend struct {
- UserId int64 `json:"userId" form:"userId"` //可选项,用户ID,如果不想指定用户,此值可以为0
- AdminId int64 `json:"adminId" form:"adminId"` //可选项,管理员ID
- Type string `json:"type" form:"type"` // 类型:httpProxy(HTTP反向代理,一般CDN服务都选这个)、httpWeb(静态文件服务,只会从服务器上读取文件内容,不会转发到源站)、tcpProxy(TCP反向代理)、udpProxy(UDP反向代理)
- Name string `json:"name" form:"name"` // 网站名称
- Description string `json:"description" form:"description"` // 可选项,网站描述
- ServerNamesJSON []byte `json:"serverNamesJSON,omitempty" form:"serverNamesJSON"` // 域名列表 json:server_names
- HttpJSON []byte `json:"httpJSON,omitempty" form:"httpJSON"` // HTTP协议设置,当type为httpProxy或者httpWeb时填写 json:http_protocol
- HttpsJSON []byte `json:"httpsJSON,omitempty" form:"httpsJSON"` // HTTPS协议设置,当type为httpProxy或者httpWeb时填写 json:https_protocol
- TcpJSON []byte `json:"tcpJSON,omitempty" form:"tcpJSON"` // TCP协议设置,当type为tcpProxy时填写 json:tcp_protocol
- TlsJSON []byte `json:"tlsJSON,omitempty" form:"tlsJSON"` // TLS协议设置,当type为tcpProxy时填写 json:tls_protocol
- UdpJSON []byte `json:"udpJSON,omitempty" form:"udpJSON"` // UDP协议设置,当type为udpProxy时填写 json:udp_protocol
- WebId int64 `json:"webId" form:"webId"` // 可选项,Web配置ID,当type为httpProxy或者httpWeb时填写,可以通过 /HTTPWebService/createHTTPWeb 接口创建;如果你需要配置缓存等信息时需要在 HTTPWebService 接口操作=
- ReverseProxyJSON []byte `json:"reverseProxyJSON,omitempty" form:"reverseProxyJSON"` // 反向代理(包含源站)配置引用,此项可以在创建网站后再设置 json:reverse_proxy_ref
- ServerGroupIds []int64 `json:"serverGroupIds" form:"serverGroupIds"` // 可选项,所属网站分组ID列表
- UserPlanId int64 `json:"userPlanId" form:"userPlanId"` // 可选项,套餐ID
- NodeClusterId int64 `json:"nodeClusterId" form:"nodeClusterId"` // 所部署的集群ID
- IncludeNodesJSON string `json:"includeNodesJSON" form:"includeNodesJSON"` // 备用参数,不用填写
- ExcludeNodesJSON string `json:"excludeNodesJSON" form:"excludeNodesJSON"` // 备用参数,不用填写
- }
- type TypeJSON struct {
- IsOn bool `json:"isOn" form:"isOn"` // 是否开启
- Listen []Listen `json:"listen" form:"listen"` // 监听端口
- SslPolicyRef SslPolicyRef `json:"sslPolicyRef" form:"sslPolicyRef"` // SSL策略
- }
- type Listen struct {
- Protocol string `json:"protocol" form:"protocol"` // 协议类型:tcp、udp
- Host string `json:"host" form:"host"` // 监听地址
- Port string `json:"portRange" form:"portRange"` // 端口
- }
- type SslPolicyRef struct {
- IsOn bool `json:"isOn" form:"isOn"` // 是否开启 isOn
- SslPolicyId int64 `json:"sslPolicyId" form:"sslPolicyId"` // SSL策略ID
- }
- type EditWebsite struct {
- Id int64 `json:"id" form:"id"`
- TypeJSON []byte `json:"typeJSON" form:"typeJSON"`
- }
- type ProxyJson struct {
- ServerId int64 `json:"serverId" form:"serverId"` // 网站ID
- JSON byte `json:"JSON" form:"JSON"` // TCP协议设置
- }
- type Origin struct {
- OriginId int64 `json:"originId" form:"originId"`
- Name string `json:"name" form:"name"` // 源站名称
- Addr Addr `json:"addr" form:"addr"` // 源站地址
- OssJSON []byte `json:"ossJSON" form:"ossJSON"` // Oss配置 json:oss_config
- Description string `json:"description" form:"description"` // 备注
- Weight int64 `json:"weight" form:"weight"` // 权重
- IsOn bool `json:"isOn" form:"isOn"` // 是否开启
- Domains []string `json:"domains" form:"domains"` // 域名
- CertRefJSON []byte `json:"certRefJSON" form:"certRefJSON"` // 证书引用,可选项
- Host string `json:"host" form:"host"` // 回源主机域名,可选项
- FollowPort bool `json:"followPort" form:"followPort"` // 是否跟随端口,可选项
- Http2Enabled bool `json:"http2Enabled" form:"http2Enabled"` //可选项,是否支持HTTP/2,只在HTTPS源站时生效
- TlsSecurityVerifyMode string `json:"tlsSecurityVerifyMode" form:"tlsSecurityVerifyMode"` // // 安全校验模式:auto系统默认,force强校验,skip不校验
- }
- type Addr struct {
- Protocol string `json:"protocol" form:"protocol"` // 协议类型:tcp、udp
- Host string `json:"host" form:"host"` // 监听地址
- Port string `json:"portRange" form:"portRange"` // 端口
- }
- type SSlCert struct {
- SslCertId int64 `json:"sslCertId" form:"sslCertId"`
- IsOn bool `json:"isOn" form:"isOn"` //是否开启
- UserId int64 `json:"userId" form:"userId"` //用户id
- Name string `json:"name" form:"name"` //证书名称
- Description string `json:"description" form:"description"` //证书描述
- ServerName string `json:"serverName" form:"serverName"` //证书绑定的域名
- IsCA bool `json:"isCA" form:"isCA"` //是否是CA证书
- CertData []byte `json:"certData" form:"certData"` //证书内容
- KeyData []byte `json:"keyData" form:"keyData"` //证书内容
- TimeBeginAt int64 `json:"timeBeginAt" form:"timeBeginAt"` //证书生效时间
- TimeEndAt int64 `json:"timeEndAt" form:"timeEndAt"` //证书失效时间
- DnsNames []string `json:"dnsNames" form:"dnsNames"` // 包含的DNS域名
- CommonNames []string `json:"commonNames" form:"commonNames"` // 包含的COMMON域名
- IsSelfSigned bool `json:"isSelfSigned" form:"isSelfSigned"` //是否是自签名证书
- }
- type EditServerNames struct {
- ServerId int64 `json:"serverId" form:"serverId"`
- ServerNamesJSON []byte `json:"serverNamesJSON" form:"serverNamesJSON"`
- }
- type AddSSLPolicy struct {
- Http2Enabled bool `json:"http2Enabled" form:"http2Enabled"` //是否支持HTTP/2
- Http3Enabled bool `json:"http3Enabled" form:"http3Enabled"` //是否支持Http3Enabled
- MinVersion string `json:"minVersion" form:"minVersion"` //最小TLS版本
- SslCertsJSON []byte `json:"sslCertsJSON" form:"sslCertsJSON"` //SslCertsJSON
- HstsJSON []byte `json:"hstsJSON" form:"hstsJSON"` //HstsJSON
- ClientAuthType int32 `json:"clientAuthType" form:"clientAuthType"` //可选项,客户端校验类型:0 无需证书,1 需要客户端证书,2 需要任一客户端证书,3 如果客户端上传了证书才校验,4 需要客户端证书而且需要校验
- CipherSuites []string `json:"cipherSuites" form:"cipherSuites"` //可选项,支持的TLS加密套件
- CipherSuitesIsOn bool `json:"cipherSuitesIsOn" form:"cipherSuitesIsOn"` //可选项,是否启用自定义加密套件
- OcspIsOn bool `json:"ocspIsOn" form:"ocspIsOn"` //可选项,是否开启OCSP
- }
- type SSLPolicy struct {
- SslPolicyId int64 `json:"sslPolicyId" form:"sslPolicyId"`
- Http2Enabled bool `json:"http2Enabled" form:"http2Enabled"` //是否支持HTTP/2
- Http3Enabled bool `json:"http3Enabled" form:"http3Enabled"` //是否支持Http3Enabled
- MinVersion string `json:"minVersion" form:"minVersion"` //最小TLS版本
- SslCertsJSON []byte `json:"sslCertsJSON" form:"sslCertsJSON"` //SslCertsJSON
- HstsJSON []byte `json:"hstsJSON" form:"hstsJSON"` //HstsJSON
- ClientAuthType int32 `json:"clientAuthType" form:"clientAuthType"` //可选项,客户端校验类型:0 无需证书,1 需要客户端证书,2 需要任一客户端证书,3 如果客户端上传了证书才校验,4 需要客户端证书而且需要校验
- CipherSuites []string `json:"cipherSuites" form:"cipherSuites"` //可选项,支持的TLS加密套件
- CipherSuitesIsOn bool `json:"cipherSuitesIsOn" form:"cipherSuitesIsOn"` //可选项,是否启用自定义加密套件
- OcspIsOn bool `json:"ocspIsOn" form:"ocspIsOn"` //可选项,是否开启OCSP
- }
- type SslCertsJSON struct {
- IsOn bool `json:"isOn" form:"isOn"`
- CertId int64 `json:"certId" form:"certId"`
- }
- type WebLog struct {
- IsPrior bool `json:"isPrior" form:"isPrior"`
- IsOn bool `json:"isOn" form:"isOn"`
- Fields []int64
- Status1 bool `json:"status1" form:"status1"`
- Status2 bool `json:"status2" form:"status2"`
- Status3 bool `json:"status3" form:"status3"`
- Status4 bool `json:"status4" form:"status4"`
- Status5 bool `json:"status5" form:"status5"`
- EnableClientClosed bool `json:"enableClientClosed" form:"enableClientClosed"`
- FirewallOnly bool `json:"firewallOnly" form:"firewallOnly"`
- }
- type CcConfig struct {
- IsOn bool `json:"isOn"`
- Level string `json:"level"`
- Action string `json:"action"`
- IsPrior bool `json:"isPrior"`
- Thresholds []struct {
- MaxRequests int `json:"maxRequests"`
- BlockSeconds int `json:"blockSeconds"`
- PeriodSeconds int `json:"periodSeconds"`
- } `json:"thresholds"`
- MinQPSPerIP int `json:"minQPSPerIP"`
- EnableGET302 bool `json:"enableGET302"`
- OnlyURLPatterns []interface{} `json:"onlyURLPatterns"`
- ThresholdMethod string `json:"thresholdMethod"`
- WithRequestPath bool `json:"withRequestPath"`
- EnableFingerprint bool `json:"enableFingerprint"`
- ExceptURLPatterns []interface{} `json:"exceptURLPatterns"`
- IgnoreCommonFiles bool `json:"ignoreCommonFiles"`
- IgnoreCommonAgents bool `json:"ignoreCommonAgents"`
- UseDefaultThresholds bool `json:"useDefaultThresholds"`
- }
- type WebSocket struct {
- WebsocketId int64 `json:"websocketId" form:"websocketId"`
- HandshakeTimeoutJSON []byte `json:"handshakeTimeoutJSON" form:"handshakeTimeoutJSON"`
- AllowAllOrigins bool `json:"allowAllOrigins" form:"allowAllOrigins"`
- AllowedOrigins []string `json:"allowedOrigins" form:"allowedOrigins"`
- RequestSameOrigin bool `json:"requestSameOrigin" form:"requestSameOrigin"`
- RequestOrigin string `json:"requestOrigin" form:"requestOrigin"`
- }
- type HandshakeTimeoutJSON struct {
- Unit string `json:"unit" form:"unit"`
- Count int `json:"count" form:"count"`
- }
|