MCPcopy Index your code
hub / github.com/coder/coder / BaggageFromContext

Function BaggageFromContext

coderd/audit/request.go:614–627  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

612}
613
614func BaggageFromContext(ctx context.Context) WorkspaceBuildBaggage {
615 d := WorkspaceBuildBaggage{}
616 b := baggage.FromContext(ctx)
617 props := b.Member("audit").Properties()
618 for _, prop := range props {
619 switch prop.Key() {
620 case "ip":
621 d.IP, _ = prop.Value()
622 default:
623 }
624 }
625
626 return d
627}
628
629func either[T Auditable, R any](old, newVal T, fn func(T) R, auditAction database.AuditAction) R {
630 switch {

Callers 4

TestBaggageFunction · 0.92
FailJobMethod · 0.92

Calls 1

ValueMethod · 0.45

Tested by 1

TestBaggageFunction · 0.74