added template for new golang backend

This commit is contained in:
2022-11-13 19:25:44 +01:00
parent bd11d7973c
commit 0e58a5c5f0
36 changed files with 2908 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
package ginresp
import "github.com/gin-gonic/gin"
type WHandlerFunc func(*gin.Context) HTTPResponse
func Wrap(fn WHandlerFunc) gin.HandlerFunc {
return func(context *gin.Context) {
wrap := fn(context)
if context.Writer.Written() {
panic("Writing in WrapperFunc is not supported")
}
wrap.Write(context)
}
}