telemetry

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

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 outlines a generic structure for tracking events

type EventType

type EventType string

EventType signifies where in the command this event occurred

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

set of supported EventTypes

type NoopTracker added in v1.3.4

type NoopTracker struct{}

func (*NoopTracker) Close added in v1.3.4

func (n *NoopTracker) Close()

func (*NoopTracker) Track added in v1.3.4

func (n *NoopTracker) Track(event event)

type Service

type Service struct {
	NoTelemetry bool
	Tracker     Tracker
	// contains filtered or unexported fields
}

Service tracks telemetry events

func (*Service) Close

func (s *Service) Close()

Close shuts down the Service

func (*Service) SetUser

func (s *Service) SetUser(userID string)

SetUser sets the userID for this service to track

func (*Service) Setup

func (s *Service) Setup(command string)

Setup sets up the tracker for this service

func (*Service) TrackEvent

func (s *Service) TrackEvent(eventType EventType, data ...EventData)

TrackEvent tracks the event based on the tracker

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