Documentation ¶
Overview ¶
Package requestcontext defines a utility to enhance context information from HTTP request information
Index ¶
- Constants
- func ActionFromContext(ctx context.Context) (*string, error)
- func ApplicationFromContext(ctx context.Context) (*string, error)
- func RPCRequestIDFromContext(ctx context.Context) (*any, error)
- func SpanIDFromContext(ctx context.Context) (*string, error)
- func UserFromContext(ctx context.Context) (*string, error)
- type AuthConfig
Constants ¶
View Source
const ( UserContextKey entities.ContextKey = "X-Auth-User-Id" ApplicationContextKey entities.ContextKey = "X-Auth-Application-Id" ActionContextKey entities.ContextKey = "X-Action-Id" RPCRequestIDKey entities.ContextKey = "X-RPC-Request-Id" TraceParentTraceIDContextKey entities.ContextKey = "traceparent.trace.id" TraceParentSpanIDContextKey entities.ContextKey = "traceparent.span.id" )
Variables ¶
This section is empty.
Functions ¶
func ActionFromContext ¶
ActionFromContext returns actionID from context or an error if it fails
func ApplicationFromContext ¶
ApplicationFromContext returns application from context or an error if it fails
func RPCRequestIDFromContext ¶
RPCRequestIDFromContext returns requestID from context or an error if it fails
func SpanIDFromContext ¶
SpanIDFromContext returns spanID from context or an error if it fails
Types ¶
type AuthConfig ¶
type AuthConfig struct { // UserRequestHeader is the key in the header for the user id UserRequestHeader entities.ContextKey // ApplicationRequestHeader is the key in the header for the application id ApplicationRequestHeader entities.ContextKey }
AuthConfig information on the user and application authorized in the http request as headers
Click to show internal directories.
Click to hide internal directories.