Documentation ¶
Index ¶
- func CanonicalizeTCPAddr(addr *net.TCPAddr) *net.TCPAddr
- func CompareIP(a net.IP, b net.IP) int
- func CompareTCPAddr(a *net.TCPAddr, b *net.TCPAddr) int
- func ErrorOrNil(multi multierror.Error) error
- func ParseBool(str string) (bool, error)
- func ParseIP(host string) (net.IP, error)
- func ParseIPAndZone(host string) (net.IP, string, error)
- func ParsePort(port string) (uint16, error)
- func ParseTCPAddr(str, defaultPort string) (*net.TCPAddr, error)
- func ParseTCPAddrList(str, defaultPort string) ([]*net.TCPAddr, error)
- func SplitHostPort(str, defaultPort string) (host string, port string, err error)
- func StrictUnmarshalJSON(raw []byte, v interface{}) error
- func TryBase64DecodeString(str string) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanonicalizeTCPAddr ¶
CanonicalizeTCPAddr takes a TCPAddr and returns a TCPAddr with the same value, but with the guarantee that two calls to CanonicalizeTCPAddr with the same TCPAddr value will return the same pointer.
func CompareTCPAddr ¶
CompareTCPAddr returns {a < b: -1, a == b: 0, a > b: +1}.
func ErrorOrNil ¶ added in v0.4.6
func ErrorOrNil(multi multierror.Error) error
func ParseIPAndZone ¶
ParseIPAndZone parses a string in "<ip>%<zone>" format.
func ParseTCPAddr ¶
ParseTCPAddr parses a string in "<ip>:<port>" format.
func ParseTCPAddrList ¶
ParseTCPAddrList parses a string in "<ip>:<port>,<ip>:<port>,..." format.
func SplitHostPort ¶
SplitHostPort splits a string in "<host>:<port>" format, except that if a port is not present in the string and defaultPort is non-empty, then defaultPort is used instead.
func StrictUnmarshalJSON ¶
StrictUnmarshalJSON is a variant of json.Unmarshal that always sets DisallowUnknownFields() and UseNumber().
func TryBase64DecodeString ¶
TryBase64DecodeString attempts to decode base-64 byte array using any of the standard base-64 encodings.
Types ¶
This section is empty.