2020-10-02 12:23:52 +00:00
|
|
|
package v2
|
|
|
|
|
|
|
|
import (
|
2022-12-23 17:35:35 +00:00
|
|
|
"github.com/TrueCloudLab/frostfs-node/pkg/local_object_storage/engine"
|
|
|
|
cid "github.com/TrueCloudLab/frostfs-sdk-go/container/id"
|
|
|
|
oid "github.com/TrueCloudLab/frostfs-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) {
|
2022-12-30 11:29:29 +00:00
|
|
|
c.storage = (*localStorage)(v)
|
2020-10-02 12:23:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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-31 17:00:41 +00:00
|
|
|
func WithCID(v cid.ID) Option {
|
2020-12-15 09:06:04 +00:00
|
|
|
return func(c *cfg) {
|
2022-05-31 17:00:41 +00:00
|
|
|
c.cnr = v
|
2022-05-24 18:47:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-05-31 17:00:41 +00:00
|
|
|
func WithOID(v *oid.ID) Option {
|
2022-05-24 18:47:21 +00:00
|
|
|
return func(c *cfg) {
|
2022-05-31 17:00:41 +00:00
|
|
|
c.obj = v
|
2020-12-15 09:06:04 +00:00
|
|
|
}
|
|
|
|
}
|