Documentation
¶
Index ¶
Constants ¶
View Source
const ( StatusUp = 0 StatusDown = 1 GroupID = "TSF_GROUP_ID" NamespaceID = "TSF_NAMESPACE_ID" ApplicationID = "TSF_APPLICATION_ID" Region = "TSF_REGION" NsLocal = "local" NsGlobal = "global" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Instance ¶
type Instance struct {
// 服务信息
Service *Service `json:"service,omitempty"`
// namespace下全局唯一的实例ID
ID string `json:"id"`
// 服务实例所属地域
Region string `json:"region"`
// 服务实例可访问的ip地址
Host string `json:"host"`
// 协议端口
Port int `json:"port"`
// 服务实例标签元信息,比如appVersion、group、weight等
Metadata map[string]string `json:"metadata"`
// 实例运行状态: up/down
Status int64 `json:"status"`
// 过滤用的标签
Tags []string `json:"tags"`
}
Instance 服务实例信息
func FromKratosInstance ¶
func FromKratosInstance(ki *registry.ServiceInstance) (inss []*Instance)
func (Instance) ToKratosInstance ¶
func (i Instance) ToKratosInstance() *registry.ServiceInstance
Click to show internal directories.
Click to hide internal directories.