go-esi
go-esi is the implementation of the non-standard ESI (Edge-Side-Include) specification from the w3. With that you’ll be able to use the ESI tags and process them in your favorite golang servers.
References
https://www.w3.org/TR/esi-lang/
Install
go get -u github.com/darkweak/go-esi
Usage
import (
// ...
github.com/darkweak/go-esi/esi
)
//...
func functionToParseESITags(b []byte, r *http.Request) []byte {
// Returns the parsed response.
res := esi.Parse(b, r)
//...
return res
}
Available as middleware
- Caddy
Caddy middleware
xcaddy build --with github.com/darkweak/go-esi/middleware/caddy
Refer to the sample Caddyfile to know how to configure that.
TODO
- choose tag
- comment tag
- escape tag
- include tag
- remove tag
- otherwise tag
- try tag
- vars tag
- when tag