frostfs-api-go/netmap/grpc/service_frostfs.pb.go
Evgenii Stratonikov 29c522d5d8 [#122] protogen: Always marshal empty fields
This is how it was done previously:
a0a9b765f3/rpc/message/encoding.go (L31)

The tricky part is `[]byte` which is marshaled as `null` by easyjson
helper, but as `""` by protojson.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-10-07 15:05:43 +03:00

2180 lines
54 KiB
Go
Generated

// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
package netmap
import (
json "encoding/json"
fmt "fmt"
grpc1 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc"
pool "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/pool"
proto "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto"
encoding "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto/encoding"
easyproto "github.com/VictoriaMetrics/easyproto"
jlexer "github.com/mailru/easyjson/jlexer"
jwriter "github.com/mailru/easyjson/jwriter"
)
type LocalNodeInfoRequest_Body struct {
}
var (
_ encoding.ProtoMarshaler = (*LocalNodeInfoRequest_Body)(nil)
_ encoding.ProtoUnmarshaler = (*LocalNodeInfoRequest_Body)(nil)
_ json.Marshaler = (*LocalNodeInfoRequest_Body)(nil)
_ json.Unmarshaler = (*LocalNodeInfoRequest_Body)(nil)
)
// StableSize returns the size of x in protobuf format.
//
// Structures with the same field values have the same binary size.
func (x *LocalNodeInfoRequest_Body) StableSize() (size int) {
if x == nil {
return 0
}
return size
}
// MarshalProtobuf implements the encoding.ProtoMarshaler interface.
func (x *LocalNodeInfoRequest_Body) MarshalProtobuf(dst []byte) []byte {
m := pool.MarshalerPool.Get()
defer pool.MarshalerPool.Put(m)
x.EmitProtobuf(m.MessageMarshaler())
dst = m.Marshal(dst)
return dst
}
func (x *LocalNodeInfoRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
}
// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface.
func (x *LocalNodeInfoRequest_Body) UnmarshalProtobuf(src []byte) (err error) {
var fc easyproto.FieldContext
for len(src) > 0 {
src, err = fc.NextField(src)
if err != nil {
return fmt.Errorf("cannot read next field in %s", "LocalNodeInfoRequest_Body")
}
switch fc.FieldNum {
}
}
return nil
}
// MarshalJSON implements the json.Marshaler interface.
func (x *LocalNodeInfoRequest_Body) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
x.MarshalEasyJSON(&w)
return w.Buffer.BuildBytes(), w.Error
}
func (x *LocalNodeInfoRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
if x == nil {
out.RawString("null")
return
}
out.RawByte('{')
out.RawByte('}')
}
// UnmarshalJSON implements the json.Unmarshaler interface.
func (x *LocalNodeInfoRequest_Body) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
x.UnmarshalEasyJSON(&r)
return r.Error()
}
func (x *LocalNodeInfoRequest_Body) UnmarshalEasyJSON(in *jlexer.Lexer) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
type LocalNodeInfoRequest struct {
Body *LocalNodeInfoRequest_Body `json:"body"`
MetaHeader *grpc.RequestMetaHeader `json:"metaHeader"`
VerifyHeader *grpc.RequestVerificationHeader `json:"verifyHeader"`
}
var (
_ encoding.ProtoMarshaler = (*LocalNodeInfoRequest)(nil)
_ encoding.ProtoUnmarshaler = (*LocalNodeInfoRequest)(nil)
_ json.Marshaler = (*LocalNodeInfoRequest)(nil)
_ json.Unmarshaler = (*LocalNodeInfoRequest)(nil)
)
// StableSize returns the size of x in protobuf format.
//
// Structures with the same field values have the same binary size.
func (x *LocalNodeInfoRequest) StableSize() (size int) {
if x == nil {
return 0
}
size += proto.NestedStructureSize(1, x.Body)
size += proto.NestedStructureSize(2, x.MetaHeader)
size += proto.NestedStructureSize(3, x.VerifyHeader)
return size
}
// ReadSignedData fills buf with signed data of x.
// If buffer length is less than x.SignedDataSize(), new buffer is allocated.
//
// Returns any error encountered which did not allow writing the data completely.
// Otherwise, returns the buffer in which the data is written.
//
// Structures with the same field values have the same signed data.
func (x *LocalNodeInfoRequest) SignedDataSize() int {
return x.GetBody().StableSize()
}
// SignedDataSize returns size of the request signed data in bytes.
//
// Structures with the same field values have the same signed data size.
func (x *LocalNodeInfoRequest) ReadSignedData(buf []byte) ([]byte, error) {
return x.GetBody().MarshalProtobuf(buf), nil
}
// MarshalProtobuf implements the encoding.ProtoMarshaler interface.
func (x *LocalNodeInfoRequest) MarshalProtobuf(dst []byte) []byte {
m := pool.MarshalerPool.Get()
defer pool.MarshalerPool.Put(m)
x.EmitProtobuf(m.MessageMarshaler())
dst = m.Marshal(dst)
return dst
}
func (x *LocalNodeInfoRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface.
func (x *LocalNodeInfoRequest) UnmarshalProtobuf(src []byte) (err error) {
var fc easyproto.FieldContext
for len(src) > 0 {
src, err = fc.NextField(src)
if err != nil {
return fmt.Errorf("cannot read next field in %s", "LocalNodeInfoRequest")
}
switch fc.FieldNum {
case 1: // Body
data, ok := fc.MessageData()
if !ok {
return fmt.Errorf("cannot unmarshal field %s", "Body")
}
x.Body = new(LocalNodeInfoRequest_Body)
if err := x.Body.UnmarshalProtobuf(data); err != nil {
return fmt.Errorf("unmarshal: %w", err)
}
case 2: // MetaHeader
data, ok := fc.MessageData()
if !ok {
return fmt.Errorf("cannot unmarshal field %s", "MetaHeader")
}
x.MetaHeader = new(grpc.RequestMetaHeader)
if err := x.MetaHeader.UnmarshalProtobuf(data); err != nil {
return fmt.Errorf("unmarshal: %w", err)
}
case 3: // VerifyHeader
data, ok := fc.MessageData()
if !ok {
return fmt.Errorf("cannot unmarshal field %s", "VerifyHeader")
}
x.VerifyHeader = new(grpc.RequestVerificationHeader)
if err := x.VerifyHeader.UnmarshalProtobuf(data); err != nil {
return fmt.Errorf("unmarshal: %w", err)
}
}
}
return nil
}
func (x *LocalNodeInfoRequest) GetBody() *LocalNodeInfoRequest_Body {
if x != nil {
return x.Body
}
return nil
}
func (x *LocalNodeInfoRequest) SetBody(v *LocalNodeInfoRequest_Body) {
x.Body = v
}
func (x *LocalNodeInfoRequest) GetMetaHeader() *grpc.RequestMetaHeader {
if x != nil {
return x.MetaHeader
}
return nil
}
func (x *LocalNodeInfoRequest) SetMetaHeader(v *grpc.RequestMetaHeader) {
x.MetaHeader = v
}
func (x *LocalNodeInfoRequest) GetVerifyHeader() *grpc.RequestVerificationHeader {
if x != nil {
return x.VerifyHeader
}
return nil
}
func (x *LocalNodeInfoRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) {
x.VerifyHeader = v
}
// MarshalJSON implements the json.Marshaler interface.
func (x *LocalNodeInfoRequest) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
x.MarshalEasyJSON(&w)
return w.Buffer.BuildBytes(), w.Error
}
func (x *LocalNodeInfoRequest) MarshalEasyJSON(out *jwriter.Writer) {
if x == nil {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"body\":"
out.RawString(prefix)
x.Body.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"metaHeader\":"
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"verifyHeader\":"
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
out.RawByte('}')
}
// UnmarshalJSON implements the json.Unmarshaler interface.
func (x *LocalNodeInfoRequest) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
x.UnmarshalEasyJSON(&r)
return r.Error()
}
func (x *LocalNodeInfoRequest) UnmarshalEasyJSON(in *jlexer.Lexer) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "body":
{
var f *LocalNodeInfoRequest_Body
f = new(LocalNodeInfoRequest_Body)
f.UnmarshalEasyJSON(in)
x.Body = f
}
case "metaHeader":
{
var f *grpc.RequestMetaHeader
f = new(grpc.RequestMetaHeader)
f.UnmarshalEasyJSON(in)
x.MetaHeader = f
}
case "verifyHeader":
{
var f *grpc.RequestVerificationHeader
f = new(grpc.RequestVerificationHeader)
f.UnmarshalEasyJSON(in)
x.VerifyHeader = f
}
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
type LocalNodeInfoResponse_Body struct {
Version *grpc1.Version `json:"version"`
NodeInfo *NodeInfo `json:"nodeInfo"`
}
var (
_ encoding.ProtoMarshaler = (*LocalNodeInfoResponse_Body)(nil)
_ encoding.ProtoUnmarshaler = (*LocalNodeInfoResponse_Body)(nil)
_ json.Marshaler = (*LocalNodeInfoResponse_Body)(nil)
_ json.Unmarshaler = (*LocalNodeInfoResponse_Body)(nil)
)
// StableSize returns the size of x in protobuf format.
//
// Structures with the same field values have the same binary size.
func (x *LocalNodeInfoResponse_Body) StableSize() (size int) {
if x == nil {
return 0
}
size += proto.NestedStructureSize(1, x.Version)
size += proto.NestedStructureSize(2, x.NodeInfo)
return size
}
// MarshalProtobuf implements the encoding.ProtoMarshaler interface.
func (x *LocalNodeInfoResponse_Body) MarshalProtobuf(dst []byte) []byte {
m := pool.MarshalerPool.Get()
defer pool.MarshalerPool.Put(m)
x.EmitProtobuf(m.MessageMarshaler())
dst = m.Marshal(dst)
return dst
}
func (x *LocalNodeInfoResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Version != nil {
x.Version.EmitProtobuf(mm.AppendMessage(1))
}
if x.NodeInfo != nil {
x.NodeInfo.EmitProtobuf(mm.AppendMessage(2))
}
}
// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface.
func (x *LocalNodeInfoResponse_Body) UnmarshalProtobuf(src []byte) (err error) {
var fc easyproto.FieldContext
for len(src) > 0 {
src, err = fc.NextField(src)
if err != nil {
return fmt.Errorf("cannot read next field in %s", "LocalNodeInfoResponse_Body")
}
switch fc.FieldNum {
case 1: // Version
data, ok := fc.MessageData()
if !ok {
return fmt.Errorf("cannot unmarshal field %s", "Version")
}
x.Version = new(grpc1.Version)
if err := x.Version.UnmarshalProtobuf(data); err != nil {
return fmt.Errorf("unmarshal: %w", err)
}
case 2: // NodeInfo
data, ok := fc.MessageData()
if !ok {
return fmt.Errorf("cannot unmarshal field %s", "NodeInfo")
}
x.NodeInfo = new(NodeInfo)
if err := x.NodeInfo.UnmarshalProtobuf(data); err != nil {
return fmt.Errorf("unmarshal: %w", err)
}
}
}
return nil
}
func (x *LocalNodeInfoResponse_Body) GetVersion() *grpc1.Version {
if x != nil {
return x.Version
}
return nil
}
func (x *LocalNodeInfoResponse_Body) SetVersion(v *grpc1.Version) {
x.Version = v
}
func (x *LocalNodeInfoResponse_Body) GetNodeInfo() *NodeInfo {
if x != nil {
return x.NodeInfo
}
return nil
}
func (x *LocalNodeInfoResponse_Body) SetNodeInfo(v *NodeInfo) {
x.NodeInfo = v
}
// MarshalJSON implements the json.Marshaler interface.
func (x *LocalNodeInfoResponse_Body) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
x.MarshalEasyJSON(&w)
return w.Buffer.BuildBytes(), w.Error
}
func (x *LocalNodeInfoResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
if x == nil {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"version\":"
out.RawString(prefix)
x.Version.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"nodeInfo\":"
out.RawString(prefix)
x.NodeInfo.MarshalEasyJSON(out)
}
out.RawByte('}')
}
// UnmarshalJSON implements the json.Unmarshaler interface.
func (x *LocalNodeInfoResponse_Body) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
x.UnmarshalEasyJSON(&r)
return r.Error()
}
func (x *LocalNodeInfoResponse_Body) UnmarshalEasyJSON(in *jlexer.Lexer) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "version":
{
var f *grpc1.Version
f = new(grpc1.Version)
f.UnmarshalEasyJSON(in)
x.Version = f
}
case "nodeInfo":
{
var f *NodeInfo
f = new(NodeInfo)
f.UnmarshalEasyJSON(in)
x.NodeInfo = f
}
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
type LocalNodeInfoResponse struct {
Body *LocalNodeInfoResponse_Body `json:"body"`
MetaHeader *grpc.ResponseMetaHeader `json:"metaHeader"`
VerifyHeader *grpc.ResponseVerificationHeader `json:"verifyHeader"`
}
var (
_ encoding.ProtoMarshaler = (*LocalNodeInfoResponse)(nil)
_ encoding.ProtoUnmarshaler = (*LocalNodeInfoResponse)(nil)
_ json.Marshaler = (*LocalNodeInfoResponse)(nil)
_ json.Unmarshaler = (*LocalNodeInfoResponse)(nil)
)
// StableSize returns the size of x in protobuf format.
//
// Structures with the same field values have the same binary size.
func (x *LocalNodeInfoResponse) StableSize() (size int) {
if x == nil {
return 0
}
size += proto.NestedStructureSize(1, x.Body)
size += proto.NestedStructureSize(2, x.MetaHeader)
size += proto.NestedStructureSize(3, x.VerifyHeader)
return size
}
// ReadSignedData fills buf with signed data of x.
// If buffer length is less than x.SignedDataSize(), new buffer is allocated.
//
// Returns any error encountered which did not allow writing the data completely.
// Otherwise, returns the buffer in which the data is written.
//
// Structures with the same field values have the same signed data.
func (x *LocalNodeInfoResponse) SignedDataSize() int {
return x.GetBody().StableSize()
}
// SignedDataSize returns size of the request signed data in bytes.
//
// Structures with the same field values have the same signed data size.
func (x *LocalNodeInfoResponse) ReadSignedData(buf []byte) ([]byte, error) {
return x.GetBody().MarshalProtobuf(buf), nil
}
// MarshalProtobuf implements the encoding.ProtoMarshaler interface.
func (x *LocalNodeInfoResponse) MarshalProtobuf(dst []byte) []byte {
m := pool.MarshalerPool.Get()
defer pool.MarshalerPool.Put(m)
x.EmitProtobuf(m.MessageMarshaler())
dst = m.Marshal(dst)
return dst
}
func (x *LocalNodeInfoResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface.
func (x *LocalNodeInfoResponse) UnmarshalProtobuf(src []byte) (err error) {
var fc easyproto.FieldContext
for len(src) > 0 {
src, err = fc.NextField(src)
if err != nil {
return fmt.Errorf("cannot read next field in %s", "LocalNodeInfoResponse")
}
switch fc.FieldNum {
case 1: // Body
data, ok := fc.MessageData()
if !ok {
return fmt.Errorf("cannot unmarshal field %s", "Body")
}
x.Body = new(LocalNodeInfoResponse_Body)
if err := x.Body.UnmarshalProtobuf(data); err != nil {
return fmt.Errorf("unmarshal: %w", err)
}
case 2: // MetaHeader
data, ok := fc.MessageData()
if !ok {
return fmt.Errorf("cannot unmarshal field %s", "MetaHeader")
}
x.MetaHeader = new(grpc.ResponseMetaHeader)
if err := x.MetaHeader.UnmarshalProtobuf(data); err != nil {
return fmt.Errorf("unmarshal: %w", err)
}
case 3: // VerifyHeader
data, ok := fc.MessageData()
if !ok {
return fmt.Errorf("cannot unmarshal field %s", "VerifyHeader")
}
x.VerifyHeader = new(grpc.ResponseVerificationHeader)
if err := x.VerifyHeader.UnmarshalProtobuf(data); err != nil {
return fmt.Errorf("unmarshal: %w", err)
}
}
}
return nil
}
func (x *LocalNodeInfoResponse) GetBody() *LocalNodeInfoResponse_Body {
if x != nil {
return x.Body
}
return nil
}
func (x *LocalNodeInfoResponse) SetBody(v *LocalNodeInfoResponse_Body) {
x.Body = v
}
func (x *LocalNodeInfoResponse) GetMetaHeader() *grpc.ResponseMetaHeader {
if x != nil {
return x.MetaHeader
}
return nil
}
func (x *LocalNodeInfoResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) {
x.MetaHeader = v
}
func (x *LocalNodeInfoResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader {
if x != nil {
return x.VerifyHeader
}
return nil
}
func (x *LocalNodeInfoResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) {
x.VerifyHeader = v
}
// MarshalJSON implements the json.Marshaler interface.
func (x *LocalNodeInfoResponse) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
x.MarshalEasyJSON(&w)
return w.Buffer.BuildBytes(), w.Error
}
func (x *LocalNodeInfoResponse) MarshalEasyJSON(out *jwriter.Writer) {
if x == nil {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"body\":"
out.RawString(prefix)
x.Body.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"metaHeader\":"
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"verifyHeader\":"
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
out.RawByte('}')
}
// UnmarshalJSON implements the json.Unmarshaler interface.
func (x *LocalNodeInfoResponse) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
x.UnmarshalEasyJSON(&r)
return r.Error()
}
func (x *LocalNodeInfoResponse) UnmarshalEasyJSON(in *jlexer.Lexer) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "body":
{
var f *LocalNodeInfoResponse_Body
f = new(LocalNodeInfoResponse_Body)
f.UnmarshalEasyJSON(in)
x.Body = f
}
case "metaHeader":
{
var f *grpc.ResponseMetaHeader
f = new(grpc.ResponseMetaHeader)
f.UnmarshalEasyJSON(in)
x.MetaHeader = f
}
case "verifyHeader":
{
var f *grpc.ResponseVerificationHeader
f = new(grpc.ResponseVerificationHeader)
f.UnmarshalEasyJSON(in)
x.VerifyHeader = f
}
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
type NetworkInfoRequest_Body struct {
}
var (
_ encoding.ProtoMarshaler = (*NetworkInfoRequest_Body)(nil)
_ encoding.ProtoUnmarshaler = (*NetworkInfoRequest_Body)(nil)
_ json.Marshaler = (*NetworkInfoRequest_Body)(nil)
_ json.Unmarshaler = (*NetworkInfoRequest_Body)(nil)
)
// StableSize returns the size of x in protobuf format.
//
// Structures with the same field values have the same binary size.
func (x *NetworkInfoRequest_Body) StableSize() (size int) {
if x == nil {
return 0
}
return size
}
// MarshalProtobuf implements the encoding.ProtoMarshaler interface.
func (x *NetworkInfoRequest_Body) MarshalProtobuf(dst []byte) []byte {
m := pool.MarshalerPool.Get()
defer pool.MarshalerPool.Put(m)
x.EmitProtobuf(m.MessageMarshaler())
dst = m.Marshal(dst)
return dst
}
func (x *NetworkInfoRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
}
// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface.
func (x *NetworkInfoRequest_Body) UnmarshalProtobuf(src []byte) (err error) {
var fc easyproto.FieldContext
for len(src) > 0 {
src, err = fc.NextField(src)
if err != nil {
return fmt.Errorf("cannot read next field in %s", "NetworkInfoRequest_Body")
}
switch fc.FieldNum {
}
}
return nil
}
// MarshalJSON implements the json.Marshaler interface.
func (x *NetworkInfoRequest_Body) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
x.MarshalEasyJSON(&w)
return w.Buffer.BuildBytes(), w.Error
}
func (x *NetworkInfoRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
if x == nil {
out.RawString("null")
return
}
out.RawByte('{')
out.RawByte('}')
}
// UnmarshalJSON implements the json.Unmarshaler interface.
func (x *NetworkInfoRequest_Body) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
x.UnmarshalEasyJSON(&r)
return r.Error()
}
func (x *NetworkInfoRequest_Body) UnmarshalEasyJSON(in *jlexer.Lexer) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
type NetworkInfoRequest struct {
Body *NetworkInfoRequest_Body `json:"body"`
MetaHeader *grpc.RequestMetaHeader `json:"metaHeader"`
VerifyHeader *grpc.RequestVerificationHeader `json:"verifyHeader"`
}
var (
_ encoding.ProtoMarshaler = (*NetworkInfoRequest)(nil)
_ encoding.ProtoUnmarshaler = (*NetworkInfoRequest)(nil)
_ json.Marshaler = (*NetworkInfoRequest)(nil)
_ json.Unmarshaler = (*NetworkInfoRequest)(nil)
)
// StableSize returns the size of x in protobuf format.
//
// Structures with the same field values have the same binary size.
func (x *NetworkInfoRequest) StableSize() (size int) {
if x == nil {
return 0
}
size += proto.NestedStructureSize(1, x.Body)
size += proto.NestedStructureSize(2, x.MetaHeader)
size += proto.NestedStructureSize(3, x.VerifyHeader)
return size
}
// ReadSignedData fills buf with signed data of x.
// If buffer length is less than x.SignedDataSize(), new buffer is allocated.
//
// Returns any error encountered which did not allow writing the data completely.
// Otherwise, returns the buffer in which the data is written.
//
// Structures with the same field values have the same signed data.
func (x *NetworkInfoRequest) SignedDataSize() int {
return x.GetBody().StableSize()
}
// SignedDataSize returns size of the request signed data in bytes.
//
// Structures with the same field values have the same signed data size.
func (x *NetworkInfoRequest) ReadSignedData(buf []byte) ([]byte, error) {
return x.GetBody().MarshalProtobuf(buf), nil
}
// MarshalProtobuf implements the encoding.ProtoMarshaler interface.
func (x *NetworkInfoRequest) MarshalProtobuf(dst []byte) []byte {
m := pool.MarshalerPool.Get()
defer pool.MarshalerPool.Put(m)
x.EmitProtobuf(m.MessageMarshaler())
dst = m.Marshal(dst)
return dst
}
func (x *NetworkInfoRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface.
func (x *NetworkInfoRequest) UnmarshalProtobuf(src []byte) (err error) {
var fc easyproto.FieldContext
for len(src) > 0 {
src, err = fc.NextField(src)
if err != nil {
return fmt.Errorf("cannot read next field in %s", "NetworkInfoRequest")
}
switch fc.FieldNum {
case 1: // Body
data, ok := fc.MessageData()
if !ok {
return fmt.Errorf("cannot unmarshal field %s", "Body")
}
x.Body = new(NetworkInfoRequest_Body)
if err := x.Body.UnmarshalProtobuf(data); err != nil {
return fmt.Errorf("unmarshal: %w", err)
}
case 2: // MetaHeader
data, ok := fc.MessageData()
if !ok {
return fmt.Errorf("cannot unmarshal field %s", "MetaHeader")
}
x.MetaHeader = new(grpc.RequestMetaHeader)
if err := x.MetaHeader.UnmarshalProtobuf(data); err != nil {
return fmt.Errorf("unmarshal: %w", err)
}
case 3: // VerifyHeader
data, ok := fc.MessageData()
if !ok {
return fmt.Errorf("cannot unmarshal field %s", "VerifyHeader")
}
x.VerifyHeader = new(grpc.RequestVerificationHeader)
if err := x.VerifyHeader.UnmarshalProtobuf(data); err != nil {
return fmt.Errorf("unmarshal: %w", err)
}
}
}
return nil
}
func (x *NetworkInfoRequest) GetBody() *NetworkInfoRequest_Body {
if x != nil {
return x.Body
}
return nil
}
func (x *NetworkInfoRequest) SetBody(v *NetworkInfoRequest_Body) {
x.Body = v
}
func (x *NetworkInfoRequest) GetMetaHeader() *grpc.RequestMetaHeader {
if x != nil {
return x.MetaHeader
}
return nil
}
func (x *NetworkInfoRequest) SetMetaHeader(v *grpc.RequestMetaHeader) {
x.MetaHeader = v
}
func (x *NetworkInfoRequest) GetVerifyHeader() *grpc.RequestVerificationHeader {
if x != nil {
return x.VerifyHeader
}
return nil
}
func (x *NetworkInfoRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) {
x.VerifyHeader = v
}
// MarshalJSON implements the json.Marshaler interface.
func (x *NetworkInfoRequest) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
x.MarshalEasyJSON(&w)
return w.Buffer.BuildBytes(), w.Error
}
func (x *NetworkInfoRequest) MarshalEasyJSON(out *jwriter.Writer) {
if x == nil {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"body\":"
out.RawString(prefix)
x.Body.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"metaHeader\":"
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"verifyHeader\":"
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
out.RawByte('}')
}
// UnmarshalJSON implements the json.Unmarshaler interface.
func (x *NetworkInfoRequest) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
x.UnmarshalEasyJSON(&r)
return r.Error()
}
func (x *NetworkInfoRequest) UnmarshalEasyJSON(in *jlexer.Lexer) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "body":
{
var f *NetworkInfoRequest_Body
f = new(NetworkInfoRequest_Body)
f.UnmarshalEasyJSON(in)
x.Body = f
}
case "metaHeader":
{
var f *grpc.RequestMetaHeader
f = new(grpc.RequestMetaHeader)
f.UnmarshalEasyJSON(in)
x.MetaHeader = f
}
case "verifyHeader":
{
var f *grpc.RequestVerificationHeader
f = new(grpc.RequestVerificationHeader)
f.UnmarshalEasyJSON(in)
x.VerifyHeader = f
}
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
type NetworkInfoResponse_Body struct {
NetworkInfo *NetworkInfo `json:"networkInfo"`
}
var (
_ encoding.ProtoMarshaler = (*NetworkInfoResponse_Body)(nil)
_ encoding.ProtoUnmarshaler = (*NetworkInfoResponse_Body)(nil)
_ json.Marshaler = (*NetworkInfoResponse_Body)(nil)
_ json.Unmarshaler = (*NetworkInfoResponse_Body)(nil)
)
// StableSize returns the size of x in protobuf format.
//
// Structures with the same field values have the same binary size.
func (x *NetworkInfoResponse_Body) StableSize() (size int) {
if x == nil {
return 0
}
size += proto.NestedStructureSize(1, x.NetworkInfo)
return size
}
// MarshalProtobuf implements the encoding.ProtoMarshaler interface.
func (x *NetworkInfoResponse_Body) MarshalProtobuf(dst []byte) []byte {
m := pool.MarshalerPool.Get()
defer pool.MarshalerPool.Put(m)
x.EmitProtobuf(m.MessageMarshaler())
dst = m.Marshal(dst)
return dst
}
func (x *NetworkInfoResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.NetworkInfo != nil {
x.NetworkInfo.EmitProtobuf(mm.AppendMessage(1))
}
}
// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface.
func (x *NetworkInfoResponse_Body) UnmarshalProtobuf(src []byte) (err error) {
var fc easyproto.FieldContext
for len(src) > 0 {
src, err = fc.NextField(src)
if err != nil {
return fmt.Errorf("cannot read next field in %s", "NetworkInfoResponse_Body")
}
switch fc.FieldNum {
case 1: // NetworkInfo
data, ok := fc.MessageData()
if !ok {
return fmt.Errorf("cannot unmarshal field %s", "NetworkInfo")
}
x.NetworkInfo = new(NetworkInfo)
if err := x.NetworkInfo.UnmarshalProtobuf(data); err != nil {
return fmt.Errorf("unmarshal: %w", err)
}
}
}
return nil
}
func (x *NetworkInfoResponse_Body) GetNetworkInfo() *NetworkInfo {
if x != nil {
return x.NetworkInfo
}
return nil
}
func (x *NetworkInfoResponse_Body) SetNetworkInfo(v *NetworkInfo) {
x.NetworkInfo = v
}
// MarshalJSON implements the json.Marshaler interface.
func (x *NetworkInfoResponse_Body) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
x.MarshalEasyJSON(&w)
return w.Buffer.BuildBytes(), w.Error
}
func (x *NetworkInfoResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
if x == nil {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"networkInfo\":"
out.RawString(prefix)
x.NetworkInfo.MarshalEasyJSON(out)
}
out.RawByte('}')
}
// UnmarshalJSON implements the json.Unmarshaler interface.
func (x *NetworkInfoResponse_Body) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
x.UnmarshalEasyJSON(&r)
return r.Error()
}
func (x *NetworkInfoResponse_Body) UnmarshalEasyJSON(in *jlexer.Lexer) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "networkInfo":
{
var f *NetworkInfo
f = new(NetworkInfo)
f.UnmarshalEasyJSON(in)
x.NetworkInfo = f
}
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
type NetworkInfoResponse struct {
Body *NetworkInfoResponse_Body `json:"body"`
MetaHeader *grpc.ResponseMetaHeader `json:"metaHeader"`
VerifyHeader *grpc.ResponseVerificationHeader `json:"verifyHeader"`
}
var (
_ encoding.ProtoMarshaler = (*NetworkInfoResponse)(nil)
_ encoding.ProtoUnmarshaler = (*NetworkInfoResponse)(nil)
_ json.Marshaler = (*NetworkInfoResponse)(nil)
_ json.Unmarshaler = (*NetworkInfoResponse)(nil)
)
// StableSize returns the size of x in protobuf format.
//
// Structures with the same field values have the same binary size.
func (x *NetworkInfoResponse) StableSize() (size int) {
if x == nil {
return 0
}
size += proto.NestedStructureSize(1, x.Body)
size += proto.NestedStructureSize(2, x.MetaHeader)
size += proto.NestedStructureSize(3, x.VerifyHeader)
return size
}
// ReadSignedData fills buf with signed data of x.
// If buffer length is less than x.SignedDataSize(), new buffer is allocated.
//
// Returns any error encountered which did not allow writing the data completely.
// Otherwise, returns the buffer in which the data is written.
//
// Structures with the same field values have the same signed data.
func (x *NetworkInfoResponse) SignedDataSize() int {
return x.GetBody().StableSize()
}
// SignedDataSize returns size of the request signed data in bytes.
//
// Structures with the same field values have the same signed data size.
func (x *NetworkInfoResponse) ReadSignedData(buf []byte) ([]byte, error) {
return x.GetBody().MarshalProtobuf(buf), nil
}
// MarshalProtobuf implements the encoding.ProtoMarshaler interface.
func (x *NetworkInfoResponse) MarshalProtobuf(dst []byte) []byte {
m := pool.MarshalerPool.Get()
defer pool.MarshalerPool.Put(m)
x.EmitProtobuf(m.MessageMarshaler())
dst = m.Marshal(dst)
return dst
}
func (x *NetworkInfoResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface.
func (x *NetworkInfoResponse) UnmarshalProtobuf(src []byte) (err error) {
var fc easyproto.FieldContext
for len(src) > 0 {
src, err = fc.NextField(src)
if err != nil {
return fmt.Errorf("cannot read next field in %s", "NetworkInfoResponse")
}
switch fc.FieldNum {
case 1: // Body
data, ok := fc.MessageData()
if !ok {
return fmt.Errorf("cannot unmarshal field %s", "Body")
}
x.Body = new(NetworkInfoResponse_Body)
if err := x.Body.UnmarshalProtobuf(data); err != nil {
return fmt.Errorf("unmarshal: %w", err)
}
case 2: // MetaHeader
data, ok := fc.MessageData()
if !ok {
return fmt.Errorf("cannot unmarshal field %s", "MetaHeader")
}
x.MetaHeader = new(grpc.ResponseMetaHeader)
if err := x.MetaHeader.UnmarshalProtobuf(data); err != nil {
return fmt.Errorf("unmarshal: %w", err)
}
case 3: // VerifyHeader
data, ok := fc.MessageData()
if !ok {
return fmt.Errorf("cannot unmarshal field %s", "VerifyHeader")
}
x.VerifyHeader = new(grpc.ResponseVerificationHeader)
if err := x.VerifyHeader.UnmarshalProtobuf(data); err != nil {
return fmt.Errorf("unmarshal: %w", err)
}
}
}
return nil
}
func (x *NetworkInfoResponse) GetBody() *NetworkInfoResponse_Body {
if x != nil {
return x.Body
}
return nil
}
func (x *NetworkInfoResponse) SetBody(v *NetworkInfoResponse_Body) {
x.Body = v
}
func (x *NetworkInfoResponse) GetMetaHeader() *grpc.ResponseMetaHeader {
if x != nil {
return x.MetaHeader
}
return nil
}
func (x *NetworkInfoResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) {
x.MetaHeader = v
}
func (x *NetworkInfoResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader {
if x != nil {
return x.VerifyHeader
}
return nil
}
func (x *NetworkInfoResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) {
x.VerifyHeader = v
}
// MarshalJSON implements the json.Marshaler interface.
func (x *NetworkInfoResponse) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
x.MarshalEasyJSON(&w)
return w.Buffer.BuildBytes(), w.Error
}
func (x *NetworkInfoResponse) MarshalEasyJSON(out *jwriter.Writer) {
if x == nil {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"body\":"
out.RawString(prefix)
x.Body.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"metaHeader\":"
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"verifyHeader\":"
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
out.RawByte('}')
}
// UnmarshalJSON implements the json.Unmarshaler interface.
func (x *NetworkInfoResponse) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
x.UnmarshalEasyJSON(&r)
return r.Error()
}
func (x *NetworkInfoResponse) UnmarshalEasyJSON(in *jlexer.Lexer) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "body":
{
var f *NetworkInfoResponse_Body
f = new(NetworkInfoResponse_Body)
f.UnmarshalEasyJSON(in)
x.Body = f
}
case "metaHeader":
{
var f *grpc.ResponseMetaHeader
f = new(grpc.ResponseMetaHeader)
f.UnmarshalEasyJSON(in)
x.MetaHeader = f
}
case "verifyHeader":
{
var f *grpc.ResponseVerificationHeader
f = new(grpc.ResponseVerificationHeader)
f.UnmarshalEasyJSON(in)
x.VerifyHeader = f
}
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
type NetmapSnapshotRequest_Body struct {
}
var (
_ encoding.ProtoMarshaler = (*NetmapSnapshotRequest_Body)(nil)
_ encoding.ProtoUnmarshaler = (*NetmapSnapshotRequest_Body)(nil)
_ json.Marshaler = (*NetmapSnapshotRequest_Body)(nil)
_ json.Unmarshaler = (*NetmapSnapshotRequest_Body)(nil)
)
// StableSize returns the size of x in protobuf format.
//
// Structures with the same field values have the same binary size.
func (x *NetmapSnapshotRequest_Body) StableSize() (size int) {
if x == nil {
return 0
}
return size
}
// MarshalProtobuf implements the encoding.ProtoMarshaler interface.
func (x *NetmapSnapshotRequest_Body) MarshalProtobuf(dst []byte) []byte {
m := pool.MarshalerPool.Get()
defer pool.MarshalerPool.Put(m)
x.EmitProtobuf(m.MessageMarshaler())
dst = m.Marshal(dst)
return dst
}
func (x *NetmapSnapshotRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
}
// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface.
func (x *NetmapSnapshotRequest_Body) UnmarshalProtobuf(src []byte) (err error) {
var fc easyproto.FieldContext
for len(src) > 0 {
src, err = fc.NextField(src)
if err != nil {
return fmt.Errorf("cannot read next field in %s", "NetmapSnapshotRequest_Body")
}
switch fc.FieldNum {
}
}
return nil
}
// MarshalJSON implements the json.Marshaler interface.
func (x *NetmapSnapshotRequest_Body) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
x.MarshalEasyJSON(&w)
return w.Buffer.BuildBytes(), w.Error
}
func (x *NetmapSnapshotRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
if x == nil {
out.RawString("null")
return
}
out.RawByte('{')
out.RawByte('}')
}
// UnmarshalJSON implements the json.Unmarshaler interface.
func (x *NetmapSnapshotRequest_Body) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
x.UnmarshalEasyJSON(&r)
return r.Error()
}
func (x *NetmapSnapshotRequest_Body) UnmarshalEasyJSON(in *jlexer.Lexer) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
type NetmapSnapshotRequest struct {
Body *NetmapSnapshotRequest_Body `json:"body"`
MetaHeader *grpc.RequestMetaHeader `json:"metaHeader"`
VerifyHeader *grpc.RequestVerificationHeader `json:"verifyHeader"`
}
var (
_ encoding.ProtoMarshaler = (*NetmapSnapshotRequest)(nil)
_ encoding.ProtoUnmarshaler = (*NetmapSnapshotRequest)(nil)
_ json.Marshaler = (*NetmapSnapshotRequest)(nil)
_ json.Unmarshaler = (*NetmapSnapshotRequest)(nil)
)
// StableSize returns the size of x in protobuf format.
//
// Structures with the same field values have the same binary size.
func (x *NetmapSnapshotRequest) StableSize() (size int) {
if x == nil {
return 0
}
size += proto.NestedStructureSize(1, x.Body)
size += proto.NestedStructureSize(2, x.MetaHeader)
size += proto.NestedStructureSize(3, x.VerifyHeader)
return size
}
// ReadSignedData fills buf with signed data of x.
// If buffer length is less than x.SignedDataSize(), new buffer is allocated.
//
// Returns any error encountered which did not allow writing the data completely.
// Otherwise, returns the buffer in which the data is written.
//
// Structures with the same field values have the same signed data.
func (x *NetmapSnapshotRequest) SignedDataSize() int {
return x.GetBody().StableSize()
}
// SignedDataSize returns size of the request signed data in bytes.
//
// Structures with the same field values have the same signed data size.
func (x *NetmapSnapshotRequest) ReadSignedData(buf []byte) ([]byte, error) {
return x.GetBody().MarshalProtobuf(buf), nil
}
// MarshalProtobuf implements the encoding.ProtoMarshaler interface.
func (x *NetmapSnapshotRequest) MarshalProtobuf(dst []byte) []byte {
m := pool.MarshalerPool.Get()
defer pool.MarshalerPool.Put(m)
x.EmitProtobuf(m.MessageMarshaler())
dst = m.Marshal(dst)
return dst
}
func (x *NetmapSnapshotRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface.
func (x *NetmapSnapshotRequest) UnmarshalProtobuf(src []byte) (err error) {
var fc easyproto.FieldContext
for len(src) > 0 {
src, err = fc.NextField(src)
if err != nil {
return fmt.Errorf("cannot read next field in %s", "NetmapSnapshotRequest")
}
switch fc.FieldNum {
case 1: // Body
data, ok := fc.MessageData()
if !ok {
return fmt.Errorf("cannot unmarshal field %s", "Body")
}
x.Body = new(NetmapSnapshotRequest_Body)
if err := x.Body.UnmarshalProtobuf(data); err != nil {
return fmt.Errorf("unmarshal: %w", err)
}
case 2: // MetaHeader
data, ok := fc.MessageData()
if !ok {
return fmt.Errorf("cannot unmarshal field %s", "MetaHeader")
}
x.MetaHeader = new(grpc.RequestMetaHeader)
if err := x.MetaHeader.UnmarshalProtobuf(data); err != nil {
return fmt.Errorf("unmarshal: %w", err)
}
case 3: // VerifyHeader
data, ok := fc.MessageData()
if !ok {
return fmt.Errorf("cannot unmarshal field %s", "VerifyHeader")
}
x.VerifyHeader = new(grpc.RequestVerificationHeader)
if err := x.VerifyHeader.UnmarshalProtobuf(data); err != nil {
return fmt.Errorf("unmarshal: %w", err)
}
}
}
return nil
}
func (x *NetmapSnapshotRequest) GetBody() *NetmapSnapshotRequest_Body {
if x != nil {
return x.Body
}
return nil
}
func (x *NetmapSnapshotRequest) SetBody(v *NetmapSnapshotRequest_Body) {
x.Body = v
}
func (x *NetmapSnapshotRequest) GetMetaHeader() *grpc.RequestMetaHeader {
if x != nil {
return x.MetaHeader
}
return nil
}
func (x *NetmapSnapshotRequest) SetMetaHeader(v *grpc.RequestMetaHeader) {
x.MetaHeader = v
}
func (x *NetmapSnapshotRequest) GetVerifyHeader() *grpc.RequestVerificationHeader {
if x != nil {
return x.VerifyHeader
}
return nil
}
func (x *NetmapSnapshotRequest) SetVerifyHeader(v *grpc.RequestVerificationHeader) {
x.VerifyHeader = v
}
// MarshalJSON implements the json.Marshaler interface.
func (x *NetmapSnapshotRequest) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
x.MarshalEasyJSON(&w)
return w.Buffer.BuildBytes(), w.Error
}
func (x *NetmapSnapshotRequest) MarshalEasyJSON(out *jwriter.Writer) {
if x == nil {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"body\":"
out.RawString(prefix)
x.Body.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"metaHeader\":"
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"verifyHeader\":"
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
out.RawByte('}')
}
// UnmarshalJSON implements the json.Unmarshaler interface.
func (x *NetmapSnapshotRequest) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
x.UnmarshalEasyJSON(&r)
return r.Error()
}
func (x *NetmapSnapshotRequest) UnmarshalEasyJSON(in *jlexer.Lexer) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "body":
{
var f *NetmapSnapshotRequest_Body
f = new(NetmapSnapshotRequest_Body)
f.UnmarshalEasyJSON(in)
x.Body = f
}
case "metaHeader":
{
var f *grpc.RequestMetaHeader
f = new(grpc.RequestMetaHeader)
f.UnmarshalEasyJSON(in)
x.MetaHeader = f
}
case "verifyHeader":
{
var f *grpc.RequestVerificationHeader
f = new(grpc.RequestVerificationHeader)
f.UnmarshalEasyJSON(in)
x.VerifyHeader = f
}
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
type NetmapSnapshotResponse_Body struct {
Netmap *Netmap `json:"netmap"`
}
var (
_ encoding.ProtoMarshaler = (*NetmapSnapshotResponse_Body)(nil)
_ encoding.ProtoUnmarshaler = (*NetmapSnapshotResponse_Body)(nil)
_ json.Marshaler = (*NetmapSnapshotResponse_Body)(nil)
_ json.Unmarshaler = (*NetmapSnapshotResponse_Body)(nil)
)
// StableSize returns the size of x in protobuf format.
//
// Structures with the same field values have the same binary size.
func (x *NetmapSnapshotResponse_Body) StableSize() (size int) {
if x == nil {
return 0
}
size += proto.NestedStructureSize(1, x.Netmap)
return size
}
// MarshalProtobuf implements the encoding.ProtoMarshaler interface.
func (x *NetmapSnapshotResponse_Body) MarshalProtobuf(dst []byte) []byte {
m := pool.MarshalerPool.Get()
defer pool.MarshalerPool.Put(m)
x.EmitProtobuf(m.MessageMarshaler())
dst = m.Marshal(dst)
return dst
}
func (x *NetmapSnapshotResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Netmap != nil {
x.Netmap.EmitProtobuf(mm.AppendMessage(1))
}
}
// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface.
func (x *NetmapSnapshotResponse_Body) UnmarshalProtobuf(src []byte) (err error) {
var fc easyproto.FieldContext
for len(src) > 0 {
src, err = fc.NextField(src)
if err != nil {
return fmt.Errorf("cannot read next field in %s", "NetmapSnapshotResponse_Body")
}
switch fc.FieldNum {
case 1: // Netmap
data, ok := fc.MessageData()
if !ok {
return fmt.Errorf("cannot unmarshal field %s", "Netmap")
}
x.Netmap = new(Netmap)
if err := x.Netmap.UnmarshalProtobuf(data); err != nil {
return fmt.Errorf("unmarshal: %w", err)
}
}
}
return nil
}
func (x *NetmapSnapshotResponse_Body) GetNetmap() *Netmap {
if x != nil {
return x.Netmap
}
return nil
}
func (x *NetmapSnapshotResponse_Body) SetNetmap(v *Netmap) {
x.Netmap = v
}
// MarshalJSON implements the json.Marshaler interface.
func (x *NetmapSnapshotResponse_Body) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
x.MarshalEasyJSON(&w)
return w.Buffer.BuildBytes(), w.Error
}
func (x *NetmapSnapshotResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
if x == nil {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"netmap\":"
out.RawString(prefix)
x.Netmap.MarshalEasyJSON(out)
}
out.RawByte('}')
}
// UnmarshalJSON implements the json.Unmarshaler interface.
func (x *NetmapSnapshotResponse_Body) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
x.UnmarshalEasyJSON(&r)
return r.Error()
}
func (x *NetmapSnapshotResponse_Body) UnmarshalEasyJSON(in *jlexer.Lexer) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "netmap":
{
var f *Netmap
f = new(Netmap)
f.UnmarshalEasyJSON(in)
x.Netmap = f
}
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
type NetmapSnapshotResponse struct {
Body *NetmapSnapshotResponse_Body `json:"body"`
MetaHeader *grpc.ResponseMetaHeader `json:"metaHeader"`
VerifyHeader *grpc.ResponseVerificationHeader `json:"verifyHeader"`
}
var (
_ encoding.ProtoMarshaler = (*NetmapSnapshotResponse)(nil)
_ encoding.ProtoUnmarshaler = (*NetmapSnapshotResponse)(nil)
_ json.Marshaler = (*NetmapSnapshotResponse)(nil)
_ json.Unmarshaler = (*NetmapSnapshotResponse)(nil)
)
// StableSize returns the size of x in protobuf format.
//
// Structures with the same field values have the same binary size.
func (x *NetmapSnapshotResponse) StableSize() (size int) {
if x == nil {
return 0
}
size += proto.NestedStructureSize(1, x.Body)
size += proto.NestedStructureSize(2, x.MetaHeader)
size += proto.NestedStructureSize(3, x.VerifyHeader)
return size
}
// ReadSignedData fills buf with signed data of x.
// If buffer length is less than x.SignedDataSize(), new buffer is allocated.
//
// Returns any error encountered which did not allow writing the data completely.
// Otherwise, returns the buffer in which the data is written.
//
// Structures with the same field values have the same signed data.
func (x *NetmapSnapshotResponse) SignedDataSize() int {
return x.GetBody().StableSize()
}
// SignedDataSize returns size of the request signed data in bytes.
//
// Structures with the same field values have the same signed data size.
func (x *NetmapSnapshotResponse) ReadSignedData(buf []byte) ([]byte, error) {
return x.GetBody().MarshalProtobuf(buf), nil
}
// MarshalProtobuf implements the encoding.ProtoMarshaler interface.
func (x *NetmapSnapshotResponse) MarshalProtobuf(dst []byte) []byte {
m := pool.MarshalerPool.Get()
defer pool.MarshalerPool.Put(m)
x.EmitProtobuf(m.MessageMarshaler())
dst = m.Marshal(dst)
return dst
}
func (x *NetmapSnapshotResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
// UnmarshalProtobuf implements the encoding.ProtoUnmarshaler interface.
func (x *NetmapSnapshotResponse) UnmarshalProtobuf(src []byte) (err error) {
var fc easyproto.FieldContext
for len(src) > 0 {
src, err = fc.NextField(src)
if err != nil {
return fmt.Errorf("cannot read next field in %s", "NetmapSnapshotResponse")
}
switch fc.FieldNum {
case 1: // Body
data, ok := fc.MessageData()
if !ok {
return fmt.Errorf("cannot unmarshal field %s", "Body")
}
x.Body = new(NetmapSnapshotResponse_Body)
if err := x.Body.UnmarshalProtobuf(data); err != nil {
return fmt.Errorf("unmarshal: %w", err)
}
case 2: // MetaHeader
data, ok := fc.MessageData()
if !ok {
return fmt.Errorf("cannot unmarshal field %s", "MetaHeader")
}
x.MetaHeader = new(grpc.ResponseMetaHeader)
if err := x.MetaHeader.UnmarshalProtobuf(data); err != nil {
return fmt.Errorf("unmarshal: %w", err)
}
case 3: // VerifyHeader
data, ok := fc.MessageData()
if !ok {
return fmt.Errorf("cannot unmarshal field %s", "VerifyHeader")
}
x.VerifyHeader = new(grpc.ResponseVerificationHeader)
if err := x.VerifyHeader.UnmarshalProtobuf(data); err != nil {
return fmt.Errorf("unmarshal: %w", err)
}
}
}
return nil
}
func (x *NetmapSnapshotResponse) GetBody() *NetmapSnapshotResponse_Body {
if x != nil {
return x.Body
}
return nil
}
func (x *NetmapSnapshotResponse) SetBody(v *NetmapSnapshotResponse_Body) {
x.Body = v
}
func (x *NetmapSnapshotResponse) GetMetaHeader() *grpc.ResponseMetaHeader {
if x != nil {
return x.MetaHeader
}
return nil
}
func (x *NetmapSnapshotResponse) SetMetaHeader(v *grpc.ResponseMetaHeader) {
x.MetaHeader = v
}
func (x *NetmapSnapshotResponse) GetVerifyHeader() *grpc.ResponseVerificationHeader {
if x != nil {
return x.VerifyHeader
}
return nil
}
func (x *NetmapSnapshotResponse) SetVerifyHeader(v *grpc.ResponseVerificationHeader) {
x.VerifyHeader = v
}
// MarshalJSON implements the json.Marshaler interface.
func (x *NetmapSnapshotResponse) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
x.MarshalEasyJSON(&w)
return w.Buffer.BuildBytes(), w.Error
}
func (x *NetmapSnapshotResponse) MarshalEasyJSON(out *jwriter.Writer) {
if x == nil {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"body\":"
out.RawString(prefix)
x.Body.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"metaHeader\":"
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"verifyHeader\":"
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
out.RawByte('}')
}
// UnmarshalJSON implements the json.Unmarshaler interface.
func (x *NetmapSnapshotResponse) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
x.UnmarshalEasyJSON(&r)
return r.Error()
}
func (x *NetmapSnapshotResponse) UnmarshalEasyJSON(in *jlexer.Lexer) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "body":
{
var f *NetmapSnapshotResponse_Body
f = new(NetmapSnapshotResponse_Body)
f.UnmarshalEasyJSON(in)
x.Body = f
}
case "metaHeader":
{
var f *grpc.ResponseMetaHeader
f = new(grpc.ResponseMetaHeader)
f.UnmarshalEasyJSON(in)
x.MetaHeader = f
}
case "verifyHeader":
{
var f *grpc.ResponseVerificationHeader
f = new(grpc.ResponseVerificationHeader)
f.UnmarshalEasyJSON(in)
x.VerifyHeader = f
}
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}