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

Function SourceFromContext

coderd/aibridge/factory.go:27–30  ·  view source on GitHub ↗

SourceFromContext returns the Source attached by [WithSource], or the empty string when no Source is set.

(ctx context.Context)

Source from the content-addressed store, hash-verified

25// SourceFromContext returns the Source attached by [WithSource], or the empty
26// string when no Source is set.
27func SourceFromContext(ctx context.Context) Source {
28 src, _ := ctx.Value(sourceCtxKey{}).(Source)
29 return src
30}
31
32type delegatedAPIKeyIDCtxKey struct{}
33

Callers 1

Calls 1

ValueMethod · 0.45

Tested by 1