tracking

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2025 License: MIT Imports: 18 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ModeOffline Mode = "offline"
	ModeOnline  Mode = "online"

	EnvVarLogLevel         = "DX_LOG_LEVEL"
	EnvVarTestMode         = "DX_TEST_MODE"
	EnvVarForceOfflineMode = "DX_FORCE_OFFLINE_MODE"
	EnvVarDisableTracking  = "DISABLE_DX_TRACKING"

	MinGHCLIVersion = "v2.50.0"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DxTracker

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

DxTracker manages event tracking with automatic retry and offline support.

func (*DxTracker) Track

func (t *DxTracker) Track(event string, metadata map[string]any) error

Track queues or sends an event, automatically handling offline scenarios.

type Mode

type Mode string

Mode determines whether events are sent immediately or stored for later transmission.

type NoOpTracker

type NoOpTracker struct{}

func (*NoOpTracker) Track

func (t *NoOpTracker) Track(event string, metadata map[string]any) error

type Product

type Product = string

type Tracker

type Tracker interface {
	Track(event string, metadata map[string]any) error
}

func NewDxTracker

func NewDxTracker(APITokenVariableName string, product Product) (Tracker, error)

NewDxTracker initializes a tracker with automatic GitHub CLI integration for authentication. APITokenVariableName is the name of the GitHub repository variable containing the DX API token. Each DX project has its own token for tracking purposes.

Jump to

Keyboard shortcuts

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