frostfs-api-go/rpc/session.go
Evgenii Stratonikov 1351b6656d Move to frostfs-api
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2022-12-12 17:40:48 +03:00

28 lines
643 B
Go

package rpc
import (
"github.com/TrueCloudLab/frostfs-api-go/v2/rpc/client"
"github.com/TrueCloudLab/frostfs-api-go/v2/rpc/common"
"github.com/TrueCloudLab/frostfs-api-go/v2/session"
)
const serviceSession = serviceNamePrefix + "session.SessionService"
const (
rpcSessionCreate = "Create"
)
func CreateSession(
cli *client.Client,
req *session.CreateRequest,
opts ...client.CallOption,
) (*session.CreateResponse, error) {
resp := new(session.CreateResponse)
err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceSession, rpcSessionCreate), req, resp, opts...)
if err != nil {
return nil, err
}
return resp, nil
}