dns

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(config Config) func(ctx context.Context) error

New creates new DNS service health check that verifies the following: - domain name record can be resolved

func Resolver

func Resolver(config Config, checker CheckerFunc) func(ctx context.Context) error

Types

type CheckerFunc

type CheckerFunc func(res *net.Resolver, ctx context.Context) error

type Config

type Config struct {
	// Address is the IP address or hostname that is being checked.
	Address string
	// Server is the server that resolves hostname.
	Server string
	// Type is the DNS record type
	// Default is A record.
	Type RecordType
	// RequestTimeout is the duration that health check will try to consume published test message.
	// Default is 5 seconds.
	RequestTimeout time.Duration
	// FallbackDelay
	// Default is the value from net.Dialer struct (300ms).
	FallbackDelay time.Duration
}

Config is the DNS checker configuration settings container.

type RecordType

type RecordType string
const (
	RecordTypeA     RecordType = "a"
	RecordTypeCNAME RecordType = "cname"
	RecordTypePTR   RecordType = "ptr"
	RecordTypeTXT   RecordType = "txt"
)

Jump to

Keyboard shortcuts

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