Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsulResolver ¶
type ConsulResolver struct {
// contains filtered or unexported fields
}
ConsulResolver 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 NewConsulResolver ¶
func NewConsulResolver(client *api.Client, service, tag string) (*ConsulResolver, error)
NewConsulResolver initializes and returns a new ConsulResolver.
It resolves addresses for gRPC connections to the given service and tag. If the tag is irrelevant, use an empty string.
func (*ConsulResolver) Next ¶
func (r *ConsulResolver) Next() ([]*naming.Update, error)
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.
type HealthzEndpoint ¶
type HealthzEndpoint struct { Addr string // e.g. 127.0.0.1:10000 CheckURL string // e.g. http://127.0.0.1:10000/healthz // contains filtered or unexported fields }
HealthzEndpoint is an endpoint that serves gRPC and responds to health checks on the CheckURL.
type HealthzResolver ¶
type HealthzResolver struct {
// contains filtered or unexported fields
}
HealthzResolver implements the gRPC Resolver interface using a simple health endpoint check on a list of clients initially passed to the resolver.
See the gRPC load balancing documentation for details about Balancer and Resolver: https://github.com/grpc/grpc/blob/master/doc/load-balancing.md.
func NewHealthzResolver ¶
func NewHealthzResolver(endpoints ...HealthzEndpoint) (*HealthzResolver, error)
NewHealthzResolver initializes and returns a new HealthzResolver.
It resolves addresses for gRPC connections to the given list of host:port endpoints. It does
func (*HealthzResolver) Next ¶
func (r *HealthzResolver) Next() ([]*naming.Update, error)
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 NewHealthzResolver 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.
type StaticResolver ¶
type StaticResolver struct {
// contains filtered or unexported fields
}
StaticResolver implements a gRPC resolver/watcher that simply returns a list of addresses, then blocks.
func NewStaticResolver ¶
func NewStaticResolver(addr ...string) *StaticResolver
NewStaticResolver initializes and returns a new StaticResolver.
func (*StaticResolver) Close ¶
func (r *StaticResolver) Close()
Close is a no-op for a StaticResolver.