2020-10-02 12:23:52 +00:00
|
|
|
package v2
|
|
|
|
|
|
|
|
import (
|
2020-11-19 08:38:50 +00:00
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/engine"
|
2020-12-14 12:07:20 +00:00
|
|
|
"github.com/nspcc-dev/neofs-api-go/v2/refs"
|
2020-10-02 12:23:52 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func WithObjectStorage(v ObjectStorage) Option {
|
|
|
|
return func(c *cfg) {
|
|
|
|
c.storage = v
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-19 08:38:50 +00:00
|
|
|
func WithLocalObjectStorage(v *engine.StorageEngine) Option {
|
2020-10-02 12:23:52 +00:00
|
|
|
return func(c *cfg) {
|
|
|
|
c.storage = &localStorage{
|
|
|
|
ls: v,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func WithServiceRequest(v Request) Option {
|
|
|
|
return func(c *cfg) {
|
|
|
|
c.msg = &requestXHeaderSource{
|
|
|
|
req: v,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-14 12:07:20 +00:00
|
|
|
func WithServiceResponse(v Response, addr *refs.Address) Option {
|
2020-10-02 12:23:52 +00:00
|
|
|
return func(c *cfg) {
|
|
|
|
c.msg = &responseXHeaderSource{
|
|
|
|
resp: v,
|
2020-12-14 12:07:20 +00:00
|
|
|
addr: addr,
|
2020-10-02 12:23:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|