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 MessageConstructor ¶ added in v0.76.2
type MessageConstructor struct {
OnNewMsgNXDOMAIN func(req *dns.Msg) (resp *dns.Msg)
OnNewMsgSERVFAIL func(req *dns.Msg) (resp *dns.Msg)
OnNewMsgNOTIMPLEMENTED func(req *dns.Msg) (resp *dns.Msg)
OnNewMsgNODATA func(req *dns.Msg) (resp *dns.Msg)
}
MessageConstructor is a mock dnsmsg.MessageConstructor implementation for tests.
func NewMessageConstructor ¶ added in v0.76.2
func NewMessageConstructor() (c *MessageConstructor)
NewMessageConstructor creates a new *TestMessageConstructor with all it's methods set to panic.
func (*MessageConstructor) NewMsgNODATA ¶ added in v0.76.2
func (c *MessageConstructor) NewMsgNODATA(req *dns.Msg) (resp *dns.Msg)
NewMsgNODATA implements the MessageConstructor interface for *TestMessageConstructor.
func (*MessageConstructor) NewMsgNOTIMPLEMENTED ¶ added in v0.76.2
func (c *MessageConstructor) NewMsgNOTIMPLEMENTED(req *dns.Msg) (resp *dns.Msg)
NewMsgNOTIMPLEMENTED implements the [proxy.MessageConstructor] interface for *TestMessageConstructor.
func (*MessageConstructor) NewMsgNXDOMAIN ¶ added in v0.76.2
func (c *MessageConstructor) NewMsgNXDOMAIN(req *dns.Msg) (resp *dns.Msg)
NewMsgNXDOMAIN implements the [proxy.MessageConstructor] interface for *TestMessageConstructor.
func (*MessageConstructor) NewMsgSERVFAIL ¶ added in v0.76.2
func (c *MessageConstructor) NewMsgSERVFAIL(req *dns.Msg) (resp *dns.Msg)
NewMsgSERVFAIL implements the [proxy.MessageConstructor] interface for *TestMessageConstructor.
type Upstream ¶ added in v0.76.2
type Upstream struct {
OnAddress func() (addr string)
OnExchange func(req *dns.Msg) (resp *dns.Msg, err error)
OnClose func() (err error)
}
Upstream is a mock upstream.Upstream implementation for tests.
TODO(e.burkov): Move to golibs.
func (*Upstream) Address ¶ added in v0.76.2
Address implements the upstream.Upstream interface for *Upstream.
func (*Upstream) Close ¶ added in v0.76.2
Close implements the upstream.Upstream interface for *Upstream.