micro/profiler/profile.go
Evstigneev Denis 9d6a44b783
Some checks failed
lint / lint (pull_request) Has been cancelled
pr / test (pull_request) Has been cancelled
fixed struct alignment && refactor linter
2024-12-09 13:07:01 +03:00

32 lines
569 B
Go

// Package profiler is for profilers
package profiler
// Profiler interface
type Profiler interface {
// Start the profiler
Start() error
// Stop the profiler
Stop() error
// Name of the profiler
String() string
}
// DefaultProfiler holds the default profiler
var DefaultProfiler = NewProfiler()
// Options holds the options for profiler
type Options struct {
// Name to use for the profile
Name string
}
// Option func signature
type Option func(o *Options)
// Name of the profile
func Name(n string) Option {
return func(o *Options) {
o.Name = n
}
}