dns

package
v0.1.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package dns implements the DNS checker and prober.

The DNS prober looks up the addresses for the host name and reports them to the checker which further checks if the output from the prober is desired.

Valid check format is described as following:

Interval and Timeout should be greater than 0.

Input:

 Type          Value               Description
------- -------------------- ------------------------
 "DNS"   "", "PING", "ECHO"   Resolves the DNS names

Output:

       Type               Value                       Description
----------------- -------------------- ----------------------------------------
 "TIMEOUT"         <not validated>      Success is not-timeout
 "ADDRESS", "IP"   <valid IP address>   One of the resolved IP should be this

Target:

             Type                       Value               Description
------------------------------- ---------------------- ---------------------
 "HOST", "HOSTNAME", "DNSNAME"   <validated DNS name>   DNS name to resolve

Payload is not required and hence not validated.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

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

Checker runs a DNS check on the given host.

func (*Checker) Execute

func (c *Checker) Execute(ctx context.Context) (*checker.Result, error)

Execute executes the check.

func (*Checker) Provision

func (c *Checker) Provision(check checker.Check) (err error)

Provision initializes required fields for c's execution.

func (*Checker) Validate

func (c *Checker) Validate(check checker.Check) error

Validate validates the check configuration.

type ProbeResult

type ProbeResult struct {
	Timeout    bool
	StartTime  time.Time
	Duration   time.Duration
	ResolvedTo []string
}

ProbeResult is the result of a DNS Probe.

type Prober

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

Prober probes and resolves the host.

func NewProber

func NewProber(host string, timeout time.Duration) (*Prober, error)

NewProber creates a prober to resolve the host.

func (*Prober) Probe

func (p *Prober) Probe(ctx context.Context) (*ProbeResult, error)

Probe probes to resolves the host.

Jump to

Keyboard shortcuts

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