MCPcopy
hub / github.com/caddyserver/caddy / ReplaceAll

Method ReplaceAll

replacer.go:163–166  ·  view source on GitHub ↗

ReplaceAll efficiently replaces placeholders in input with their values. All placeholders are replaced in the output whether they are recognized or not. Values that are empty string will be substituted with empty.

(input, empty string)

Source from the content-addressed store, hash-verified

161// whether they are recognized or not. Values that are empty
162// string will be substituted with empty.
163func (r *Replacer) ReplaceAll(input, empty string) string {
164 out, _ := r.replace(input, empty, true, false, false, nil)
165 return out
166}
167
168// ReplaceFunc is the same as ReplaceAll, but calls f for every
169// replacement to be made, in case f wants to change or inspect

Callers 15

ProvisionMethod · 0.95
MatchMethod · 0.95
ProvisionMethod · 0.95
ProvisionMethod · 0.95
ProvisionMethod · 0.95
TLSConfigMethod · 0.95
ProvisionMethod · 0.95
ProvisionMethod · 0.95
TestPathREMatcherFunction · 0.95
TestHeaderREMatcherFunction · 0.95
TestVarREMatcherFunction · 0.95

Calls 1

replaceMethod · 0.95

Tested by 9

TestPathREMatcherFunction · 0.76
TestHeaderREMatcherFunction · 0.76
TestVarREMatcherFunction · 0.76
TestReplacerFunction · 0.64
BenchmarkReplacerFunction · 0.64
TestLeafFileLoaderFunction · 0.64
TestLeafFolderLoaderFunction · 0.64
TestLeafPEMLoaderFunction · 0.64
TestCaddyfileAdaptToJSONFunction · 0.64