2022-02-11 12:25:05 +00:00
|
|
|
package v2
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/core/container"
|
2022-03-29 12:49:39 +00:00
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/core/netmap"
|
2022-02-11 12:25:05 +00:00
|
|
|
objectSvc "github.com/nspcc-dev/neofs-node/pkg/services/object"
|
|
|
|
"go.uber.org/zap"
|
|
|
|
)
|
|
|
|
|
|
|
|
// WithLogger returns option to set logger.
|
|
|
|
func WithLogger(v *zap.Logger) Option {
|
|
|
|
return func(c *cfg) {
|
|
|
|
c.log = v
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-03-29 12:49:39 +00:00
|
|
|
// WithNetmapSource return option to set
|
|
|
|
// netmap source.
|
|
|
|
func WithNetmapSource(v netmap.Source) Option {
|
2022-02-11 12:25:05 +00:00
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|