resolver

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2019 License: Apache-2.0 Imports: 5 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.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Resolver

type Resolver struct {
	DefaultMaxAge time.Duration
	// contains filtered or unexported fields
}

Resolver provides an asynchronous caching DNS resolver.

func New

func New() *Resolver

New returns a new Resolver.

func (*Resolver) Resolve

func (r *Resolver) Resolve(name string, ipVer int) (net.IP, error)

Resolve returns IP address for a name. Issues an update call for the cache record if it's older than defaultMaxAge.

Jump to

Keyboard shortcuts

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