telemetry

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package telemetry implements telemetry to monitor the usage of the Command-Line Interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterBackend

func RegisterBackend(backend Backend)

RegisterBackend registers a backend. This function is typically called in the "init" function of backend packages.

Types

type Backend

type Backend struct {
	Protocol  string
	NewClient func(connectionString string) (Client, error)
}

Backend is a telemetry backend. Backends need to be registered with RegisterBackend.

type CLICompletion

type CLICompletion struct {
	CLIInvocation `bson:",inline"`
	Completed     time.Time `bson:"completed"`
	Err           *string   `bson:"err, omitempty"`
}

CLICompletion represents the completion of a CLI invocation.

type CLIInvocation

type CLIInvocation struct {
	CLIVersion `bson:",inline"`
	User       string    `bson:"user"`
	Started    time.Time `bson:"started"`
	Args       []string  `bson:"args"`
}

CLIInvocation represents one invocation of the CLI.

type CLIVersion

type CLIVersion struct {
	Version string `bson:"version"`
	Commit  string `bson:"commit"`
	Date    string `bson:"date"`
}

CLIVersion gives the version of the CLI.

type Client

type Client interface {
	Send(payload interface{})
	Close()
}

Client is a telemetry client.

func NewClient

func NewClient(url string) (Client, error)

NewClient creates a new telemetry client.

Directories

Path Synopsis
Package mongo implements telemetry on top of MongoDB.
Package mongo implements telemetry on top of MongoDB.

Jump to

Keyboard shortcuts

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