Documentation ¶
Index ¶
- func GetLocalIP() (string, error)
- func IsAddrInUse(err error) bool
- func IsPrivateAddress(address string) (bool, error)
- func JoinURLs(list []*url.URL) string
- func ParseURLs(list []string) ([]*url.URL, error)
- func ParseURLsFromString(hosts string) ([]*url.URL, error)
- func WaitForNetwork(d time.Duration) (ipaddr string, err error)
- type GetNodeNameFn
- type NodeInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLocalIP ¶
GetLocalIP returns the non loopback local IP of the host
func IsAddrInUse ¶
IsAddrInUse checks whether the given error indicates "address in use"
func IsPrivateAddress ¶
IsPrivateAddress works by checking if the address is under private CIDR blocks. List of private CIDR blocks can be seen on :
func ParseURLsFromString ¶
ParseURLsFromString creates a list of URLs from a coma-separated lists of hosts
Types ¶
type GetNodeNameFn ¶
GetNodeNameFn is an interface to return an application specific node name from the host name.
type NodeInfo ¶
NodeInfo is an interface to provide host and IP address for the node in the cluster.
func NewNodeInfo ¶
func NewNodeInfo(extractor GetNodeNameFn) (NodeInfo, error)
NewNodeInfo constructs node info using provided extractor function. If extractor is nil, then host name is used.
Click to show internal directories.
Click to hide internal directories.