2021-03-23 18:28:05 +00:00
|
|
|
package trustcontroller
|
|
|
|
|
|
|
|
import (
|
2023-03-07 13:38:26 +00:00
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util/logger"
|
2021-03-23 18:28:05 +00:00
|
|
|
"go.uber.org/zap"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Option sets an optional parameter of Controller.
|
|
|
|
type Option func(*options)
|
|
|
|
|
|
|
|
type options struct {
|
|
|
|
log *logger.Logger
|
|
|
|
}
|
|
|
|
|
|
|
|
func defaultOpts() *options {
|
|
|
|
return &options{
|
2022-09-28 07:41:01 +00:00
|
|
|
log: &logger.Logger{Logger: zap.L()},
|
2021-03-23 18:28:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// WithLogger returns option to specify logging component.
|
|
|
|
//
|
|
|
|
// Ignores nil values.
|
|
|
|
func WithLogger(l *logger.Logger) Option {
|
|
|
|
return func(o *options) {
|
|
|
|
if l != nil {
|
|
|
|
o.log = l
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|