Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultVersion = "v1.0.0"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ServiceMetadata ¶
type ServiceMetadata struct {
ServiceName string `json:"service_name"` // 服务名称
Version string `json:"version"` // 服务版本
Address string `json:"address"` // 服务地址
Env string `json:"env"` // 服务环境
Weight int `json:"weight"` // 服务权重,用于负载均衡
Tags []string `json:"tags"` // 服务标签
Status ServiceStatus `json:"status"` // 服务状态:up, down, starting, stopping
RegisterTime int64 `json:"register_time"` // 注册时间
InstanceID string `json:"instance_id"` // 服务实例ID
Properties map[string]string `json:"properties"` // 额外属性
}
ServiceMetadata 服务元数据
func (*ServiceMetadata) String ¶
func (s *ServiceMetadata) String() string
func (*ServiceMetadata) Unmarshal ¶
func (s *ServiceMetadata) Unmarshal(value []byte) error
type ServiceRegister ¶
type ServiceRegister interface {
RegisterMetadata() ServiceRegisterMetadata
UnsafeServiceRegister
}
type ServiceRegisterMetadata ¶
type ServiceStatus ¶
type ServiceStatus string
ServiceStatus 服务状态
const ( ServiceStatusUp ServiceStatus = "up" ServiceStatusDown ServiceStatus = "down" ServiceStatusStarting ServiceStatus = "starting" ServiceStatusStopping ServiceStatus = "stopping" )
type UnimplementedServiceRegister ¶
type UnimplementedServiceRegister struct{}
func (UnimplementedServiceRegister) RegisterMetadata ¶
func (UnimplementedServiceRegister) RegisterMetadata() ServiceRegisterMetadata
type UnsafeServiceRegister ¶
type UnsafeServiceRegister interface {
// contains filtered or unexported methods
}
Click to show internal directories.
Click to hide internal directories.