dnscache

package
v1.0.5293-e1a8622 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package dnscache contains a simple in-process cache for DNS lookups

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	CacheSize int
	TTL       time.Duration

	// Resolver optionally allows specifying a custom resolver
	Resolver *net.Resolver
	// contains filtered or unexported fields
}

type DialFunc

type DialFunc func(ctx context.Context, network, addr string) (net.Conn, error)

func DialContext

func DialContext(resolver *Resolver, baseDial DialFunc) DialFunc

type Resolver

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

func New

func New(c Config) *Resolver

func (*Resolver) Resolve

func (r *Resolver) Resolve(ctx context.Context, addr string) ([]net.IP, error)

Jump to

Keyboard shortcuts

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