(ctx context.Context, pluginID string)
| 74 | type hostCallbackPluginIDKey struct{} |
| 75 | |
| 76 | func withHostCallbackPluginID(ctx context.Context, pluginID string) context.Context { |
| 77 | pluginID = strings.TrimSpace(pluginID) |
| 78 | if pluginID == "" { |
| 79 | if ctx == nil { |
| 80 | return context.Background() |
| 81 | } |
| 82 | return ctx |
| 83 | } |
| 84 | if ctx == nil { |
| 85 | ctx = context.Background() |
| 86 | } |
| 87 | return context.WithValue(ctx, hostCallbackPluginIDKey{}, pluginID) |
| 88 | } |
| 89 | |
| 90 | func hostCallbackPluginIDFromContext(ctx context.Context) string { |
| 91 | if ctx == nil { |
no outgoing calls
no test coverage detected