2020-10-02 12:23:52 +00:00
|
|
|
package v2
|
|
|
|
|
|
|
|
import (
|
2020-12-15 09:06:04 +00:00
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/engine"
|
2022-02-11 12:25:05 +00:00
|
|
|
addressSDK "github.com/nspcc-dev/neofs-sdk-go/object/address"
|
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
|
|
|
|
2022-02-11 12:25:05 +00:00
|
|
|
func WithAddress(v *addressSDK.Address) Option {
|
2020-12-15 09:06:04 +00:00
|
|
|
return func(c *cfg) {
|
|
|
|
c.addr = v
|
|
|
|
}
|
|
|
|
}
|