nameservice

package
v0.0.78 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFormat   = errors.New("Format Error")
	ErrServFail = errors.New("Server Failure")
	ErrNXDomain = errors.New("Non-Existent Domain")
	ErrNotImp   = errors.New("Not Implemented")
	ErrRefused  = errors.New("Query Refused")
)

RFC 1035 error interpretation

Functions

func ErrorToRFC1035Status added in v0.0.49

func ErrorToRFC1035Status(err error) int

ErrorToRFC1035Status mapping of RFC1035 errors.

func RFC1035StatusToError added in v0.0.49

func RFC1035StatusToError(status int) error

func WrapError added in v0.0.36

func WrapError(err error) error

WrapError with a RFC1035 error.

Types

type ForwardLookup

type ForwardLookup interface {
	ResolveName(ctx context.Context, protocol, network, domainName string) ([]byte, error)
}

ForwardLookup resolve a name and return address.

type Lookup

type Lookup interface {
	ForwardLookup
	ReverseLookup
}

Lookup methods for address and domain resolution.

func NewLookupService

func NewLookupService(baseURL string) Lookup

NewLookupService creates a new lookup services.

type LookupService

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

LookupService is the default lookup service.

func (LookupService) ResolveAddress

func (s LookupService) ResolveAddress(ctx context.Context, protocol, network string, address []byte) (string, error)

ResolveAddress looks up an address on the related protocol and network pair.

func (LookupService) ResolveName

func (s LookupService) ResolveName(ctx context.Context, protocol, network, domainName string) ([]byte, error)

ResolveName look up a domain name and return address on the related protocol and network pair.

type ReverseLookup

type ReverseLookup interface {
	ResolveAddress(ctx context.Context, protocol, network string, address []byte) (string, error)
}

ReverseLookup look up address/name

Directories

Path Synopsis
Package nameservicetest is a generated GoMock package.
Package nameservicetest is a generated GoMock package.

Jump to

Keyboard shortcuts

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