consul

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 27, 2017 License: MIT Imports: 5 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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 NewResolver

func NewResolver(client *api.Client, service, tag string) (*Resolver, error)

NewResolver initializes and returns a new Resolver.

It resolves addresses for gRPC connections to the given service and tag. If the tag is irrelevant, use an empty string.

func (*Resolver) Close

func (r *Resolver) Close()

Close closes the watcher.

func (*Resolver) Next

func (r *Resolver) 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 NewResolver 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.

func (*Resolver) Resolve

func (r *Resolver) Resolve(target string) (naming.Watcher, error)

Resolve creates a watcher for target. The watcher interface is implemented by Resolver as well, see Next and Close.

Directories

Path Synopsis
example
proto/echo
Package echo is a generated protocol buffer package.
Package echo is a generated protocol buffer package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL