forked from TrueCloudLab/frostfs-api-go
3844a3ac74
Return `AnnounceIntermediateResultResponse` instead of `AnnounceIntermediateResultRequest` from `rpc.AnnounceIntermediateResult`. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
46 lines
1.4 KiB
Go
46 lines
1.4 KiB
Go
package rpc
|
|
|
|
import (
|
|
"github.com/nspcc-dev/neofs-api-go/rpc/client"
|
|
"github.com/nspcc-dev/neofs-api-go/rpc/common"
|
|
"github.com/nspcc-dev/neofs-api-go/v2/reputation"
|
|
)
|
|
|
|
const serviceReputation = serviceNamePrefix + "reputation.ReputationService"
|
|
|
|
const (
|
|
rpcReputationAnnounceLocalTrust = "AnnounceLocalTrust"
|
|
rpcReputationAnnounceIntermediateResult = "AnnounceIntermediateResult"
|
|
)
|
|
|
|
// AnnounceLocalTrust executes ReputationService.AnnounceLocalTrust RPC.
|
|
func AnnounceLocalTrust(
|
|
cli *client.Client,
|
|
req *reputation.AnnounceLocalTrustRequest,
|
|
opts ...client.CallOption,
|
|
) (*reputation.AnnounceLocalTrustResponse, error) {
|
|
resp := new(reputation.AnnounceLocalTrustResponse)
|
|
|
|
err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceReputation, rpcReputationAnnounceLocalTrust), req, resp, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return resp, nil
|
|
}
|
|
|
|
// AnnounceIntermediateResult executes ReputationService.AnnounceIntermediateResult RPC.
|
|
func AnnounceIntermediateResult(
|
|
cli *client.Client,
|
|
req *reputation.AnnounceIntermediateResultRequest,
|
|
opts ...client.CallOption,
|
|
) (*reputation.AnnounceIntermediateResultResponse, error) {
|
|
resp := new(reputation.AnnounceIntermediateResultResponse)
|
|
|
|
err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceReputation, rpcReputationAnnounceIntermediateResult), req, resp, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return resp, nil
|
|
}
|