diff --git a/cmd/frostfs-node/object.go b/cmd/frostfs-node/object.go index 43d68bdc..37dcc7b3 100644 --- a/cmd/frostfs-node/object.go +++ b/cmd/frostfs-node/object.go @@ -327,10 +327,7 @@ func createPutSvc(c *cfg, keyStorage *util.KeyStorage) *putsvc.Service { } func createPutSvcV2(sPut *putsvc.Service, keyStorage *util.KeyStorage) *putsvcV2.Service { - return putsvcV2.NewService( - putsvcV2.WithInternalService(sPut), - putsvcV2.WithKeyStorage(keyStorage), - ) + return putsvcV2.NewService(sPut, keyStorage) } func createSearchSvc(c *cfg, keyStorage *util.KeyStorage, traverseGen *util.TraverserGenerator, coreConstructor *cache.ClientCache) *searchsvc.Service { diff --git a/pkg/services/object/put/v2/service.go b/pkg/services/object/put/v2/service.go index 78655edc..db902ae5 100644 --- a/pkg/services/object/put/v2/service.go +++ b/pkg/services/object/put/v2/service.go @@ -12,27 +12,15 @@ import ( // Service implements Put operation of Object service v2. type Service struct { - *cfg -} - -// Option represents Service constructor option. -type Option func(*cfg) - -type cfg struct { svc *putsvc.Service keyStorage *util.KeyStorage } // NewService constructs Service instance from provided options. -func NewService(opts ...Option) *Service { - c := new(cfg) - - for i := range opts { - opts[i](c) - } - +func NewService(svc *putsvc.Service, ks *util.KeyStorage) *Service { return &Service{ - cfg: c, + svc: svc, + keyStorage: ks, } } @@ -52,15 +40,3 @@ func (s *Service) Put() (object.PutObjectStream, error) { func (s *Service) PutSingle(ctx context.Context, req *objectAPI.PutSingleRequest) (*objectAPI.PutSingleResponse, error) { return s.svc.PutSingle(ctx, req) } - -func WithInternalService(v *putsvc.Service) Option { - return func(c *cfg) { - c.svc = v - } -} - -func WithKeyStorage(ks *util.KeyStorage) Option { - return func(c *cfg) { - c.keyStorage = ks - } -}