resolver

package
v0.0.0-...-d9a8df2 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2016 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetLookupTimeout

func SetLookupTimeout(t time.Duration) func()

SetLookupTimeout sets the node resolution lookup timeout.

Types

type Resolver

type Resolver interface {
	Type() string
	Addr() string
	GetAddress() (net.Addr, error)
	IsExhausted() bool
}

Resolver is an interface which provides an abstract factory for net.Addr addresses. Resolvers are not thread safe.

func NewResolver

func NewResolver(context *base.Context, spec string) (Resolver, error)

NewResolver takes a resolver specification and returns a new resolver. A specification is of the form: [<network type>=]<address> Network type can be one of:

  • tcp: plain hostname or ip address
  • unix: unix sockets
  • http-lb: http load balancer: queries http(s)://<lb>/_status/details/local for node addresses

If "network type" is not specified, "tcp" is assumed.

func NewResolverFromAddress

func NewResolverFromAddress(addr net.Addr) (Resolver, error)

NewResolverFromAddress takes a net.Addr and constructs a resolver.

func NewResolverFromUnresolvedAddr

func NewResolverFromUnresolvedAddr(addr util.UnresolvedAddr) (Resolver, error)

NewResolverFromUnresolvedAddr takes a util.UnresolvedAddr and constructs a resolver.

Jump to

Keyboard shortcuts

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