Versions in this module Expand all Collapse all v1 v1.0.0 Sep 22, 2026 Changes in this version + var ContextKey = contextKey("xdatly_exec_context") + func WithContext(ctx context.Context, execCtx *Context) context.Context + type Context struct + ElapsedMs int + Error string + Header map[string]string + Method string + Metrics response.Metrics + StartTime time.Time + Status string + StatusCode int + Trace *tracing.Trace + TraceID string + URI string + func GetContext(ctx context.Context) *Context + func New(options ...Option) *Context + func NewContext(method string, URI string, header http.Header, version string) *Context + func NewHTTPContext(method string, URI string, header http.Header, version string) *Context + func PrepareLogging(ctx *Context, includeSQL bool) (*Context, *tracing.Trace) + func (c *Context) AppendMetrics(metric *response.Metric) + func (c *Context) Complete(end time.Time, err error) + func (c *Context) SetError(err error) + func (c *Context) SetValue(key string, value any) + func (c *Context) SnapshotForLogging() *Context + func (c *Context) Value(key string) (any, bool) + type Option func(*Context) + func WithHeaders(header map[string]string) Option + func WithMethod(method string) Option + func WithStartTime(start time.Time) Option + func WithStatus(status string) Option + func WithStatusCode(code int) Option + func WithTrace(trace *tracing.Trace) Option + func WithTraceResource(serviceName, serviceVersion string) Option + func WithURI(uri string) Option