protocol

package
v0.0.0-...-03aceed Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

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 NewExchanger(masterHost string, namespaceId string) *Exchanger

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 WorkerBaseResponse struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

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 WorkerDataBase struct {
	DataId      string `json:"data_id"`
	NamespaceId string `json:"namespace_id"`
}

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"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL