diff --git a/cmd/frostfs-node/object.go b/cmd/frostfs-node/object.go index 02336bcbf1..1b9f0c8174 100644 --- a/cmd/frostfs-node/object.go +++ b/cmd/frostfs-node/object.go @@ -346,10 +346,7 @@ func createSearchSvc(c *cfg, keyStorage *util.KeyStorage, traverseGen *util.Trav } func createSearchSvcV2(sSearch *searchsvc.Service, keyStorage *util.KeyStorage) *searchsvcV2.Service { - return searchsvcV2.NewService( - searchsvcV2.WithInternalService(sSearch), - searchsvcV2.WithKeyStorage(keyStorage), - ) + return searchsvcV2.NewService(sSearch, keyStorage) } func createGetService(c *cfg, keyStorage *util.KeyStorage, traverseGen *util.TraverserGenerator, diff --git a/pkg/services/object/search/v2/service.go b/pkg/services/object/search/v2/service.go index 17e1bc7e04..78b72ac790 100644 --- a/pkg/services/object/search/v2/service.go +++ b/pkg/services/object/search/v2/service.go @@ -9,28 +9,15 @@ import ( // Service implements Search operation of Object service v2. type Service struct { - *cfg -} - -// Option represents Service constructor option. -type Option func(*cfg) - -type cfg struct { - svc *searchsvc.Service - + svc *searchsvc.Service keyStorage *objutil.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(s *searchsvc.Service, ks *objutil.KeyStorage) *Service { return &Service{ - cfg: c, + svc: s, + keyStorage: ks, } } @@ -43,18 +30,3 @@ func (s *Service) Search(req *objectV2.SearchRequest, stream objectSvc.SearchStr return s.svc.Search(stream.Context(), *p) } - -// WithInternalService returns option to set entity -// that handles request payload. -func WithInternalService(v *searchsvc.Service) Option { - return func(c *cfg) { - c.svc = v - } -} - -// WithKeyStorage returns option to set local private key storage. -func WithKeyStorage(ks *objutil.KeyStorage) Option { - return func(c *cfg) { - c.keyStorage = ks - } -}