testtool

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRandomHostLabel added in v1.4.0

func GetRandomHostLabel(maxLen int) string

func GetRandomHostName added in v1.4.0

func GetRandomHostName() string

func MustNewNameNode added in v0.4.0

func MustNewNameNode(name string, class dns.Class) *dnsutils.NameNode

func MustNewRR

func MustNewRR(s string) dns.RR

USE ONLY TEST PACKAGE

func MustNewRRSet added in v0.4.0

func MustNewRRSet(name string, ttl uint32, class dns.Class, rrtype uint16, rrs []dns.RR) *dnsutils.RRSet

func MustNewZone added in v0.4.0

func MustNewZone(name string, class dns.Class) *dnsutils.Zone

Types

type ResponseWriter added in v0.5.0

type ResponseWriter struct {
	LocalAddress  net.Addr
	RemoteAddress net.Addr

	Msg      *dns.Msg
	Msgs     []*dns.Msg
	MsgBytes []byte

	ErrWriteMsg   error
	ErrWrite      error
	ErrClose      error
	ErrTsigStatus error
}

func (*ResponseWriter) Close added in v0.5.0

func (w *ResponseWriter) Close() error

Close closes the connection.

func (*ResponseWriter) Hijack added in v0.5.0

func (w *ResponseWriter) Hijack()

Hijack lets the caller take over the connection. After a call to Hijack(), the DNS package will not do anything with the connection.

func (*ResponseWriter) LocalAddr added in v0.5.0

func (w *ResponseWriter) LocalAddr() net.Addr

LocalAddr returns the net.Addr of the server

func (*ResponseWriter) RemoteAddr added in v0.5.0

func (w *ResponseWriter) RemoteAddr() net.Addr

RemoteAddr returns the net.Addr of the client that sent the current request.

func (*ResponseWriter) TsigStatus added in v0.5.0

func (w *ResponseWriter) TsigStatus() error

TsigStatus returns the status of the Tsig.

func (*ResponseWriter) TsigTimersOnly added in v0.5.0

func (w *ResponseWriter) TsigTimersOnly(bool)

TsigTimersOnly sets the tsig timers only boolean.

func (*ResponseWriter) Write added in v0.5.0

func (w *ResponseWriter) Write(bs []byte) (int, error)

Write writes a raw buffer back to the client.

func (*ResponseWriter) WriteMsg added in v0.5.0

func (w *ResponseWriter) WriteMsg(msg *dns.Msg) error

WriteMsg writes a reply back to the client.

type TestGenerator added in v0.4.0

type TestGenerator struct {
	dnsutils.Generator
	NewNewNameNodeErr error
	NewRRSetErr       error
}

func (*TestGenerator) NewNameNode added in v0.4.0

func (n *TestGenerator) NewNameNode(name string, class dns.Class) (dnsutils.NameNodeInterface, error)

func (*TestGenerator) NewRRSet added in v0.4.0

func (n *TestGenerator) NewRRSet(name string, ttl uint32, class dns.Class, rrtype uint16) (dnsutils.RRSetInterface, error)

type TestNameNodeInterface added in v0.4.0

type TestNameNodeInterface struct {
	NameNodeInterface dnsutils.NameNodeInterface
}

Jump to

Keyboard shortcuts

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