1. The problem I’m having:
after I write a plugin for caddy, I want to assign some variables in Caddyfile
the code just like this
repl := r.Context().Value(caddy.ReplacerCtxKey).(*caddy.Replacer)
repl.Set("geoip2.subdivisions", record.Subdivisions)
the value record.Subdivisions is just like
[]struct {
Locales []string `json:"locales"`
Confidence uint16 `maxminddb:"confidence"`
GeoNameID uint `maxminddb:"geoname_id"`
IsoCode string `maxminddb:"iso_code"`
Names map[string]string `maxminddb:"names"`
} `maxminddb:"subdivisions"`
so how can I. get the element in geoip2.subdivisions in caddyfile ?
just like
header geoip2_subdivisions_iso_code geoip2.subdivisions[0]["iso_code"]
but it is not works.
2. Error messages and/or full log output:
N/A
3. Caddy version:
2.6.4
4. How I installed and ran Caddy:
a. System environment:
Mac OS Ventura