resolver

package
v0.0.0-...-a3811b2 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultNameServers               = []string{"8.8.8.8:53", "1.1.1.1:53"}
	DefaultExpiration  time.Duration = time.Minute * 10
	ResolverTimeout    time.Duration = time.Second * 7
)
View Source
var (
	ErrAnswerEmpty = errors.New("answer is empty")
	ErrIpEmpty     = errors.New("ip is empty")
)

Functions

This section is empty.

Types

type Item

type Item struct {
	Nameserver string
	Object     []string
	Expiration int64
}

func (Item) Expired

func (item Item) Expired() bool

Returns true if the item has expired.

type Resolver

type Resolver struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewResolver

func NewResolver(nameservers ...string) *Resolver

func (*Resolver) Lookup

func (r *Resolver) Lookup(host string, nameservers ...string) ([]string, string, error)

Jump to

Keyboard shortcuts

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