structure

package
v5.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2019 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Log time (time.Time)
	TimeKey = "time"
	// Call site for log invocation (go-stack.Call)
	CallerKey = "caller"
	// Log message (string)
	MessageKey = "message"
	// Top-level component (choose one) name
	ComponentKey = "component"
	// Vector-valued scope
	ScopeKey = "scope"
	// Globally unique identifier persisting while a single instance (root process)
	// of this program/service is running
	RunId = "run_id"
	// Stack trace for log call
	StackTraceKey = "trace"
	// Logging channel, Info or Trace
	ChannelKey = "channel"
	// Go error value
	ErrorKey = "error"

	// Channels (can be used for semantic filtering through LoggingConfig)
	InfoChannel  Channel = "info"
	TraceChannel Channel = "trace"
)

Variables

This section is empty.

Functions

func MapKeyValues

func MapKeyValues(keyvals []interface{}, fn func(interface{}, interface{}) (interface{}, interface{})) []interface{}

Maps key values pairs with a function (key, value) -> (new key, new value)

func Value

func Value(keyvals []interface{}, key interface{}) interface{}

Return a single value corresponding to key in keyvals

func Vectorise

func Vectorise(keyvals []interface{}, vectorKeys ...string) []interface{}

'Vectorises' values associated with repeated string keys member by collapsing many values into a single vector value. The result is a copy of keyvals where the first occurrence of each matching key and its first value are replaced by that key and all of its values in a single slice.

Types

type Channel

type Channel string

Jump to

Keyboard shortcuts

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