Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientNode ¶
type ClientNode struct {
Name string `json:"name" toml:"name"`
Scheme string `json:"schema" toml:"scheme"`
Address string `json:"address" toml:"address"`
Labels map[string]string `json:"labels" toml:"labels"`
Services map[string]*Service `json:"services" toml:"services"`
}
ClientNode ...
type GroupInfo ¶
type GroupInfo struct {
Name string `json:"name" toml:"name"`
Weight int `json:"weight" toml:"weight"`
}
GroupInfo ...
type Meta ¶
type Meta struct {
Info ServerNode `json:"info,omitempty" toml:"info"`
Config Config `json:"config" toml:"config"`
}
Meta ...
type ServerNode ¶
type ServerNode struct {
Name string `json:"name" toml:"name"`
Scheme string `json:"scheme" toml:"scheme"` // http | grpc
Address string `json:"address" toml:"address"`
Labels map[string]string `json:"labels" toml:"labels"` // 标签: group, weight, enable 等
Services map[string]*Service `json:"services" toml:"services"`
}
ServerNode ...
type Service ¶
type Service struct {
Namespace string `json:"namespace" toml:"namespace"`
Name string `json:"name" toml:"name"`
Labels map[string]string `json:"labels" toml:"labels"`
Methods []string `json:"methods" toml:"methods"`
}
一个Server可以实现多个Service接口
type ServiceInfo ¶
type ServiceInfo struct {
Env string `json:"env" toml:"env"`
IID string `json:"iid" toml:"iid"`
AppID string `json:"app_id" toml:"app_id"`
AppName string `json:"app_name" toml:"app_name"`
Hostname string `json:"hostname" toml:"hostname"`
Version string `json:"version" toml:"version"`
Schema string `json:"schema" toml:"schema"`
Address string `json:"address" toml:"address"`
Methods []string `json:"methods" toml:"methods"`
Name string `json:"name" toml:"name"`
// 服务元信息
ServiceMeta []map[string]string `json:"metadata" toml:"metadata"`
}
ServiceInfo represents a server the client connects to.
type ServiceMeta ¶
type ServiceMeta struct {
Op naming.Operation
Addr string
Metadata interface{}
Meta Meta `json:"meta" toml:"meta"`
}
ServiceMeta ...
type TrafficInfo ¶
type TrafficInfo struct {
Groups []GroupInfo `json:"groups" toml:"groups"`
Region RegionInfo `json:"region" toml:"region"`
Switch bool `json:"switch" toml:"switch"`
}
TrafficInfo ...
type WorkerNode ¶
type WorkerNode struct {
Name string `json:"name" toml:"name"`
Spec string `json:"spec" toml:"spec"`
}
WorkerNode ...
Click to show internal directories.
Click to hide internal directories.