report

package
v3.15.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

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