2020-10-03 05:19:22 +00:00
|
|
|
package acl
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/core/container"
|
2020-10-22 12:37:59 +00:00
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/core/netmap"
|
2020-11-19 08:38:50 +00:00
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/engine"
|
2020-12-02 23:45:25 +00:00
|
|
|
objectSvc "github.com/nspcc-dev/neofs-node/pkg/services/object"
|
2020-10-03 07:46:57 +00:00
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/services/object/acl/eacl"
|
2020-10-03 05:19:22 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// WithContainerSource returns option to set container source.
|
|
|
|
func WithContainerSource(v container.Source) Option {
|
|
|
|
return func(c *cfg) {
|
|
|
|
c.containers = v
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// WithSenderClassifier returns option to set sender classifier.
|
|
|
|
func WithSenderClassifier(v SenderClassifier) Option {
|
|
|
|
return func(c *cfg) {
|
|
|
|
c.sender = v
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// WithNextService returns option to set next object service.
|
2020-12-02 23:45:25 +00:00
|
|
|
func WithNextService(v objectSvc.ServiceServer) Option {
|
2020-10-03 05:19:22 +00:00
|
|
|
return func(c *cfg) {
|
|
|
|
c.next = v
|
|
|
|
}
|
|
|
|
}
|
2020-10-03 07:46:57 +00:00
|
|
|
|
2022-01-20 09:45:58 +00:00
|
|
|
// WithEACLSource returns options to set eACL table source.
|
|
|
|
func WithEACLSource(v eacl.Source) Option {
|
2020-10-03 07:46:57 +00:00
|
|
|
return func(c *cfg) {
|
2022-01-20 09:45:58 +00:00
|
|
|
c.eACLCfg.eaclSource = v
|
2020-10-03 07:46:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// WithLocalStorage returns options to set local object storage.
|
2020-11-19 08:38:50 +00:00
|
|
|
func WithLocalStorage(v *engine.StorageEngine) Option {
|
2020-10-03 07:46:57 +00:00
|
|
|
return func(c *cfg) {
|
|
|
|
c.localStorage = v
|
|
|
|
}
|
|
|
|
}
|
2020-10-22 12:37:59 +00:00
|
|
|
|
|
|
|
// WithNetmapState returns options to set global netmap state.
|
|
|
|
func WithNetmapState(v netmap.State) Option {
|
|
|
|
return func(c *cfg) {
|
|
|
|
c.state = v
|
|
|
|
}
|
|
|
|
}
|