resolver

package
v0.6.5 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Resolver

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

func New

func New(hostnameMap map[string]net.IP, routes []jsonmsg.Route, vips []net.IP, st *stack.Stack, nameServers []jsonmsg.NameServer, eventSender *stream.Sender) (*Resolver, error)

func (*Resolver) Interesting

func (r *Resolver) Interesting(req string) bool

Interesting returns true if req shouldn't be passed through to the OS. i.e. the req should be dialed with gonet dial. req must be either hostname or IP

func (*Resolver) Resolve

func (r *Resolver) Resolve(req string) (net.IP, error)

Resolve must be called only when r.Interesting() returned true. Behavior of Resolve is undefined when r.Interesteing() returned false.

Jump to

Keyboard shortcuts

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