forked from TrueCloudLab/frostfs-node
[#311] control: Implement JSON marshaler on Netmap message
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
dde24bc9e5
commit
36d8e2d3b7
1 changed files with 7 additions and 0 deletions
|
@ -2,6 +2,7 @@ package control
|
|||
|
||||
import (
|
||||
"github.com/nspcc-dev/neofs-api-go/util/proto"
|
||||
"google.golang.org/protobuf/encoding/protojson"
|
||||
)
|
||||
|
||||
// SetKey sets public key used for signing.
|
||||
|
@ -309,3 +310,9 @@ func (x *Netmap) StableSize() int {
|
|||
|
||||
return size
|
||||
}
|
||||
|
||||
func (x *Netmap) MarshalJSON() ([]byte, error) {
|
||||
return protojson.MarshalOptions{
|
||||
EmitUnpopulated: true,
|
||||
}.Marshal(x)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue