Version: v1.2.0 Latest Latest

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

Go to latest
Published: Jul 11, 2018 License: Apache-2.0 Imports: 7 Imported by: 0



Package test contains function and types useful for writing tests



This section is empty.


This section is empty.


func CoreDNSServer

func CoreDNSServer(corefile string) (*caddy.Instance, error)

CoreDNSServer returns a CoreDNS test server. It just takes a normal Corefile as input.

func CoreDNSServerAndPorts

func CoreDNSServerAndPorts(corefile string) (i *caddy.Instance, udp, tcp string, err error)

CoreDNSServerAndPorts combines CoreDNSServer and CoreDNSServerPorts to start a CoreDNS server and returns the udp and tcp ports of the first instance.

func CoreDNSServerPorts

func CoreDNSServerPorts(i *caddy.Instance, k int) (udp, tcp string)

CoreDNSServerPorts returns the ports the instance is listening on. The integer k indicates which ServerListener you want.

func CoreDNSServerStop

func CoreDNSServerStop(i *caddy.Instance)

CoreDNSServerStop stops a server.

func TempFile

func TempFile(dir, content string) (string, func(), error)

TempFile will create a temporary file on disk and returns the name and a cleanup function to remove it later.


type Input

type Input struct {
	// contains filtered or unexported fields

Input implements the caddy.Input interface and acts as an easy way to use a string as a Corefile.

func NewInput

func NewInput(corefile string) *Input

NewInput returns a pointer to Input, containing the corefile string as input.

func (*Input) Body

func (i *Input) Body() []byte

Body implements the Input interface.

func (*Input) Path

func (i *Input) Path() string

Path implements the Input interface.

func (*Input) ServerType

func (i *Input) ServerType() string

ServerType implements the Input interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL