Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterImplementor ¶
func RegisterImplementor(svc Discovery)
RegisterImplementor registers the discovery service implementor.
func StreamServerInterceptor ¶
func StreamServerInterceptor() grpc.StreamServerInterceptor
StreamServerInterceptor returns a new streaming server interceptor for service discovery.
func UnaryServerInterceptor ¶
func UnaryServerInterceptor() grpc.UnaryServerInterceptor
UnaryServerInterceptor returns a new unary server interceptor for service discovery.
Types ¶
type Discovery ¶
type Discovery interface {
// RegisteredNode returns service unique ID and rpc address registered for the component.
RegisteredNode(component string) (int64, string)
// RegisterNode registers rpc address of the component node.
RegisterNode(component, rpcAddr string, rpcSvc []string, ttl time.Duration) (int64, error)
// GetNodes returns rpc service nodes.
GetNodes(svc string) map[string]int
}
func ContextDiscovery ¶
func Implementor ¶
func Implementor() Discovery
Implementor returns the discovery service implementor.
Click to show internal directories.
Click to hide internal directories.