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

Method Set

replacer.go:92–96  ·  view source on GitHub ↗

Set sets a custom variable to a static value.

(variable string, value any)

Source from the content-addressed store, hash-verified

90
91// Set sets a custom variable to a static value.
92func (r *Replacer) Set(variable string, value any) {
93 r.mapMutex.Lock()
94 r.static[variable] = value
95 r.mapMutex.Unlock()
96}
97
98// Get gets a value from the replacer. It returns
99// the value and whether the variable was known.

Callers 15

newReplacerMethod · 0.95
TestHeaderMatcherFunction · 0.95
TestQueryMatcherFunction · 0.95
TestRewriteFunction · 0.95
doActiveHealthCheckMethod · 0.95
serveHTTPMethod · 0.45
handleErrorMethod · 0.45
handleConfigFunction · 0.45

Calls

no outgoing calls

Tested by 9

TestHeaderMatcherFunction · 0.76
TestQueryMatcherFunction · 0.76
TestRewriteFunction · 0.76
TestReplacerSetFunction · 0.36
BenchmarkReplacerFunction · 0.36