resolver

package
v0.0.0-...-365054f Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: GPL-3.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheDNSRecord

func CacheDNSRecord(name string, addrs []string)

CacheDNSRecord add a cached record for the provided name.

func FetchDNSFromCache

func FetchDNSFromCache(name string) (addrs []string)

FetchDNSFromCache returns a cached addressed for the provided name.

func NewResolverCache

func NewResolverCache() *resolverCache

NewResolverCache caches resolver responses.

Types

type ResolveContext

type ResolveContext func(ctx context.Context, network, addr string) (addrs []string, err error)

ResolveContext specifies the resolve function for doing custom DNS lookup.

func NewResolverMap

func NewResolverMap(hostToIP map[string][]string) ResolveContext

NewResolverMap creates resolver with predefined host -> IP map.

Jump to

Keyboard shortcuts

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