doh

package
v2.0.0-rc8 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrHTTPStatus = errors.New("bad HTTP status")
View Source
var ErrUpstreamResolversNotSet = errors.New("upstream resolvers not set")

Functions

This section is empty.

Types

type Dialer

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

func New

func New(settings Settings) (dial *Dialer, err error)

func (*Dialer) Dial

func (d *Dialer) Dial(ctx context.Context, _, _ string) (
	conn net.Conn, err error,
)

func (*Dialer) String

func (d *Dialer) String() string

type Metrics

type Metrics interface {
	DoHDialInc(url string)
}

type Settings

type Settings struct {
	// UpstreamResolvers is a list of DNS over TLS upstream resolvers
	// to use.
	UpstreamResolvers []provider.Provider
	// Timeout is the maximum duration to wait for a response from
	// upstream DNS over HTTPS servers. If left unset, it defaults to
	// 5 seconds.
	Timeout time.Duration
	// IPVersion indicates whether to use IPv4 only or IPv6 only for
	// DNS over HTTPS. The hardcoded resolver used by the DoH HTTP
	// client will return only IP addresses matching the version set
	// from all the providers. If left unset, it defaults to "ipv4".
	IPVersion string
	// Metrics is the metrics interface to record metric data.
	// It defaults to a No-Op metrics implementation.
	Metrics Metrics
}

func (*Settings) SetDefaults

func (s *Settings) SetDefaults()

func (*Settings) String

func (s *Settings) String() string

func (*Settings) ToLinesNode

func (s *Settings) ToLinesNode() (node *gotree.Node)

func (Settings) Validate

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

Directories

Path Synopsis
metrics
noop
Package noop defines a No-op metric implementation for DoH.
Package noop defines a No-op metric implementation for DoH.
prometheus
Package prometheus defines a Prometheus metric implementation for DoH.
Package prometheus defines a Prometheus metric implementation for DoH.

Jump to

Keyboard shortcuts

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