1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-12-24 10:07:04 +02:00
go-micro/debug/trace/options.go

35 lines
502 B
Go
Raw Normal View History

2020-01-18 12:20:46 +02:00
package trace
2020-01-29 17:45:11 +02:00
type Options struct {
// Size is the size of ring buffer
Size int
}
2020-01-18 12:20:46 +02:00
type Option func(o *Options)
type ReadOptions struct {
// Trace id
Trace string
}
type ReadOption func(o *ReadOptions)
2020-01-24 23:24:51 +02:00
2022-09-30 16:27:07 +02:00
// Read the given trace.
2020-01-24 23:24:51 +02:00
func ReadTrace(t string) ReadOption {
return func(o *ReadOptions) {
o.Trace = t
}
}
2020-01-29 17:45:11 +02:00
const (
2022-09-30 16:27:07 +02:00
// DefaultSize of the buffer.
2020-01-29 17:45:11 +02:00
DefaultSize = 64
)
2022-09-30 16:27:07 +02:00
// DefaultOptions returns default options.
2020-01-29 17:45:11 +02:00
func DefaultOptions() Options {
return Options{
Size: DefaultSize,
}
}