telemetry

package
v1.10.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package telemetry registers the telemetry initialiser with the setup system. When TelemetryCmd is enabled and the user runs `init`, they are prompted to opt into anonymous usage telemetry.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FormOption

type FormOption func(*formConfig)

FormOption configures the telemetry init form for testability.

func WithForm

func WithForm(creator func(*props.Props, *bool) *huh.Form) FormOption

WithForm allows injecting a custom form creator for testing.

type TelemetryInitialiser

type TelemetryInitialiser struct {
	// contains filtered or unexported fields
}

TelemetryInitialiser implements setup.Initialiser. It prompts the user to opt into telemetry during init.

func NewTelemetryInitialiser

func NewTelemetryInitialiser(p *props.Props, opts ...FormOption) *TelemetryInitialiser

NewTelemetryInitialiser creates a new TelemetryInitialiser.

func (*TelemetryInitialiser) Configure

func (t *TelemetryInitialiser) Configure(p *props.Props, cfg config.Containable) error

Configure prompts the user to opt into telemetry. If TELEMETRY_ENABLED is set, applies it directly without prompting.

func (*TelemetryInitialiser) IsConfigured

func (t *TelemetryInitialiser) IsConfigured(cfg config.Containable) bool

IsConfigured returns true if the telemetry.enabled key has been explicitly set in config, OR if the TELEMETRY_ENABLED environment variable is set (any value counts as "configured — no prompt needed").

func (*TelemetryInitialiser) Name

func (t *TelemetryInitialiser) Name() string

Name returns the human-readable name for this initialiser.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL