forked from TrueCloudLab/frostfs-node
[#425] services: Define service interfaces that was removed from API lib
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
e6f945e61d
commit
718a2fad26
29 changed files with 107 additions and 42 deletions
|
@ -17,13 +17,13 @@ type ServiceExecutor interface {
|
|||
}
|
||||
|
||||
type executorSvc struct {
|
||||
container.Service
|
||||
Server
|
||||
|
||||
exec ServiceExecutor
|
||||
}
|
||||
|
||||
// NewExecutionService wraps ServiceExecutor and returns Container Service interface.
|
||||
func NewExecutionService(exec ServiceExecutor) container.Service {
|
||||
func NewExecutionService(exec ServiceExecutor) Server {
|
||||
return &executorSvc{
|
||||
exec: exec,
|
||||
}
|
||||
|
|
|
@ -11,12 +11,12 @@ import (
|
|||
type responseService struct {
|
||||
respSvc *response.Service
|
||||
|
||||
svc container.Service
|
||||
svc Server
|
||||
}
|
||||
|
||||
// NewResponseService returns container service instance that passes internal service
|
||||
// call to response service.
|
||||
func NewResponseService(cnrSvc container.Service, respSvc *response.Service) container.Service {
|
||||
func NewResponseService(cnrSvc Server, respSvc *response.Service) Server {
|
||||
return &responseService{
|
||||
respSvc: respSvc,
|
||||
svc: cnrSvc,
|
||||
|
|
18
pkg/services/container/server.go
Normal file
18
pkg/services/container/server.go
Normal file
|
@ -0,0 +1,18 @@
|
|||
package container
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/nspcc-dev/neofs-api-go/v2/container"
|
||||
)
|
||||
|
||||
// Server is an interface of the NeoFS API Container service server
|
||||
type Server interface {
|
||||
Put(context.Context, *container.PutRequest) (*container.PutResponse, error)
|
||||
Get(context.Context, *container.GetRequest) (*container.GetResponse, error)
|
||||
Delete(context.Context, *container.DeleteRequest) (*container.DeleteResponse, error)
|
||||
List(context.Context, *container.ListRequest) (*container.ListResponse, error)
|
||||
SetExtendedACL(context.Context, *container.SetExtendedACLRequest) (*container.SetExtendedACLResponse, error)
|
||||
GetExtendedACL(context.Context, *container.GetExtendedACLRequest) (*container.GetExtendedACLResponse, error)
|
||||
AnnounceUsedSpace(context.Context, *container.AnnounceUsedSpaceRequest) (*container.AnnounceUsedSpaceResponse, error)
|
||||
}
|
|
@ -11,10 +11,10 @@ import (
|
|||
type signService struct {
|
||||
sigSvc *util.SignService
|
||||
|
||||
svc container.Service
|
||||
svc Server
|
||||
}
|
||||
|
||||
func NewSignService(key *ecdsa.PrivateKey, svc container.Service) container.Service {
|
||||
func NewSignService(key *ecdsa.PrivateKey, svc Server) Server {
|
||||
return &signService{
|
||||
sigSvc: util.NewUnarySignService(key),
|
||||
svc: svc,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue