Documentation
¶
Index ¶
- Constants
- func Close()
- func Initialize()
- func IsEnabled() bool
- func LogOptOutStatus() map[string]interface{}
- func TrackCommand(command string, subcommand string, success bool, duration time.Duration, ...)
- func TrackCommandWithContext(cmdName string, subCmd string, context map[string]interface{}, ...) func(cmd *cobra.Command, args []string) error
- func TrackCommandWrapper(cmdName string, subCmd string, ...) func(cmd *cobra.Command, args []string) error
- func TrackError(errorMsg string, context map[string]interface{})
- func TrackEvent(event string, properties map[string]interface{})
- type Client
Constants ¶
View Source
const ( // PostHog project configuration PostHogAPIKey = "phc_oX8UUqsZVs6ifWJRTZ0yNtwTv852ccqRsk09SsZbHHb" PostHogHost = "https://us.i.posthog.com" // Event names following PostHog conventions EventCommandExecuted = "cli_command_executed" EventCommandFailed = "cli_command_failed" EventSessionStarted = "cli_session_started" EventError = "cli_error" )
Variables ¶
This section is empty.
Functions ¶
func LogOptOutStatus ¶
func LogOptOutStatus() map[string]interface{}
LogOptOutStatus provides information about analytics status for debugging
func TrackCommand ¶
func TrackCommand(command string, subcommand string, success bool, duration time.Duration, errorMsg string)
TrackCommand tracks CLI command usage
func TrackCommandWithContext ¶
func TrackCommandWithContext(cmdName string, subCmd string, context map[string]interface{}, fn func(cmd *cobra.Command, args []string) error) func(cmd *cobra.Command, args []string) error
TrackCommandWithContext wraps a command with additional context properties
func TrackCommandWrapper ¶
func TrackCommandWrapper(cmdName string, subCmd string, fn func(cmd *cobra.Command, args []string) error) func(cmd *cobra.Command, args []string) error
TrackCommandWrapper wraps a cobra command function with analytics tracking
func TrackError ¶
TrackError tracks errors with anonymized information
func TrackEvent ¶
TrackEvent sends an analytics event (no-op if opted out)
Types ¶
Click to show internal directories.
Click to hide internal directories.