2020-10-02 12:23:52 +00:00
|
|
|
package v2
|
|
|
|
|
|
|
|
import (
|
2020-12-14 12:07:20 +00:00
|
|
|
"github.com/nspcc-dev/neofs-api-go/v2/refs"
|
2020-12-15 09:06:04 +00:00
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/engine"
|
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-28 15:59:42 +00:00
|
|
|
func WithServiceResponse(resp Response, req Request) Option {
|
2020-10-02 12:23:52 +00:00
|
|
|
return func(c *cfg) {
|
|
|
|
c.msg = &responseXHeaderSource{
|
2020-12-28 15:59:42 +00:00
|
|
|
resp: resp,
|
|
|
|
req: req,
|
2020-10-02 12:23:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-12-15 09:06:04 +00:00
|
|
|
|
|
|
|
func WithAddress(v *refs.Address) Option {
|
|
|
|
return func(c *cfg) {
|
|
|
|
c.addr = v
|
|
|
|
}
|
|
|
|
}
|