report

package
v3.13.1 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: Apache-2.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package report contains CLI error reporting and handling and cleanup methods. This is mostly required due to the impossibility to catch `os.Exit`s (https://stackoverflow.com/questions/39509447/trap-os-exit-in-golang) and other funkiness around error paths.

This package currently only tracks the m3o platform calls. Please use `1` event values for failure and `0` for success to be consistent in our Google Analytics alerts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(ctx *cli.Context, a ...interface{})

Error is a helper function to record error events

func Errorf

func Errorf(ctx *cli.Context, format string, a ...interface{})

Errorf is a helper function to record error events

func Success

func Success(ctx *cli.Context, a ...interface{})

Success is a helper function to record success events

func Successf

func Successf(ctx *cli.Context, format string, a ...interface{})

Successf is a helper function to record success events

func TrackEvent

func TrackEvent(ctx *cli.Context, td TrackingData) error

TrackEvent records an event on google analytics For details consult https://support.google.com/analytics/answer/1033068?hl=en

Example: Category: "Videos" Action: "Downloaded" Label: "Gone With the Wind"

Types

type TrackingData

type TrackingData struct {
	Category string
	Action   string
	Label    string
	UserID   string
	Value    *uint64
}

Jump to

Keyboard shortcuts

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