Documentation
¶
Overview ¶
Package telemetry — opt-in anonymous CLI telemetry client (S65.T01).
All events are gated by NSELF_TELEMETRY_OPT_IN=1. When the env var is unset or empty, Send is a strict no-op: no HTTP is initiated, no DNS is resolved.
Events POST to ping.nself.org/telemetry as JSON. Network failures are silently dropped (logged at DEBUG level). The CLI never blocks: each Send call dispatches a goroutine with a 1-second context deadline.
Privacy invariant: payloads MUST NOT contain email addresses, file paths, project names, license keys, or any user-identifying string. Only anonymous IDs and categorical values are permitted.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsOptedIn ¶
func IsOptedIn() bool
IsOptedIn returns true only when NSELF_TELEMETRY_OPT_IN=1 is set. This is a strict opt-in: the absence of the variable means no telemetry.
func Send ¶
Send dispatches an anonymous telemetry event to ping.nself.org in a background goroutine. It returns immediately regardless of network conditions.
Opt-in gate: if NSELF_TELEMETRY_OPT_IN != "1" this function is a complete no-op. Call site opt-in check: callers SHOULD check IsOptedIn() before building props to avoid unnecessary allocations, but Send itself is always safe to call without the guard — it will no-op internally.
Types ¶
This section is empty.