resolve

package module
v0.0.0-...-5c18112 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2016 License: BSD-3-Clause Imports: 2 Imported by: 50

README

ResolveAddr extracted from net

Extracted ResolveAddr code from golang net package.

This should never have had to happen.

Removed DNS resolution-- i didnt need it and it was 2x more work. PRs accepted.

Documentation

Index

Constants

View Source
const HexDigit = "0123456789abcdef"

Variables

View Source
var (
	ErrDNSNotSupported   = errors.New("dns resolution not supported")
	ErrNoSuitableAddress = errors.New("no suitable address found")
	ErrMissingAddress    = errors.New("missing address")
)

Functions

func AppendHex

func AppendHex(dst []byte, i uint32) []byte

AppendHex converts i to a hexadecimal string. Leading zeros are not printed.

func DTOI

func DTOI(s string, i0 int) (n int, i int, ok bool)

DTOI Decimal to integer starting at &s[i0]. Returns number, new offset, success.

func ITOD

func ITOD(i uint) string

ITOD Convert i to decimal string.

func IToA

func IToA(i int) string

ITOA Integer to decimal.

func ParseIPv4

func ParseIPv4(s string) net.IP

Parse IPv4 address (d.d.d.d).

func ParseIPv6

func ParseIPv6(s string, zoneAllowed bool) (ip net.IP, zone string)

func ParsePort

func ParsePort(netw, port string) (int, error)

ParsePort parses port as a network service port number for both TCP and UDP.

func ResolveAddr

func ResolveAddr(op, netw, addr string) (net.Addr, error)

ResolveAddr resolves addr that is either an Internet or Unix Addr

func ResolveInternetAddr

func ResolveInternetAddr(netw, addr string) (net.Addr, error)

resolveInternetAddr resolves addr that is either a literal IP address or a DNS name and returns an internet protocol family address. It returns a list that contains a pair of different address family addresses when addr is a DNS name and the name has multiple address family records. The result contains at least one address when error is nil.

func SplitHostZone

func SplitHostZone(s string) (host, zone string)

func XTOI

func XTOI(s string, i0 int) (n int, i int, ok bool)

XTOI Hexadecimal to integer starting at &s[i0]. Returns number, new offset, success.

func XTOI2

func XTOI2(s string, e byte) (byte, bool)

XTOI2 converts the next two hex digits of s into a byte. If s is longer than 2 bytes then the third byte must be e. If the first two bytes of s are not hex digits or the third byte does not match e, false is returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

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