mirror of
https://github.com/pomerium/pomerium.git
synced 2025-04-30 10:56:28 +02:00
26 lines
428 B
Go
26 lines
428 B
Go
package reporter
|
|
|
|
import (
|
|
"go.opentelemetry.io/otel/sdk/metric"
|
|
)
|
|
|
|
type config struct {
|
|
producers []metric.Producer
|
|
}
|
|
|
|
type Option func(*config)
|
|
|
|
// WithProducer adds a metric producer to the reporter
|
|
func WithProducer(p metric.Producer) Option {
|
|
return func(c *config) {
|
|
c.producers = append(c.producers, p)
|
|
}
|
|
}
|
|
|
|
func getConfig(opts ...Option) config {
|
|
var c config
|
|
for _, opt := range opts {
|
|
opt(&c)
|
|
}
|
|
return c
|
|
}
|