feature: dynamic scope using input arguments #23
11
handler.go
11
handler.go
|
@ -59,11 +59,14 @@ func (s Handler) resolve(w http.ResponseWriter, r *http.Request) {
|
||||||
for b, perm := range list {
|
for b, perm := range list {
|
||||||
scope[a][b] = perm
|
scope[a][b] = perm
|
||||||
for name, value := range input.Data {
|
for name, value := range input.Data {
|
||||||
scope[a][b] = strings.ReplaceAll(
|
var (
|
||||||
scope[a][b],
|
token = fmt.Sprintf("[%s]", name)
|
||||||
fmt.Sprintf("[%s]", name),
|
replacement = ""
|
||||||
fmt.Sprintf("[%v]", value),
|
|
||||||
)
|
)
|
||||||
|
if value != nil {
|
||||||
|
replacement = fmt.Sprintf("[%v]", value)
|
||||||
|
}
|
||||||
|
scope[a][b] = strings.ReplaceAll(scope[a][b], token, replacement)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue