Documentation
¶
Index ¶
Constants ¶
View Source
const (
PingIntervalSecs = 23 * 3600 // 23 hours between pings
)
Configuration
Variables ¶
View Source
var ( TelemetryURL string TelemetryToken string )
TelemetryURL and Token can be set at build time via ldflags.
Functions ¶
func Init ¶ added in v1.2.0
func Init(stats StatsProvider)
Init initializes the global telemetry client.
func IsEnabled ¶ added in v0.28.0
func IsEnabled() bool
IsEnabled returns whether telemetry is configured.
func IsOptedOut ¶ added in v1.2.0
func IsOptedOut() bool
IsOptedOut checks if telemetry is explicitly disabled.
Types ¶
type Client ¶ added in v1.2.0
type Client struct {
// contains filtered or unexported fields
}
Client handles telemetry ping operations.
func NewClient ¶ added in v1.2.0
func NewClient(stats StatsProvider) *Client
NewClient creates a new telemetry client.
type StatsProvider ¶ added in v1.2.0
type StatsProvider interface {
CountCommandsSince(since time.Time) (int64, error)
TopCommands(limit int) ([]string, error)
OverallSavingsPct() (float64, error)
TokensSaved24h() (int64, error)
TokensSavedTotal() (int64, error)
}
StatsProvider defines the interface for getting tracking stats.
Click to show internal directories.
Click to hide internal directories.