analytics

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// HeapBaseURI is the location of Heap API endpoint
	HeapBaseURI = "https://heapanalytics.com"
	// HeapAppID identifies what Heap App events are recorded against
	HeapAppID = "4248790180" // development id, overridden during `make build`

	// ConsentGiven records whether tracking consent has been given by the user
	ConsentGiven bool
)

Functions

func AsyncLogError added in v1.3.1

func AsyncLogError(ctx *kong.Context, uerr error)

AsyncLogError logs an invocation of the cli

func AsyncLogInvoke added in v1.3.1

func AsyncLogInvoke(ctx *kong.Context)

AsyncLogInvoke logs an invocation of the cli

func IsConsentRecorded

func IsConsentRecorded() (rec bool)

IsConsentRecorded returns if valid consent has been recorded for tracking

func PromptForConsent

func PromptForConsent(in io.Reader, out io.Writer) (c bool, err error)

PromptForConsent interactively prompts the user for consent

func ReadConsent

func ReadConsent(in io.Reader, out io.Writer) (c bool, err error)

ReadConsent finds if consent has been given, either from file or by prompt.

func Submit

func Submit(e Event) (err error)

Submit submits an analytics event to Section

Behavior is determined by consent:

if consent not given {
	prompt for consent
}
if consent == true {
	submit analytics
}

func WriteConsent

func WriteConsent(consent bool) (err error)

WriteConsent writes the current consent state to a persistent file

Types

type Event

type Event struct {
	Name       string
	Properties map[string]string
}

Event records an interaction with the Section CLI

Jump to

Keyboard shortcuts

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