// NewContextStartTime creates a new context that carries the provided start // time. func NewContextStartTime(ctx context.Context, start time.Time) context.Context { return context.WithValue(ctx, ctxKeyStartTime, start) }
// NewContextRequestID creates a new context that carries the provided request // ID value. func NewContextRequestID(ctx context.Context, id string) context.Context { return context.WithValue(ctx, ctxKeyReqID, id) }
// NewContextLogger creates a new context that carries the provided logger // value. func NewContextLogger(ctx context.Context, logger log.Logger) context.Context { return context.WithValue(ctx, ctxKeyLogger, logger) }
// NewContextParams creates a new context that carries the provided params // value. func NewContextParams(ctx context.Context, params httprouter.Params) context.Context { return context.WithValue(ctx, ctxKeyParams, params) }
// NewContextComponentName creates a new context that carries the provided // componentName value. func NewContextComponentName(ctx context.Context, componentName string) context.Context { return context.WithValue(ctx, ctxKeyComponent, componentName) }