Documentation
¶
Index ¶
Constants ¶
View Source
const ( MetaWeight = "weight" MetaCluster = "cluster" MetaZone = "zone" MetaColor = "color" )
metadata common key
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Registry ¶
type Registry interface {
Register(ctx context.Context, info *ServiceInfo) error
DeRegister(ctx context.Context, info *ServiceInfo) error
List(ctx context.Context, name string, scheme string) (services []*ServiceInfo, err error)
Close()
}
type ServiceInfo ¶
type ServiceInfo struct {
// Service Name
Name string `json:"name"`
// Service Scheme, http/grpc
Scheme string `json:"schema"`
// Service Addr
Addr string `json:"addr"`
// Metadata is the information associated with Addr, which may be used
// to make load balancing decision
Metadata map[string]string `json:"metadata"`
// Region is region
Region string `json:"region"`
// Zone is IDC
Zone string `json:"zone"`
// prod/pre/test/dev
Env string `json:"env"`
// Service Version
Version string `json:"version"`
}
ServiceInfo service metadata definition
Click to show internal directories.
Click to hide internal directories.