Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AmplitudeClient ¶
type AmplitudeClient struct {
// contains filtered or unexported fields
}
AmplitudeClient was inlfuenced by https://github.com/savaki/amplitude-go but uses the version 2 HTTP API.
func NewAmplitudeClient ¶
func (*AmplitudeClient) Close ¶
func (a *AmplitudeClient) Close()
func (*AmplitudeClient) Flush ¶
func (a *AmplitudeClient) Flush()
func (*AmplitudeClient) Publish ¶
func (a *AmplitudeClient) Publish(evt Event) error
type Event ¶
type Event struct { // Set by event constructor. Type string `json:"event_type"` EventProperties map[string]any `json:"event_properties,omitempty"` UserProperties map[string]any `json:"user_properties,omitempty"` Platform string `json:"platform,omitempty"` OSName string `json:"os_name,omitempty"` OSVersion string `json:"os_version,omitempty"` AppVersion string `json:"app_version,omitempty"` // Set by telemetry. DeviceID string `json:"device_id"` SessionID int64 `json:"session_id"` EventID int `json:"event_id"` Time int64 `json:"time"` }
func OperationsPerformedEvent ¶
func OperationsPerformedEvent(operation string, success bool, duration SummaryStatistics) Event
func SystemInfoIdentifiedEvent ¶
func SystemInfoIdentifiedEvent() Event
type Nop ¶
type Nop struct { }
func (*Nop) RecordOperation ¶
func (t *Nop) RecordOperation(_ OperationInvocation)
func (*Nop) StartSession ¶
type OperationInvocation ¶
type SummaryGauge ¶
type SummaryGauge struct {
// contains filtered or unexported fields
}
func NewSummaryGauge ¶
func NewSummaryGauge(tagLabels []string) *SummaryGauge
func (*SummaryGauge) Buckets ¶
func (g *SummaryGauge) Buckets() []taggedSummaryBucket
func (*SummaryGauge) Observe ¶
func (g *SummaryGauge) Observe(tags Tags, amount float64)
type SummaryStatistics ¶
type Telemetry ¶
type Telemetry interface { IsEnabled() bool LatestVersion(context.Context) (string, error) StartSession(context.Context) SendEvent(context.Context, Event) RecordOperation(OperationInvocation) }
func FromContext ¶
type UploadRequest ¶
Click to show internal directories.
Click to hide internal directories.