frostfs-api-go/rpc/session.go
Leonard Lyubich 25da5d2e13 Add v2 version to go module name
Replace all elements from `v2` to root directory.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-11-17 15:29:33 +03:00

28 lines
628 B
Go

package rpc
import (
"github.com/nspcc-dev/neofs-api-go/v2/rpc/client"
"github.com/nspcc-dev/neofs-api-go/v2/rpc/common"
"github.com/nspcc-dev/neofs-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
}