Documentation ¶
Index ¶
- type Exchanger
- type WorkerBaseRequest
- type WorkerBaseResponse
- type WorkerDataActionBackend
- type WorkerDataActionBackendNode
- type WorkerDataActionStatic
- type WorkerDataBase
- type WorkerDataNamespaceDataContent
- type WorkerDataSite
- type WorkerDataSiteRule
- type WorkerFetchConfigRequest
- type WorkerFetchConfigResponse
- type WorkerGetTokenRequest
- type WorkerGetTokenResponse
- type WorkerQueryConfigRequest
- type WorkerQueryConfigResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Exchanger ¶
type Exchanger struct {
// contains filtered or unexported fields
}
func NewExchanger ¶
func (*Exchanger) FetchConfig ¶
func (this *Exchanger) FetchConfig(token string, configVer string) WorkerFetchConfigResponse
func (*Exchanger) GetToken ¶
func (this *Exchanger) GetToken() WorkerGetTokenResponse
func (*Exchanger) QueryConfig ¶
func (this *Exchanger) QueryConfig(token string) WorkerQueryConfigResponse
type WorkerBaseRequest ¶
type WorkerBaseRequest struct {
Token string `json:"token"`
}
type WorkerBaseResponse ¶
type WorkerDataActionBackend ¶
type WorkerDataActionBackend struct { WorkerDataBase BalanceType string `json:"balance_type"` }
type WorkerDataActionBackendNode ¶
type WorkerDataActionBackendNode struct { WorkerDataBase BackendId string `json:"backend_id"` ServerHost string `json:"server_host"` ServerPort int `json:"server_port"` WeightScore int `json:"weight_score"` }
type WorkerDataActionStatic ¶
type WorkerDataActionStatic struct { WorkerDataBase ContentType string `json:"content_type"` DataType string `json:"data_type"` Data string `json:"data"` }
type WorkerDataBase ¶
type WorkerDataNamespaceDataContent ¶
type WorkerDataNamespaceDataContent struct { ActionBackendInfo []WorkerDataActionBackend `json:"action_backend_info"` ActionBackendNodeInfo []WorkerDataActionBackendNode `json:"action_backend_node_info"` ActionStaticInfo []WorkerDataActionStatic `json:"action_static_info"` SiteInfo []WorkerDataSite `json:"site_info"` SiteRuleInfo []WorkerDataSiteRule `json:"site_rule_info"` }
type WorkerDataSite ¶
type WorkerDataSite struct { WorkerDataBase OrderNo int `bson:"order_no" json:"order_no"` AuthNeed string `json:"auth_need"` AuthUserName string `json:"auth_user_name"` AuthPassword string `json:"auth_password"` MatchOp string `json:"match_op"` MatchValue string `json:"match_value"` ActionType string `json:"action_type"` ActionValue string `json:"action_value"` }
type WorkerDataSiteRule ¶
type WorkerDataSiteRule struct { WorkerDataBase SiteId string `json:"site_id" index:"site_id"` OrderNo int `json:"order_no" index:"order_no"` HttpMethod string `json:"http_method"` MatchTarget string `json:"match_target"` MatchOp string `json:"match_op"` MatchValue string `json:"match_value"` ActionType string `json:"action_type"` ActionValue string `json:"action_value"` }
type WorkerFetchConfigRequest ¶
type WorkerFetchConfigRequest struct { WorkerBaseRequest ConfigVersion string `json:"config_version"` }
获取配置
type WorkerFetchConfigResponse ¶
type WorkerFetchConfigResponse struct { WorkerBaseResponse Data WorkerDataNamespaceDataContent `json:"data"` }
type WorkerGetTokenRequest ¶
type WorkerGetTokenRequest struct { NodeName string `json:"node_name"` NodeOs string `json:"node_os"` NodeArch string `json:"node_arch"` NodeUserName string `json:"node_user_name"` }
获取token
type WorkerGetTokenResponse ¶
type WorkerGetTokenResponse struct { WorkerBaseResponse Data string `json:"data"` }
type WorkerQueryConfigRequest ¶
type WorkerQueryConfigRequest struct { WorkerBaseRequest NodeCpuCore int `json:"node_cpu_core"` NodeCpuUsed float64 `json:"node_cpu_used"` NodeMemTotal uint64 `json:"node_mem_total"` NodeMemUsed uint64 `json:"node_mem_used"` }
查询配置
type WorkerQueryConfigResponse ¶
type WorkerQueryConfigResponse struct { WorkerBaseResponse Data string `json:"data"` }
Click to show internal directories.
Click to hide internal directories.