dig

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DigOne

func DigOne(ctx context.Context, p DigOneParams) ([]string, error)

DigOne a qname! Returns an error for rcode != NOERROR or an empty list of answers. Returns answers sorted alphabetically. If there is both a context deadline and a configured timeout on `DigOneParams`, the earliest of the two takes effect.

Types

type DigOneFunc

type DigOneFunc func(ctx context.Context, p DigOneParams) ([]string, error)

func DigOneFuncMock

func DigOneFuncMock(_ context.Context, rets []DigOneResult) DigOneFunc

type DigOneFuncCtxKey added in v0.0.11

type DigOneFuncCtxKey struct{}

type DigOneParams

type DigOneParams struct {
	NameserverIPPort string
	Proto            string
	Qname            string
	Rtype            uint16
	SubnetIP         net.IP
	Timeout          time.Duration
}

func EmptyDigOneparams

func EmptyDigOneparams() DigOneParams

type DigOneResult

type DigOneResult struct {
	Answers []string
	Err     error
}

type DigRepeatParams

type DigRepeatParams struct {
	DigOneParams DigOneParams
	Count        int
}

func CombineDigRepeatParams added in v0.0.8

func CombineDigRepeatParams(nameservers []string, proto string, qnames []string, rtypes []uint16, subnets []net.IP, count int) []DigRepeatParams

CombineDigRepeatParams combines all the slcies passed. Ensure all of them have a length > 0

type DigRepeatResult

type DigRepeatResult struct {
	Answers []counter.StringSliceCount
	Errors  []counter.StringCount
}

func DigRepeat

DigRepeat runs DigOne multiple times and sums the answers and errors

func DigRepeatParallel added in v0.0.7

func DigRepeatParallel(ctx context.Context, params []DigRepeatParams, dig DigOneFunc) []DigRepeatResult

DigRepeatParallel runs DigRepeats in parallel and returns a slice of their results

Jump to

Keyboard shortcuts

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