app

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTargetIPVersionNotAllowed   = errors.New("ipVersion is not allowed when target is not a domain")
	ErrResolverIPVersionNotAllowed = errors.New("ipVersion is not allowed when resolver is not a domain")
)
View Source
var (
	TerminalColorGreen   = color.New(color.FgGreen, color.Bold).SprintFunc()
	TerminalColorBlue    = color.New(color.FgBlue, color.Bold).SprintFunc()
	TerminalColorYellow  = color.New(color.FgYellow, color.Bold).SprintFunc()
	TerminalColorCyan    = color.New(color.FgCyan, color.Bold).SprintFunc()
	TerminalColorRed     = color.New(color.FgRed, color.Bold).SprintFunc()
	TerminalColorMagenta = color.New(color.FgMagenta, color.Bold).SprintFunc()
)

Functions

This section is empty.

Types

type App

type App struct {
	Logger       *slog.Logger
	Version      string
	QueryFlags   models.QueryFlags
	Questions    []dns.Question
	Resolvers    []resolvers.Resolver
	ResolverOpts resolvers.Options
	Nameservers  []models.Nameserver
	// contains filtered or unexported fields
}

App represents the structure for all app wide configuration.

func New

func New(
	logger *slog.Logger,
	globalping globalping.Client,
	buildVersion string,
) App

NewApp initializes an instance of App which holds app wide configuration.

func (*App) GlobalpingMeasurement added in v1.0.5

func (app *App) GlobalpingMeasurement() (*globalping.Measurement, error)

func (*App) LoadFallbacks

func (app *App) LoadFallbacks()

LoadFallbacks sets fallbacks for options that are not specified by the user but necessary for the resolver.

func (*App) LoadNameservers

func (app *App) LoadNameservers() error

func (*App) Output

func (app *App) Output(responses []resolvers.Response)

Output takes a list of `dns.Answers` and based on the output format specified displays the information.

func (*App) OutputGlobalping added in v1.0.5

func (app *App) OutputGlobalping(m *globalping.Measurement) error

func (*App) OutputGlobalpingJSON added in v1.0.5

func (app *App) OutputGlobalpingJSON(m *globalping.Measurement) error

func (*App) OutputGlobalpingShort added in v1.0.5

func (app *App) OutputGlobalpingShort(m *globalping.Measurement) error

func (*App) PrepareQuestions

func (app *App) PrepareQuestions()

PrepareQuestions takes a list of query names, query types and query classes and prepare a question for each combination of the above.

func (*App) ReverseLookup added in v0.4.1

func (app *App) ReverseLookup()

ReverseLookup is used to perform a reverse DNS Lookup using an IPv4 or IPv6 address. Query Type is set to PTR, Query Class is set to IN. Query Names must be formatted in in-addr.arpa. or ip6.arpa format.

type GlobalpingOutputResponse added in v1.0.5

type GlobalpingOutputResponse struct {
	Location string             `json:"location"`
	Answers  []resolvers.Answer `json:"answers"`
}

Jump to

Keyboard shortcuts

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