resolver

package
v0.0.0-...-d08810a Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const CacheTTL = 12 * time.Hour

CacheTTL is the duration before a domain name resolution is evict form the cache.

Variables

View Source
var ErrHostRejected = errors.New("rejected host")

ErrHostRejected is returned when the host has been flagged as unwanted.

Functions

This section is empty.

Types

type NameResolver

type NameResolver struct {
	// contains filtered or unexported fields
}

A NameResolver is used for name resolution.

func New

func New(rejects []string) (*NameResolver, error)

New return a new NameResolver.

func (*NameResolver) OverrideHost

func (r *NameResolver) OverrideHost(host string, ip string) error

OverrideHost adds an host override.

func (*NameResolver) Resolve

func (r *NameResolver) Resolve(ctx context.Context, name string) (context.Context, net.IP, error)

Resolve returns the ip for the given domain name.

Jump to

Keyboard shortcuts

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