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-05-24 18:47:21 +00:00
|
|
|
cidSDK "github.com/nspcc-dev/neofs-sdk-go/container/id"
|
|
|
|
oidSDK "github.com/nspcc-dev/neofs-sdk-go/object/id"
|
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) {
|
2022-05-17 13:32:03 +00:00
|
|
|
c.msg = requestXHeaderSource{
|
2020-10-02 12:23:52 +00:00
|
|
|
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) {
|
2022-05-17 13:32:03 +00:00
|
|
|
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-05-24 18:47:21 +00:00
|
|
|
func WithCID(v cidSDK.ID) Option {
|
2020-12-15 09:06:04 +00:00
|
|
|
return func(c *cfg) {
|
2022-05-24 18:47:21 +00:00
|
|
|
c.cid = v
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func WithOID(v *oidSDK.ID) Option {
|
|
|
|
return func(c *cfg) {
|
|
|
|
c.oid = v
|
2020-12-15 09:06:04 +00:00
|
|
|
}
|
|
|
|
}
|