mntr

package
v1.5.12 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2020 License: Apache-2.0 Imports: 10 Imported by: 45

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommitRecord

func CommitRecord(fields []*Field) string

func EventRecord

func EventRecord(namespace, evt string, fields map[string]string) *ingestion.EventRequest

func LogError

func LogError(err error, fields map[string]string)

func LogMessage

func LogMessage(_ string, fields map[string]string)

func LogRecord

func LogRecord(fields []*Field) string

func SprintCommit

func SprintCommit(_ string, fields map[string]string) string

func WriteToStdout

func WriteToStdout(record string)

Types

type ByPosition

type ByPosition []*Field

func (ByPosition) Len

func (a ByPosition) Len() int

func (ByPosition) Less

func (a ByPosition) Less(i, j int) bool

func (ByPosition) Swap

func (a ByPosition) Swap(i, j int)

type Field

type Field struct {
	Pos   uint8
	Key   string
	Value interface{}
}

func AggregateCommitFields

func AggregateCommitFields(f map[string]string) []*Field

func AggregateLogFields

func AggregateLogFields(f map[string]string) []*Field

type Monitor

type Monitor struct {
	Fields   map[string]interface{}
	OnInfo   OnMessage
	OnChange OnMessage
	OnError  OnError
	// contains filtered or unexported fields
}

func (Monitor) Changed

func (m Monitor) Changed(evt string)

func (Monitor) Debug

func (m Monitor) Debug(dbg string)

func (Monitor) Error

func (m Monitor) Error(err error)

func (Monitor) Info

func (m Monitor) Info(msg string)

func (Monitor) IsVerbose

func (m Monitor) IsVerbose() bool

func (Monitor) Verbose

func (m Monitor) Verbose() Monitor

func (Monitor) WithField

func (m Monitor) WithField(key string, value interface{}) Monitor

func (Monitor) WithFields

func (m Monitor) WithFields(add map[string]interface{}) Monitor

type OnError

type OnError func(error, map[string]string)

type OnMessage

type OnMessage func(string, map[string]string)

func Concat

func Concat(new OnMessage, original OnMessage) OnMessage

Jump to

Keyboard shortcuts

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