Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidIPAddressOrHost = errors.New("invalid IP address or hostname")
View Source
var ErrNoIPAddressesFound = errors.New("could not resolve any IP address")
View Source
var ErrOriginAddrInvalidAddrChunk = errors.New("invalid address chunk in origin address")
View Source
var ErrOriginAddrInvalidPort = errors.New("invalid port in origin address")
Functions ¶
func IPToString ¶
Types ¶
type IPAddresses ¶
func GetIPAddressesFromHost ¶
func GetIPAddressesFromHost(hostname string) (*IPAddresses, error)
GetIPAddressesFromHost returns all resolvable IP addresses (*IPAddresses) from a host. If it is an IP address this IP address will be returned as *IPAddresses
func NewIPAddresses ¶
func NewIPAddresses() *IPAddresses
func (*IPAddresses) Add ¶
func (ips *IPAddresses) Add(ip net.IP)
func (*IPAddresses) GetPreferredAddress ¶
func (ips *IPAddresses) GetPreferredAddress(preferIPv6 bool) net.IP
func (*IPAddresses) Len ¶
func (ips *IPAddresses) Len() int
func (*IPAddresses) Remove ¶
func (ips *IPAddresses) Remove(ip net.IP)
func (*IPAddresses) Union ¶
func (ips *IPAddresses) Union(other *IPAddresses) *IPAddresses
type OriginAddress ¶
OriginAddress represents a tuple of a IP or hostname, port, alias and IPv6 preference
func ParseOriginAddress ¶
func ParseOriginAddress(s string) (*OriginAddress, error)
func (*OriginAddress) String ¶
func (ra *OriginAddress) String() string
Click to show internal directories.
Click to hide internal directories.