github.com/TrueCloudLab/frostfs-api-go/v2@v2.0.0-20230228134343-196241c4e79a/reputation/json.go (about)

     1  package reputation
     2  
     3  import (
     4  	reputation "github.com/TrueCloudLab/frostfs-api-go/v2/reputation/grpc"
     5  	"github.com/TrueCloudLab/frostfs-api-go/v2/rpc/message"
     6  )
     7  
     8  func (x *PeerID) MarshalJSON() ([]byte, error) {
     9  	return message.MarshalJSON(x)
    10  }
    11  
    12  func (x *PeerID) UnmarshalJSON(data []byte) error {
    13  	return message.UnmarshalJSON(x, data, new(reputation.PeerID))
    14  }
    15  
    16  func (x *Trust) MarshalJSON() ([]byte, error) {
    17  	return message.MarshalJSON(x)
    18  }
    19  
    20  func (x *Trust) UnmarshalJSON(data []byte) error {
    21  	return message.UnmarshalJSON(x, data, new(reputation.Trust))
    22  }
    23  
    24  func (x *PeerToPeerTrust) MarshalJSON() ([]byte, error) {
    25  	return message.MarshalJSON(x)
    26  }
    27  
    28  func (x *PeerToPeerTrust) UnmarshalJSON(data []byte) error {
    29  	return message.UnmarshalJSON(x, data, new(reputation.PeerToPeerTrust))
    30  }
    31  
    32  func (x *GlobalTrust) MarshalJSON() ([]byte, error) {
    33  	return message.MarshalJSON(x)
    34  }
    35  
    36  func (x *GlobalTrust) UnmarshalJSON(data []byte) error {
    37  	return message.UnmarshalJSON(x, data, new(reputation.GlobalTrust))
    38  }