Documentation
¶
Index ¶
- func DecodeRaw(raw interface{}, result interface{}) error
- func GetIP(specList []string) (string, error)
- func GetTimeout(timeoutFmt string) (time.Duration, error)
- func IPFromInterfaces(raw interface{}) (string, error)
- func ParseDuration(duration interface{}) (time.Duration, error)
- func ToStringArray(raw interface{}) ([]string, error)
- func ValidateServiceName(name string) error
- type ByInterfaceThenIP
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeRaw ¶
func DecodeRaw(raw interface{}, result interface{}) error
DecodeRaw decodes a raw interface into the target structure
func GetTimeout ¶
GetTimeout converts a properly formatted string to a Duration, returning an error if the Duration can't be parsed
func ParseDuration ¶
ParseDuration parses the given duration with multiple type support int (defaults to seconds) string with units string without units (default to seconds)
func ToStringArray ¶
ToStringArray converts the given interface to a []string if possible
func ValidateServiceName ¶
ValidateServiceName checks if the service name passed as an argument is is alpha-numeric with dashes. This ensures compliance with both DNS and discovery backends.
Types ¶
type ByInterfaceThenIP ¶
type ByInterfaceThenIP []interfaceIP
ByInterfaceThenIP implements the Sort with the following properties: 1. Sort interfaces alphabetically 2. Sort IPs by bytes (normalized to 16 byte form)
func (ByInterfaceThenIP) Len ¶
func (se ByInterfaceThenIP) Len() int
func (ByInterfaceThenIP) Less ¶
func (se ByInterfaceThenIP) Less(i, j int) bool
func (ByInterfaceThenIP) Swap ¶
func (se ByInterfaceThenIP) Swap(i, j int)