f037022a7a
Make it store its internal `zap.Logger`'s level. Also, make all the components to accept internal `logger.Logger` instead of `zap.Logger`; it will simplify future refactor. Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
51 lines
1.1 KiB
Go
51 lines
1.1 KiB
Go
package v2
|
|
|
|
import (
|
|
"github.com/nspcc-dev/neofs-node/pkg/core/container"
|
|
"github.com/nspcc-dev/neofs-node/pkg/core/netmap"
|
|
objectSvc "github.com/nspcc-dev/neofs-node/pkg/services/object"
|
|
"github.com/nspcc-dev/neofs-node/pkg/util/logger"
|
|
)
|
|
|
|
// WithLogger returns option to set logger.
|
|
func WithLogger(v *logger.Logger) Option {
|
|
return func(c *cfg) {
|
|
c.log = v
|
|
}
|
|
}
|
|
|
|
// WithNetmapSource return option to set
|
|
// netmap source.
|
|
func WithNetmapSource(v netmap.Source) Option {
|
|
return func(c *cfg) {
|
|
c.nm = v
|
|
}
|
|
}
|
|
|
|
// WithContainerSource returns option to set container source.
|
|
func WithContainerSource(v container.Source) Option {
|
|
return func(c *cfg) {
|
|
c.containers = v
|
|
}
|
|
}
|
|
|
|
// WithNextService returns option to set next object service.
|
|
func WithNextService(v objectSvc.ServiceServer) Option {
|
|
return func(c *cfg) {
|
|
c.next = v
|
|
}
|
|
}
|
|
|
|
// WithEACLChecker returns option to set eACL checker.
|
|
func WithEACLChecker(v ACLChecker) Option {
|
|
return func(c *cfg) {
|
|
c.checker = v
|
|
}
|
|
}
|
|
|
|
// WithIRFetcher returns option to set inner ring fetcher.
|
|
func WithIRFetcher(v InnerRingFetcher) Option {
|
|
return func(c *cfg) {
|
|
c.irFetcher = v
|
|
}
|
|
}
|