pixl

package
v0.6.18 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package pixl fires fire-and-forget analytics pixels to the GCS pixel bucket. Events are GET requests; the response body is discarded. Never blocks callers. No-op when PixlBaseURL is empty (local builds without the ldflag).

Index

Constants

This section is empty.

Variables

View Source
var PixlBaseURL string

PixlBaseURL is injected at build time via -ldflags. Empty → all calls no-op.

Functions

func Enabled

func Enabled() bool

func Fire

func Fire(event string, extra map[string]string)

Fire sends GET {PixlBaseURL}/{event}?params in a background goroutine. extra key=value pairs are merged on top of the standard params (v, os, arch, did). Never blocks. Never surfaces errors — analytics must not affect UX.

func Flush

func Flush(d time.Duration)

Flush waits up to d for in-flight pixel goroutines to complete. Call from main.go alongside telemetry.Flush() to avoid losing tail events when the process exits immediately after firing (e.g. taufinity update).

func Init

func Init(v string)

Init wires the version string. Call from main.go alongside telemetry.Init. Avoids a second -ldflags entry that could silently diverge from commands.Version.

Types

This section is empty.

Jump to

Keyboard shortcuts

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