etcdname

package
v0.0.0-...-bb876ca Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2017 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LookupHost

func LookupHost(host string) ([]string, error)

LookupHost looks up the given host using the configured etcd cluster, if any. It retrieves the address for a host by checking etcd's services directory, and returns an array of the provided host's addresses.

when querying etcd, LookupHost expects the response from the services directory to be one of three things:

  1. an IP address or comma-delimted string of IP addresses (like "127.0.0.1,128.0.0.1")
  2. an etcd key (like "/fooDB/primary")
  3. an etcd key and a JSON pointer, separated with a # (like "/fooDB/primary#primaryIP")

If the services directory contains an IP address or string of addresses, LookupHost returns them. Otherwise, it checks the provided etcd key. If no JSON pointer is provided, LookupHost expects the value at that etcd key to be a string (a single address, or a comma-delimited string of addresses). Otherwise, it expects JSON, and it will parse that JSON using the provided JSON pointer.

For more on JSON pointers, see RFC 6901: https://tools.ietf.org/html/rfc6901.

Types

This section is empty.

Jump to

Keyboard shortcuts

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