test

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2018 License: Apache-2.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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