GetTelemetryClient returns the CLIAnalyticsEventMetadata from the provided context
(ctx context.Context)
| 174 | |
| 175 | // GetTelemetryClient returns the CLIAnalyticsEventMetadata from the provided context |
| 176 | func GetTelemetryClient(ctx context.Context) TelemetryClient { |
| 177 | client := ctx.Value(telemetryClientKey{}) |
| 178 | if client != nil { |
| 179 | return client.(TelemetryClient) |
| 180 | } |
| 181 | return nil |
| 182 | } |
| 183 | |
| 184 | // SetCobraCommandContext sets the telemetry values for the command being executed. |
| 185 | func (e *CLIAnalyticsEventMetadata) SetCobraCommandContext(cmd *cobra.Command) { |
no outgoing calls