trace

package module
v0.0.0-...-88b2801 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2016 License: Apache-2.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

trace

golang trace utility

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ZapFields

func ZapFields(err error, fields ...Field) []zap.Field

Types

type Field

type Field struct {
	Key    string
	Type   FieldType
	String string
	Int    int64
	Float  float64
	Object interface{}
}

func Float

func Float(key string, value float64) Field

func Int

func Int(key string, value int64) Field

func Object

func Object(key string, value interface{}) Field

func String

func String(key, value string) Field

type FieldType

type FieldType int
const (
	TypeString FieldType = 1
	TypeInt    FieldType = 2
	TypeFloat  FieldType = 3
	TypeObject FieldType = 4
)

type Tracer

type Tracer interface {
	Ok(event string, fields ...Field) error
	Wrap(err error, event string, fields ...Field) error
}

func FromContext

func FromContext(ctx context.Context) Tracer

Jump to

Keyboard shortcuts

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