mirror of
https://github.com/caddyserver/caddy.git
synced 2026-01-17 01:30:34 +00:00
caddyhttp: Add 'map' handler (#3199)
* inital map implementation * resolve the value during middleware execution * use regex instead * pr feedback * renamed mmap to maphandler * refactored GetString implementation * fixed mispelling * additional feedback
This commit is contained in:
@@ -66,6 +66,13 @@ func (r *Replacer) Get(variable string) (interface{}, bool) {
|
||||
return nil, false
|
||||
}
|
||||
|
||||
// GetString is the same as Get, but coerces the value to a
|
||||
// string representation.
|
||||
func (r *Replacer) GetString(variable string) (string, bool) {
|
||||
s, found := r.Get(variable)
|
||||
return toString(s), found
|
||||
}
|
||||
|
||||
// Delete removes a variable with a static value
|
||||
// that was created using Set.
|
||||
func (r *Replacer) Delete(variable string) {
|
||||
|
||||
Reference in New Issue
Block a user