Add debug => go-debug

This commit is contained in:
Asim Aslam
2019-05-31 01:22:19 +01:00
parent 95d134b57e
commit f2139e2a16
13 changed files with 1023 additions and 0 deletions

29
debug/trace/trace.go Normal file
View File

@@ -0,0 +1,29 @@
// Package trace provides a tracing interface
package trace
import (
"time"
)
// Trace is for request tracing
type Trace interface {
// Read the traces
Read(...ReadOption) ([]*Span, error)
// Collect traces
Collect([]*Span) error
// Name of tracer
String() string
}
type Span struct {
Id string
Name string
Trace string
Metadata map[string]string
Start time.Time
Finish time.Time
}
type ReadOptions struct{}
type ReadOption func(o *ReadOptions)