2021-03-12 12:57:23 +00:00
|
|
|
package rpc
|
|
|
|
|
|
|
|
import (
|
2022-12-09 11:16:24 +00:00
|
|
|
"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"
|
2021-03-12 12:57:23 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|