check

package
v2.0.0-rc2 Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDNSMalfunction = errors.New("DNS is not working")

Functions

func WaitForDNS

func WaitForDNS(ctx context.Context, settings Settings) (err error)

Types

type Settings

type Settings struct {
	// Resolver to use for the check.
	// It defaults to the default Go resolver if left unset.
	Resolver *net.Resolver
	// HostToResolve is the host to resolve for the check.
	// It defaults to github.com if left unset.
	HostToResolve string
	// MaxTries is the maximum number of tries
	// before returning an error.
	// It defaults to 10 if left unset.
	MaxTries int
	// WaitTime is the duration to wait between
	// each failed try. It defaults to 300ms
	// if left unset.
	WaitTime time.Duration
	// AddWaitTime is the duration to add to the wait
	// time after each failed try.
	// It defaults to 100ms if left unset.
	AddWaitTime time.Duration
}

func (*Settings) SetDefaults

func (s *Settings) SetDefaults()

func (Settings) Validate

func (s Settings) Validate() (err error)

Jump to

Keyboard shortcuts

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