Documentation ¶
Index ¶
- func ExponentialBackoff(tries int) time.Duration
- func LookupAddressWithCustomDNS(addr string, dns string, protocol string) ([]netip.Addr, error)
- func Ping(addr string, count int) error
- func StringsToIPs(addresses []string) []netip.Addr
- func ToRouteString(network netip.Prefix) string
- type DNSResolver
- type Endpoint
- type EndpointResolver
- type PingConnectionChecker
- type Resolver
- type ResolverChain
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExponentialBackoff ¶
func LookupAddressWithCustomDNS ¶
LookupAddressWithCustomDNS looks up address in a specified DNS server
func StringsToIPs ¶
func ToRouteString ¶
Types ¶
type Endpoint ¶
type Endpoint struct {
// contains filtered or unexported fields
}
Endpoint is responsible for picking the correct IP to use when connecting to the server. Sometimes, even if the server supports IPv6, it cannot be used to connect to it, due to limitations on the client.
func DefaultEndpoint ¶
func DefaultEndpoint(resolver EndpointResolver, serverIps []netip.Addr) Endpoint
DefaultEndpoint returns appropriate endpoint to use.
func NewIPv4Endpoint ¶
func NewIPv6Endpoint ¶
func NewLocalEndpoint ¶
type EndpointResolver ¶
EndpointResolver check if the endpoint can be used
type PingConnectionChecker ¶
type PingConnectionChecker struct {
// contains filtered or unexported fields
}
PingConnectionChecker is the only resolver used by ResolverChain
func NewPingConnectionChecker ¶
func NewPingConnectionChecker(fw firewall.Service) PingConnectionChecker
type Resolver ¶
Resolver is a DNSResolver implementation wrapping each DHCP request with allowing and blocking firewall rules
type ResolverChain ¶
type ResolverChain struct {
// contains filtered or unexported fields
}
ResolverChain tries each resolver until the first successful one. It's sole purpose is to determine whether to use IPv4 vs IPv6 endpoint.
func NewDefaultResolverChain ¶
func NewDefaultResolverChain(fw firewall.Service) ResolverChain