test

package
v0.0.0-...-15297c8 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2016 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CoreDNSServer

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

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

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(t *testing.T, 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.

Types

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
y or Y : Canonical URL