99b31e3235
Make all operations that related to `neofs-api-go` library be placed in `v2` packages. They parse all v2-versioned structs info `neofs-sdk-go` abstractions and pass them to the corresponding `acl`/`eacl` packages. `v2` packages are the only packages that do import `neofs-api-go` library. `eacl` and `acl` provide public functions that only accepts `sdk` structures. 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"
|
|
netmapClient "github.com/nspcc-dev/neofs-node/pkg/morph/client/netmap"
|
|
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
|
|
}
|
|
}
|
|
|
|
// WithNetmapClient return option to set
|
|
// netmap client.
|
|
func WithNetmapClient(v *netmapClient.Client) 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
|
|
}
|
|
}
|