frostfs-node/pkg/services/object/acl/eacl/v2/opts.go
Pavel Karpy 99b31e3235 [#1111] object/acl: Refactor service
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>
2022-03-05 10:06:14 +03:00

43 lines
751 B
Go

package v2
import (
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/engine"
addressSDK "github.com/nspcc-dev/neofs-sdk-go/object/address"
)
func WithObjectStorage(v ObjectStorage) Option {
return func(c *cfg) {
c.storage = v
}
}
func WithLocalObjectStorage(v *engine.StorageEngine) Option {
return func(c *cfg) {
c.storage = &localStorage{
ls: v,
}
}
}
func WithServiceRequest(v Request) Option {
return func(c *cfg) {
c.msg = &requestXHeaderSource{
req: v,
}
}
}
func WithServiceResponse(resp Response, req Request) Option {
return func(c *cfg) {
c.msg = &responseXHeaderSource{
resp: resp,
req: req,
}
}
}
func WithAddress(v *addressSDK.Address) Option {
return func(c *cfg) {
c.addr = v
}
}