contrib/gin-gonic/gin
Those integration are enabled by having the
following import
in the project’s orchestrion.tool.go
file:
import (
_ "github.com/DataDog/orchestrion"
_ "github.com/DataDog/dd-trace-go/contrib/gin-gonic/gin/v2" // integration
//...
)
Gin is a web framework written in Go.
New
One of
- Call to
gin.Default
- Call to
gin.New
Replace the expression using the template:
// Using the following synthetic imports:
import (
gin "github.com/gin-gonic/gin"
gintrace "github.com/DataDog/dd-trace-go/contrib/gin-gonic/gin/v2"
)
func() *gin.Engine {
e := {{ . }}
e.Use(gintrace.Middleware(""))
return e
}()
gin.Context.[Must]Bind
Function body
- One of
- Function declaration
- Is method of
*gin.Context
- Function name
Bind
- Function declaration
- Is method of
*gin.Context
- Function name
ShouldBind
- Function declaration
- Is method of
*gin.Context
- Function name
BindJSON
- Function declaration
- Is method of
*gin.Context
- Function name
ShouldBindJSON
- Function declaration
- Is method of
*gin.Context
- Function name
BindTOML
- Function declaration
- Is method of
*gin.Context
- Function name
ShouldBindTOML
- Function declaration
- Is method of
*gin.Context
- Function name
BindYAML
- Function declaration
- Is method of
*gin.Context
- Function name
ShouldBindYAML
- Function declaration
- Is method of
*gin.Context
- Function name
BindXML
- Function declaration
- Is method of
*gin.Context
- Function name
ShouldBindXML
Prepend statements produced by the following template:
// Using the following synthetic imports:
import (
appsec "github.com/DataDog/dd-trace-go/v2/appsec"
)
{{- $c := .Function.Receiver -}}
{{- $i := .Function.Argument 0 -}}
{{- $err := .Function.Result 0 -}}
defer func() {
if {{ $err }} != nil {
return
}
{{ $err }} = appsec.MonitorParsedHTTPBody({{ $c }}.Request.Context(), {{ $i }})
}()
Response.Body
Function body
- One of
- Function declaration
- Is method of
*gin.Context
- Function name
AsciiJSON
- Function declaration
- Is method of
*gin.Context
- Function name
IndentedJSON
- Function declaration
- Is method of
*gin.Context
- Function name
JSON
- Function declaration
- Is method of
*gin.Context
- Function name
JSONP
- Function declaration
- Is method of
*gin.Context
- Function name
PureJSON
- Function declaration
- Is method of
*gin.Context
- Function name
SecureJSON
- Function declaration
- Is method of
*gin.Context
- Function name
XML
- Function declaration
- Is method of
*gin.Context
- Function name
YAML
- Function declaration
- Is method of
*gin.Context
- Function name
TOML
- Function declaration
- Is method of
*gin.Context
- Function name
ProtoBuf
Prepend statements produced by the following template:
// Using the following synthetic imports:
import (
appsec "github.com/DataDog/dd-trace-go/v2/appsec"
)
{{- $c := .Function.Receiver -}}
{{- $i := .Function.Argument 1 -}}
if __err__ := appsec.MonitorHTTPResponseBody({{ $c }}.Request.Context(), {{ $i }}); __err__ != nil {
// Request has been blocked by AppSec; aborting this handler right away. The AppSec
// handlers in the middleware chain will send the configured blocking response.
return
}