exec

package
v0.0.0-...-88fc132 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2026 License: Apache-2.0 Imports: 11 Imported by: 1 module, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ContextKey = contextKey("context")
View Source
var ErrorKey = errorKey("error")

Functions

func CreateInitialSpan

func CreateInitialSpan(method, uri string) *tracing.Span

CreateInitialSpan constructs the first span for the trace.

Types

type Context

type Context struct {
	Method     string            `json:"method,omitempty"`
	URI        string            `json:"uri,omitempty"`
	StatusCode int               `json:"statusCode,omitempty"`
	Status     string            `json:"status,omitempty"`
	Error      string            `json:"error,omitempty"`
	ElapsedMs  int               `json:"elapsedMs,omitempty"`
	StartTime  time.Time         `json:"startTime,omitempty"`
	Auth       *jwt.Claims       `json:"auth,omitempty"`
	Header     map[string]string `json:"header,omitempty"`
	Metrics    response.Metrics  `json:"metrics,omitempty"`
	TraceID    string            `json:"traceId,omitempty"`
	Trace      *tracing.Trace    `json:"-"`

	IgnoreEmptyQueryParameters bool `json:"-"`
	// contains filtered or unexported fields
}

Context represents an execution context

func GetContext

func GetContext(ctx context.Context) *Context

func NewContext

func NewContext(method string, URI string, header http.Header, version string) *Context

NewContext creates a new context

func (*Context) AppendJob

func (c *Context) AppendJob(job *async.Job)

func (*Context) AppendMetrics

func (c *Context) AppendMetrics(metrics *response.Metric)

func (*Context) AsyncCreationTime

func (c *Context) AsyncCreationTime() *time.Time

func (*Context) AsyncElapsed

func (c *Context) AsyncElapsed() time.Duration

func (*Context) AsyncEndTime

func (c *Context) AsyncEndTime() *time.Time

func (*Context) AsyncStatus

func (c *Context) AsyncStatus() string

func (*Context) Elapsed

func (c *Context) Elapsed() time.Duration

func (*Context) EndTime

func (c *Context) EndTime() time.Time

func (*Context) SetError

func (c *Context) SetError(err error)

func (*Context) SetValue

func (c *Context) SetValue(key string, value interface{})

func (*Context) SnapshotForLogging

func (c *Context) SnapshotForLogging() *Context

SnapshotForLogging creates a concurrency-safe snapshot of the context that can be used for logging and tracing without holding internal locks. It performs a shallow copy of the Context and deep copies of maps/slices that are traversed by JSON marshalling or ToSpans.

func (*Context) Value

func (c *Context) Value(key string) (interface{}, bool)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL