test

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package test contains function and types useful for writing tests

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 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.

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