Documentation ¶
Overview ¶
Package rkginctx defines utility functions and variables used by Gin middleware
Index ¶
- func AddHeaderToClient(ctx *gin.Context, key, value string)
- func EndTraceSpan(ctx *gin.Context, span trace.Span, success bool)
- func GetCsrfToken(ctx *gin.Context) string
- func GetEntryName(ctx *gin.Context) string
- func GetEvent(ctx *gin.Context) rkquery.Event
- func GetIncomingHeaders(ctx *gin.Context) http.Header
- func GetJwtToken(ctx *gin.Context) *jwt.Token
- func GetLogger(ctx *gin.Context) *zap.Logger
- func GetRequestId(ctx *gin.Context) string
- func GetTraceId(ctx *gin.Context) string
- func GetTraceSpan(ctx *gin.Context) trace.Span
- func GetTracer(ctx *gin.Context) trace.Tracer
- func GetTracerPropagator(ctx *gin.Context) propagation.TextMapPropagator
- func GetTracerProvider(ctx *gin.Context) trace.TracerProvider
- func InjectSpanToHttpRequest(ctx *gin.Context, req *http.Request)
- func NewTraceSpan(ctx *gin.Context, name string) trace.Span
- func SetHeaderToClient(ctx *gin.Context, key, value string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddHeaderToClient ¶ added in v1.2.0
AddHeaderToClient headers that would be sent to client. Values would be merged.
func EndTraceSpan ¶ added in v1.2.0
EndTraceSpan end span
func GetCsrfToken ¶ added in v1.2.11
GetCsrfToken return csrf token if exists
func GetEntryName ¶ added in v1.2.0
GetEntryName extract entry name from context.
func GetIncomingHeaders ¶ added in v1.2.0
GetIncomingHeaders extract call-scoped incoming headers
func GetJwtToken ¶ added in v1.2.11
GetJwtToken return jwt.Token if exists
func GetRequestId ¶ added in v1.2.0
GetRequestId extract request id from context. If user enabled meta interceptor, then a random request Id would e assigned and set to context as value. If user called AddHeaderToClient() with key of RequestIdKey, then a new request id would be updated.
func GetTraceId ¶ added in v1.2.0
GetTraceId extract trace id from context.
func GetTraceSpan ¶ added in v1.2.0
GetTraceSpan extract the call-scoped span from context.
func GetTracerPropagator ¶ added in v1.2.0
func GetTracerPropagator(ctx *gin.Context) propagation.TextMapPropagator
GetTracerPropagator extract takes the call-scoped propagator from middleware.
func GetTracerProvider ¶ added in v1.2.0
func GetTracerProvider(ctx *gin.Context) trace.TracerProvider
GetTracerProvider extract the call-scoped tracer provider from context.
func InjectSpanToHttpRequest ¶ added in v1.2.0
InjectSpanToHttpRequest inject span to http request
func NewTraceSpan ¶ added in v1.2.0
NewTraceSpan start a new span
func SetHeaderToClient ¶ added in v1.2.0
SetHeaderToClient headers that would be sent to client. Values would be overridden.
Types ¶
This section is empty.