30 lines
469 B
Go
30 lines
469 B
Go
package observability
|
|
|
|
import "time"
|
|
|
|
type settings struct {
|
|
EnableStdoutExporter bool
|
|
MetricExportInterval time.Duration
|
|
}
|
|
|
|
type Option interface {
|
|
apply(*settings)
|
|
}
|
|
|
|
type enableStdoutExporter struct {
|
|
Option
|
|
}
|
|
|
|
func (setting enableStdoutExporter) apply(o *settings) {
|
|
o.EnableStdoutExporter = true
|
|
}
|
|
|
|
type exportInterval struct {
|
|
Option
|
|
interval time.Duration
|
|
}
|
|
|
|
func (setting exportInterval) apply(o *settings) {
|
|
o.MetricExportInterval = setting.interval
|
|
}
|