Refactor debug/trace ready for Jaeger

This commit is contained in:
Micro
2020-01-29 15:45:11 +00:00
parent 1108cc5e91
commit 62c067adcd
10 changed files with 130 additions and 36 deletions

View File

@@ -1,6 +1,9 @@
package trace
type Options struct{}
type Options struct {
// Size is the size of ring buffer
Size int
}
type Option func(o *Options)
@@ -17,3 +20,15 @@ func ReadTrace(t string) ReadOption {
o.Trace = t
}
}
const (
// DefaultSize of the buffer
DefaultSize = 64
)
// DefaultOptions returns default options
func DefaultOptions() Options {
return Options{
Size: DefaultSize,
}
}