dnsproxytest

package
v0.71.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package dnsproxytest provides a set of test utilities for the dnsproxy module.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeUpstream

type FakeUpstream struct {
	OnAddress  func() (addr string)
	OnExchange func(req *dns.Msg) (resp *dns.Msg, err error)
	OnClose    func() (err error)
}

FakeUpstream is a fake [Upstream] implementation for tests.

TODO(e.burkov): Move this to the golibs?

func (*FakeUpstream) Address

func (u *FakeUpstream) Address() (addr string)

Address implements the [Upstream] interface for *FakeUpstream.

func (*FakeUpstream) Close

func (u *FakeUpstream) Close() (err error)

Close implements the [Upstream] interface for *FakeUpstream.

func (*FakeUpstream) Exchange

func (u *FakeUpstream) Exchange(req *dns.Msg) (resp *dns.Msg, err error)

Exchange implements the [Upstream] interface for *FakeUpstream.

Jump to

Keyboard shortcuts

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