2021-04-17 19:17:30 +00:00
|
|
|
package router
|
2021-04-02 18:16:09 +00:00
|
|
|
|
|
|
|
import (
|
2022-12-23 17:35:35 +00:00
|
|
|
"github.com/TrueCloudLab/frostfs-node/pkg/util/logger"
|
2021-04-02 18:16:09 +00:00
|
|
|
"go.uber.org/zap"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Option sets an optional parameter of Router.
|
|
|
|
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-04-02 18:16:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// WithLogger returns Option to specify logging component.
|
|
|
|
func WithLogger(l *logger.Logger) Option {
|
|
|
|
return func(o *options) {
|
|
|
|
if l != nil {
|
|
|
|
o.log = l
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|