dnsprobe

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2022 License: MIT Imports: 8 Imported by: 1

Documentation

Overview

Package dnsprobe implements a DNS probe.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func A

func A(a []string) func(*DnsProber)

A sets expected A records.

func Alert

func Alert(fn prober.AlertFn) func(*DnsProber)

Alert sets a custom alerting function.

If Alert is not called, the probes.SendAlertEmail function is called.

func CNAME

func CNAME(cname string) func(*DnsProber)

CNAME sets expected 1 CNAME record.

func Desc

func Desc(desc string) func(*DnsProber)

Desc sets specified description.

func MX

func MX(mx []*net.MX) func(*DnsProber)

MX sets expected MX records.

func NS

func NS(ns []*net.NS) func(*DnsProber)

NS sets expected NS records.

func Name

func Name(name string) func(*DnsProber)

Name sets specified name.

func New

func New(target string, options ...func(*DnsProber)) *prober.Probe

New returns a new instance of the DNS probe with specified options.

func NewWithGeneric

func NewWithGeneric(target string, genericOpts []prober.Option, options ...func(*DnsProber)) *prober.Probe

NewWithGeneric returns a new instance of the DNS probe with specified options.

NewWithGeneric passes through specified prober.Options, after applying the dnsprobe-specific options.

func TXT

func TXT(txt []string) func(*DnsProber)

TXT applies the option that the prober wants specific TXT records.

Types

type DnsProber

type DnsProber struct {
	Target string // host to probe
	// contains filtered or unexported fields
}

DnsProber probes a target host's DNS records.

func (*DnsProber) Alert

func (p *DnsProber) Alert(name, desc string, badness int, records prober.Records) error

Alert calls the prober.AlertFn for the prober.

If no prober.AlertFn was set with the Alert() option, probes.SendAlertEmail is used by default.

func (*DnsProber) Probe

func (p *DnsProber) Probe() prober.Result

Probe verifies that the target's DNS records are as expected.

func (DnsProber) String

func (p DnsProber) String() string

String returns the human-readable description of the prober.

Jump to

Keyboard shortcuts

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