exec

package
v0.0.0-...-dd34b7f Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2025 License: Apache-2.0 Imports: 11 Imported by: 10

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