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