web

package
v0.0.0-...-54e2a34 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddSpan

func AddSpan(ctx context.Context, spanName string, keyValues ...attribute.KeyValue) (context.Context, trace.Span)

AddSpan adds a OpenTelemetry span to the trace and context.

func GetTime

func GetTime(ctx context.Context) time.Time

func GetTraceID

func GetTraceID(ctx context.Context) string

GetTraceID returns the trace id from the context.

func SetValues

func SetValues(ctx context.Context, v *Values) context.Context

SetValues set web values to the context.

Types

type Values

type Values struct {
	TraceID string
	Tracer  trace.Tracer
	Now     time.Time
}

Values represent state for each request.

func GetValues

func GetValues(ctx context.Context) *Values

GetValues returns the values from the context.

Jump to

Keyboard shortcuts

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