replacer

package
Version: v1.2.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Replacer

type Replacer interface {
	Replace(string) string
	Set(key, value string)
}

Replacer is a type which can replace placeholder substrings in a string with actual values from a dns.Msg and responseRecorder. Always use NewReplacer to get one of these.

func New

func New(r *dns.Msg, rr *dnstest.Recorder, emptyValue string) Replacer

New makes a new replacer based on r and rr. Do not create a new replacer until r and rr have all the needed values, because this function copies those values into the replacer. rr may be nil if it is not available. emptyValue should be the string that is used in place of empty string (can still be empty string).

Source Files

Jump to

Keyboard shortcuts

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