v0.0.279 DYN-166 ginext jsonfilter middleware
Some checks failed
Build Docker and Deploy / Run goext test-suite (push) Failing after 1m12s

This commit is contained in:
2023-10-09 08:55:22 +02:00
parent 9cc0abf9e0
commit fbf4d7b915
4 changed files with 27 additions and 8 deletions

View File

@@ -109,6 +109,13 @@ func (w *GinRouteBuilder) Use(middleware ...gin.HandlerFunc) *GinRouteBuilder {
return w
}
func (w *GinRouteBuilder) WithJSONFilter(filter string) *GinRouteBuilder {
w.handlers = append(w.handlers, func(g *gin.Context) {
g.Set("ginext.jsonfilter", filter)
})
return w
}
func (w *GinRouteBuilder) Handle(handler WHandlerFunc) {
if w.routes.wrapper.bufferBody {