Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LookupHost ¶
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:
- an IP address or comma-delimted string of IP addresses (like "127.0.0.1,128.0.0.1")
- an etcd key (like "/fooDB/primary")
- 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.