fields

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	// contains filtered or unexported fields
}

Field instances are constructed via Bool, String, and so on.

"heavily influenced by" (i.e., partially stolen from) https://github.com/opentracing/opentracing-go/log

func Bool

func Bool(key string, val bool) Field

Bool adds a bool-valued key:value pair to a Span.LogFields() record

func Duration

func Duration(key string, val time.Duration) Field

Uint64 adds a uint64-valued key:value pair to a Span.LogFields() record

func Float64

func Float64(key string, val float64) Field

Float64 adds a float64-valued key:value pair to a Span.LogFields() record

func Int64

func Int64(key string, val int64) Field

/ Int64 adds an int64-valued key:value pair to a Span.LogFields() record

func String

func String(key, val string) Field

String adds a string-valued key:value pair to a Span.LogFields() record

func Uint64

func Uint64(key string, val uint64) Field

Uint64 adds a uint64-valued key:value pair to a Span.LogFields() record

func (Field) Key

func (lf Field) Key() string

Key returns the field's key.

func (Field) String

func (lf Field) String() string

String returns a string representation of the key and value.

func (Field) Value

func (lf Field) Value() interface{}

Value returns the field's value as interface{}.

type Fields

type Fields []Field

func New

func New(args ...Field) Fields

New creates a new set of fields, sorted by Key. Duplicate keys are removed.

func (*Fields) Merge

func (fs *Fields) Merge(other Fields)

Merge merges other with the current set, replacing any matching keys from other.

Jump to

Keyboard shortcuts

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