MCPcopy Create free account
hub / github.com/algolia/cli / GetEventMetadata

Function GetEventMetadata

pkg/telemetry/telemetry.go:162–168  ·  view source on GitHub ↗

GetEventMetadata returns the CLIAnalyticsEventMetadata from the provided context

(ctx context.Context)

Source from the content-addressed store, hash-verified

160
161// GetEventMetadata returns the CLIAnalyticsEventMetadata from the provided context
162func GetEventMetadata(ctx context.Context) *CLIAnalyticsEventMetadata {
163 metadata := ctx.Value(telemetryMetadataKey{})
164 if metadata != nil {
165 return metadata.(*CLIAnalyticsEventMetadata)
166 }
167 return nil
168}
169
170// WithTelemetryClient returns a new copy of context.Context with the provided telemetryClient
171func WithTelemetryClient(ctx context.Context, client TelemetryClient) context.Context {

Callers 8

applyStoredIdentityFunction · 0.92
ExecuteFunction · 0.92
trackCommandCompletedFunction · 0.92
TestEventMetadataWithGetFunction · 0.85
IdentifyMethod · 0.85
TrackMethod · 0.85

Calls

no outgoing calls

Tested by 2

TestEventMetadataWithGetFunction · 0.68