Documentation ¶
Overview ¶
Package rkechoctx defines utility functions and variables used by Echo middleware
Index ¶
- func AddHeaderToClient(ctx echo.Context, key, value string)
- func EndTraceSpan(ctx echo.Context, span trace.Span, success bool)
- func GetCsrfToken(ctx echo.Context) string
- func GetCursor(ctx echo.Context) *rkcursor.Cursor
- func GetEntryName(ctx echo.Context) string
- func GetEvent(ctx echo.Context) rkquery.Event
- func GetIncomingHeaders(ctx echo.Context) http.Header
- func GetJwtToken(ctx echo.Context) *jwt.Token
- func GetLogger(ctx echo.Context) *zap.Logger
- func GetRequestId(ctx echo.Context) string
- func GetTraceId(ctx echo.Context) string
- func GetTraceSpan(ctx echo.Context) trace.Span
- func GetTracer(ctx echo.Context) trace.Tracer
- func GetTracerPropagator(ctx echo.Context) propagation.TextMapPropagator
- func GetTracerProvider(ctx echo.Context) trace.TracerProvider
- func GormCtx(ctx echo.Context) context.Context
- func InjectSpanToHttpRequest(ctx echo.Context, req *http.Request)
- func NewTraceSpan(ctx echo.Context, name string) trace.Span
- func SetHeaderToClient(ctx echo.Context, key, value string)
- func SetPointerCreator(creator rkcursor.PointerCreator)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddHeaderToClient ¶
func AddHeaderToClient(ctx echo.Context, key, value string)
AddHeaderToClient headers that would be sent to client. Values would be merged.
func EndTraceSpan ¶
EndTraceSpan end span
func GetCsrfToken ¶
func GetCsrfToken(ctx echo.Context) string
GetCsrfToken return csrf token if exists
func GetEntryName ¶
func GetEntryName(ctx echo.Context) string
GetEntryName extract entry name from context.
func GetEvent ¶
func GetEvent(ctx echo.Context) rkquery.Event
GetEvent extract takes the call-scoped EventData from middleware.
func GetIncomingHeaders ¶
GetIncomingHeaders extract call-scoped incoming headers
func GetJwtToken ¶
func GetJwtToken(ctx echo.Context) *jwt.Token
GetJwtToken return jwt.Token if exists
func GetRequestId ¶
func GetRequestId(ctx echo.Context) string
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 ¶
func GetTraceId(ctx echo.Context) string
GetTraceId extract trace id from context.
func GetTraceSpan ¶
GetTraceSpan extract the call-scoped span from context.
func GetTracerPropagator ¶
func GetTracerPropagator(ctx echo.Context) propagation.TextMapPropagator
GetTracerPropagator extract takes the call-scoped propagator from middleware.
func GetTracerProvider ¶
func GetTracerProvider(ctx echo.Context) trace.TracerProvider
GetTracerProvider extract the call-scoped tracer provider from context.
func InjectSpanToHttpRequest ¶
InjectSpanToHttpRequest inject span to http request
func NewTraceSpan ¶
NewTraceSpan start a new span
func SetHeaderToClient ¶
func SetHeaderToClient(ctx echo.Context, key, value string)
SetHeaderToClient headers that would be sent to client. Values would be overridden.
func SetPointerCreator ¶ added in v1.2.14
func SetPointerCreator(creator rkcursor.PointerCreator)
SetPointerCreator override rkcursor.PointerCreator
Types ¶
This section is empty.