frostfs-node/cmd/neofs-node/session.go
Leonard Lyubich 3065a7363b [#83] cmd/neofs-node: Use response services in application
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-10-23 10:54:48 +03:00

28 lines
747 B
Go

package main
import (
"github.com/nspcc-dev/neofs-api-go/v2/session"
sessionGRPC "github.com/nspcc-dev/neofs-api-go/v2/session/grpc"
sessionTransportGRPC "github.com/nspcc-dev/neofs-node/pkg/network/transport/session/grpc"
sessionSvc "github.com/nspcc-dev/neofs-node/pkg/services/session"
"github.com/nspcc-dev/neofs-node/pkg/services/session/storage"
)
func initSessionService(c *cfg) {
c.privateTokenStore = storage.New()
sessionGRPC.RegisterSessionServiceServer(c.cfgGRPC.server,
sessionTransportGRPC.New(
sessionSvc.NewSignService(
c.key,
sessionSvc.NewResponseService(
sessionSvc.NewExecutionService(
c.privateTokenStore,
new(session.ResponseMetaHeader),
),
c.respSvc,
),
),
),
)
}