telemetry

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlagMode      = "telemetry"
	FlagModeUsage = `enable or disable telemetry (this setting is remembered), available options: ["off", "on"]`
)

set of supported telemetry flags

View Source
const (
	EventDataKeyError = "err"
)

set of event data keys

Variables

This section is empty.

Functions

This section is empty.

Types

type EventData

type EventData struct {
	Key   string
	Value interface{}
}

EventData holds additional event information

type EventType

type EventType string

EventType is a cli event type

const (
	EventTypeCommandStart        EventType = "COMMAND_START"
	EventTypeCommandComplete     EventType = "COMMAND_COMPLETE"
	EventTypeCommandError        EventType = "COMMAND_ERROR"
	EventTypeCommandVersionCheck EventType = "COMMAND_VERSION_CHECK"
)

set of supported cli event types

type Mode

type Mode string

Mode is the Telemetry Mode

const (
	ModeEmpty  Mode = "" // zero-valued to be flag's default
	ModeOn     Mode = "on"
	ModeStdout Mode = "stdout"
	ModeOff    Mode = "off"
)

set of supported telemetry modes

func (*Mode) Set

func (m *Mode) Set(val string) error

Set validates and sets the mode value

func (Mode) String

func (m Mode) String() string

String returns the string representation

func (Mode) Type

func (m Mode) Type() string

Type returns the Mode type

type Service

type Service interface {
	TrackEvent(eventType EventType, data ...EventData)
	Close()
}

Service tracks telemetry events

func NewService

func NewService(mode Mode, userID, command, version string) Service

NewService creates a new telemetry service

type Tracker

type Tracker interface {
	Track(event event)
	Close()
}

Tracker is a telemetry event tracker

Jump to

Keyboard shortcuts

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