DelegatedAPIKeyIDFromContext returns the API key ID attached by [WithDelegatedAPIKeyID] and whether a non-empty value was set.
(ctx context.Context)
| 46 | // DelegatedAPIKeyIDFromContext returns the API key ID attached by |
| 47 | // [WithDelegatedAPIKeyID] and whether a non-empty value was set. |
| 48 | func DelegatedAPIKeyIDFromContext(ctx context.Context) (string, bool) { |
| 49 | id, ok := ctx.Value(delegatedAPIKeyIDCtxKey{}).(string) |
| 50 | return id, ok && id != "" |
| 51 | } |
| 52 | |
| 53 | // TransportFactory returns an [http.RoundTripper] that dispatches an aibridge |
| 54 | // request in-process for a given provider instance name. |