Documentation ¶
Index ¶
- Variables
- func MergeTags(tags0, tags1 []string) []string
- type Consent
- type ConsentMechanism
- type HumbugConsent
- type HumbugReporter
- func (reporter *HumbugReporter) Publish(report Report)
- func (reporter *HumbugReporter) PublishBulk(reports []Report)
- func (reporter *HumbugReporter) SetBaseURL(baseURL string)
- func (reporter *HumbugReporter) Tag(key, modifier string)
- func (reporter *HumbugReporter) Tags() []string
- func (reporter *HumbugReporter) Untag(key, modifier string)
- type Report
- type Reporter
Constants ¶
This section is empty.
Variables ¶
var No map[string]bool = map[string]bool{ "0": false, "f": false, "n": false, "F": false, "N": false, "false": false, "no": false, "False": false, "No": false, "FALSE": false, "NO": false, }
A set of values indicating a "no"
var ShortCircuitVar string = "BUGGER_OFF"
Short circuit environment variable. Humbug will never report errors if BUGGER_OFF=true (or any) other value in the Yes set.
var Yes map[string]bool = map[string]bool{ "1": true, "t": true, "y": true, "T": true, "Y": true, "true": true, "yes": true, "True": true, "Yes": true, "TRUE": true, "YES": true, }
A set of values indicating a "yes"
Functions ¶
Types ¶
type Consent ¶
type Consent interface {
Check() bool
}
Consent is the interface that Humbug uses to determine user consent to reporting.
type ConsentMechanism ¶
type ConsentMechanism func() bool
ConsentMechanism is a report-independent means of checking user consent.
var False ConsentMechanism = func() bool { return false }
False is a consent mechanism that always indicates denied consent
var True ConsentMechanism = func() bool { return true }
True is a consent mechanism that always indicates granted consent
func EnvironmentVariableConsent ¶
func EnvironmentVariableConsent(envVar string, valueConsentMap map[string]bool, whenUndefined bool) ConsentMechanism
Reads consent from the value of the given environment variable. The valueConsentMap specifies which values for the environment variable correspond to consent or lack thereof. If the environment variable is not defined, the whenUndefined parameter determines the default behavior.
type HumbugConsent ¶
type HumbugConsent struct {
Mechanisms []ConsentMechanism
}
HumbugConsent is a concrete implementation of the Consent interface. It each of a list of consent mechanisms in order until one of them denies consent or all of them grant consent. It also includes a system-wide short circuit mechanism that a user can use to turn off all Humbug reporting (regardless of the tool that is integrated with Humbug).
func CreateHumbugConsent ¶
func CreateHumbugConsent(mechanisms ...ConsentMechanism) *HumbugConsent
func (*HumbugConsent) Check ¶
func (consent *HumbugConsent) Check() bool
type HumbugReporter ¶
type HumbugReporter struct { BaseURL string // contains filtered or unexported fields }
func CreateHumbugReporter ¶
func (*HumbugReporter) Publish ¶
func (reporter *HumbugReporter) Publish(report Report)
func (*HumbugReporter) PublishBulk ¶
func (reporter *HumbugReporter) PublishBulk(reports []Report)
func (*HumbugReporter) SetBaseURL ¶
func (reporter *HumbugReporter) SetBaseURL(baseURL string)
func (*HumbugReporter) Tag ¶
func (reporter *HumbugReporter) Tag(key, modifier string)
func (*HumbugReporter) Tags ¶
func (reporter *HumbugReporter) Tags() []string
func (*HumbugReporter) Untag ¶
func (reporter *HumbugReporter) Untag(key, modifier string)
type Report ¶
func PanicReport ¶
func PanicReport(message interface{}) Report
func SystemReport ¶
func SystemReport() Report