[#265] reputation/grpc: Implement setters on generated messages

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-04-01 17:24:38 +03:00 committed by Leonard Lyubich
parent 948cf3f174
commit ca2e272d42
2 changed files with 103 additions and 1 deletions

View file

@ -59,3 +59,59 @@ func (x *SendLocalTrustResponse) SetVerifyHeader(v *session.ResponseVerification
x.VerifyHeader = v x.VerifyHeader = v
} }
} }
// SetIteration sets sequence number of the iteration.
func (x *SendIntermediateResultRequest_Body) SetIteration(v uint32) {
if x != nil {
x.Iteration = v
}
}
// SetTrust sets current global trust value.
func (x *SendIntermediateResultRequest_Body) SetTrust(v *Trust) {
if x != nil {
x.Trust = v
}
}
// SetBody sets body of the request.
func (x *SendIntermediateResultRequest) SetBody(v *SendIntermediateResultRequest_Body) {
if x != nil {
x.Body = v
}
}
// SetMetaHeader sets meta header of the request.
func (x *SendIntermediateResultRequest) SetMetaHeader(v *session.RequestMetaHeader) {
if x != nil {
x.MetaHeader = v
}
}
// SetVerifyHeader sets verification header of the request.
func (x *SendIntermediateResultRequest) SetVerifyHeader(v *session.RequestVerificationHeader) {
if x != nil {
x.VerifyHeader = v
}
}
// SetBody sets body of the response.
func (x *SendIntermediateResultResponse) SetBody(v *SendIntermediateResultResponse_Body) {
if x != nil {
x.Body = v
}
}
// SetMetaHeader sets meta header of the response.
func (x *SendIntermediateResultResponse) SetMetaHeader(v *session.ResponseMetaHeader) {
if x != nil {
x.MetaHeader = v
}
}
// SetVerifyHeader sets verification header of the response.
func (x *SendIntermediateResultResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) {
if x != nil {
x.VerifyHeader = v
}
}

View file

@ -1,7 +1,18 @@
package reputation package reputation
import (
refs "github.com/nspcc-dev/neofs-api-go/v2/refs/grpc"
)
// SetValue sets binary ID.
func (x *PeerID) SetValue(v []byte) {
if x != nil {
x.Value = v
}
}
// SetPeer sets trusted peer's ID. // SetPeer sets trusted peer's ID.
func (x *Trust) SetPeer(v []byte) { func (x *Trust) SetPeer(v *PeerID) {
if x != nil { if x != nil {
x.Peer = v x.Peer = v
} }
@ -13,3 +24,38 @@ func (x *Trust) SetValue(v float64) {
x.Value = v x.Value = v
} }
} }
// SetManager sets manager ID.
func (x *GlobalTrust_Body) SetManager(v *PeerID) {
if x != nil {
x.Manager = v
}
}
// SetTrust sets global trust value.
func (x *GlobalTrust_Body) SetTrust(v *Trust) {
if x != nil {
x.Trust = v
}
}
// SetVersion sets message format version.
func (x *GlobalTrust) SetVersion(v *refs.Version) {
if x != nil {
x.Version = v
}
}
// SetBody sets message body.
func (x *GlobalTrust) SetBody(v *GlobalTrust_Body) {
if x != nil {
x.Body = v
}
}
// SetSignature sets body signature.
func (x *GlobalTrust) SetSignature(v *refs.Signature) {
if x != nil {
x.Signature = v
}
}