Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetResolver ¶
func GetResolver(consul coordinator.Coordinator, service, tag string, log *logger.Logger) (naming.Resolver, error)
GetResolver returns a Resolver
func NewBalancer ¶
func NewBalancer(consul coordinator.Coordinator, service, tag string, log *logger.Logger) (balancer.Balancer, error)
NewBalancer initializes and returns a new Balancer.
Types ¶
type Balancer ¶
type Balancer struct {
// contains filtered or unexported fields
}
Balancer save meta info in Consul
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver implements the gRPC Resolver interface using a Consul backend.
See the gRPC load balancing documentation for details about Balancer and Resolver: https://github.com/grpc/grpc/blob/master/doc/load-balancing.md.
func (*Resolver) Next ¶
Next blocks until an update or error happens. It may return one or more updates. The first call will return the full set of instances available as NewConsulResolver will look those up. Subsequent calls to Next() will block until the resolver finds any new or removed instance.
An error is returned if and only if the watcher cannot recover.