Gin is a web framework written in Golang. It features a Martini-like API with much better performance -- up to 40 times faster. If you need smashing performance, get yourself some Gin.
+0.00%
+0.00%
+0.00%
+0.00%
+0.00%
+0.00%
+0.00%
+0.00%
+0.00%
thinkerou on master
chore(deps): bump github.com/st… (compare)
dependabot[bot] on go_modules
err = autotls.Run(r, "api.myvaliddomain.com")
Go Gin reCAPTCHA Example (v2 & v3)
Hey folks, I am fairly new into Go, and Gin. I am trying to figure out how to do the following
// I need to do this
if validate, ok := binding.Validator.Engine().(*validator.Validate); ok {
validate.RegisterTagNameFunc(jsonTagName)
}
But I would like to do it at the router level
router := gin.New()
// can I do the binding validator thingy using `router` somehow?
binding.Validator
singleton setup
go get -u github.com/gin-gonic/gin
# cd .; git clone -- https://gopkg.in/yaml.v2 /Users/jt/golib/src/gopkg.in/yaml.v2
Cloning into '/Users/jt/golib/src/gopkg.in/yaml.v2'...
fatal: unable to access 'https://gopkg.in/yaml.v2/': SSL certificate problem: certificate has expired
package gopkg.in/yaml.v2: exit status 128
go get github.com/gin-contrib/sessions
is returning ../../go/pkg/mod/github.com/gin-contrib/sessions@v0.0.4/session_options_go1.10.go:1:1: expected 'package', found 'EOF'
Hi
I am writing a simple API with gin. routes / request / response all good. Now, i am trying to add some debugs into the route. I know i can log.Print()
the messages, but with that, i will not have the context (request id, request body / method etc). I tried looking up a logger middleware that can accept any debug message (log.Print("Working on request" + param.Request.Body)
).. but i can't seem to find any. All that said, question: How i can print debug message within a route, such that it has the context, and any debug messages i left in the route? Any example would be great!
Thanks