forked from TrueCloudLab/frostfs-api-go
[#265] reputation: Implement converters and encoding methods on messages
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
8ce1c5efcc
commit
ccae5a40ba
4 changed files with 517 additions and 4 deletions
|
@ -5,6 +5,14 @@ import (
|
|||
reputation "github.com/nspcc-dev/neofs-api-go/v2/reputation/grpc"
|
||||
)
|
||||
|
||||
func (x *PeerID) MarshalJSON() ([]byte, error) {
|
||||
return message.MarshalJSON(x)
|
||||
}
|
||||
|
||||
func (x *PeerID) UnmarshalJSON(data []byte) error {
|
||||
return message.UnmarshalJSON(x, data, new(reputation.PeerID))
|
||||
}
|
||||
|
||||
func (x *Trust) MarshalJSON() ([]byte, error) {
|
||||
return message.MarshalJSON(x)
|
||||
}
|
||||
|
@ -12,3 +20,11 @@ func (x *Trust) MarshalJSON() ([]byte, error) {
|
|||
func (x *Trust) UnmarshalJSON(data []byte) error {
|
||||
return message.UnmarshalJSON(x, data, new(reputation.Trust))
|
||||
}
|
||||
|
||||
func (x *GlobalTrust) MarshalJSON() ([]byte, error) {
|
||||
return message.MarshalJSON(x)
|
||||
}
|
||||
|
||||
func (x *GlobalTrust) UnmarshalJSON(data []byte) error {
|
||||
return message.UnmarshalJSON(x, data, new(reputation.GlobalTrust))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue