resolver

package
v0.13.9 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package resolver provides a caching, non-blocking DNS resolver. All requests for cached resources are returned immediately and if cache has expired, an offline goroutine is fired to update it.

Package resolver provides a caching, non-blocking DNS resolver. All requests for cached resources are returned immediately and if cache has expired, an offline goroutine is fired to update it.

Index

Constants

View Source
const (
	IP  ipVersion = 0
	IP4 ipVersion = 4
	IP6 ipVersion = 6
)

Variables

This section is empty.

Functions

func New

func New(opts ...Option) *resolverImpl

New returns a new Resolver.

func ParseOverrideAddress added in v0.13.8

func ParseOverrideAddress(dnsResolverOverride string) (string, string, error)

Types

type Option added in v0.13.8

type Option func(*resolverImpl)

func GetResolverOptions added in v0.13.8

func GetResolverOptions(targetsDef *targetspb.TargetsDef, l *logger.Logger) ([]Option, error)

func WithDNSServer added in v0.13.8

func WithDNSServer(serverNetworkOverride, serverAddressOverride string) Option

func WithLogger added in v0.13.8

func WithLogger(l *logger.Logger) Option

func WithMaxTTL added in v0.13.8

func WithMaxTTL(ttl time.Duration) Option

func WithResolveFunc added in v0.13.8

func WithResolveFunc(resolveFunc func(context.Context, string, string) ([]net.IP, error)) Option

func WithResolveTimeout added in v0.13.8

func WithResolveTimeout(resolveTimeout time.Duration) Option

func WithTTL added in v0.13.8

func WithTTL(ttl time.Duration) Option

type Resolver

type Resolver interface {
	Resolve(name string, ipVer int) (net.IP, error)
}

Jump to

Keyboard shortcuts

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