From 201ba0c95333cb07be9f955a936cd06a929e2e8f Mon Sep 17 00:00:00 2001 From: 554325746@qq.com <554325746@qq.com> Date: 星期四, 06 二月 2020 20:37:20 +0800 Subject: [PATCH] change golang/protobuf to gogo/protobuf --- commsg.pb.go | 110 ++++++++++++++++++++++++++++++++++++++++++------------ 1 files changed, 85 insertions(+), 25 deletions(-) diff --git a/commsg.pb.go b/commsg.pb.go index 2866693..71b8aee 100644 --- a/commsg.pb.go +++ b/commsg.pb.go @@ -150,10 +150,11 @@ } type SdkMessage struct { - Cid string `protobuf:"bytes,1,opt,name=cid,proto3" json:"cid,omitempty"` - Caddr string `protobuf:"bytes,2,opt,name=caddr,proto3" json:"caddr,omitempty"` - Tasklab *TaskLabel `protobuf:"bytes,3,opt,name=tasklab,proto3" json:"tasklab,omitempty"` - Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` + Cid string `protobuf:"bytes,1,opt,name=cid,proto3" json:"cid,omitempty"` + Caddr string `protobuf:"bytes,2,opt,name=caddr,proto3" json:"caddr,omitempty"` + Tasklab *TaskLabel `protobuf:"bytes,3,opt,name=tasklab,proto3" json:"tasklab,omitempty"` + Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` + Push *PushAttach `protobuf:"bytes,5,opt,name=push,proto3" json:"push,omitempty"` } func (m *SdkMessage) Reset() { *m = SdkMessage{} } @@ -213,6 +214,13 @@ func (m *SdkMessage) GetData() []byte { if m != nil { return m.Data + } + return nil +} + +func (m *SdkMessage) GetPush() *PushAttach { + if m != nil { + return m.Push } return nil } @@ -287,27 +295,29 @@ func init() { proto.RegisterFile("commsg.proto", fileDescriptor_968fba5e415d8aac) } var fileDescriptor_968fba5e415d8aac = []byte{ - // 315 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x90, 0xbb, 0x4e, 0xc3, 0x30, - 0x14, 0x86, 0xeb, 0xa6,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x8c, 0x61, 0x89, 0xc0, 0x27, - 0xe0, 0x1d, 0x66, 0xb4, 0xd2, 0xfe, 0x8a, 0x19, 0xe7, 0x79, 0x13, 0xa2, 0x06, 0x7c, 0x09, 0x63, - 0x9b, 0x66, 0xcb, 0x36, 0xc4, 0xf3, 0x51, 0x38, 0x5b, 0x9d, 0x1e, 0x02, 0x74, 0xb3, 0x45, 0x6d, - 0x0d, 0xc6, 0x30, 0x38, 0xda, 0x84, 0xd3, 0xc1, 0x2d, 0x8c, 0x73, 0x11, 0xbf, 0x6a, 0x93, 0xe0, - 0x05, 0xf4, 0xbb, 0xa6, 0x7d, 0xc9, 0x6d, 0xf9, 0x51, 0x4b, 0xa7, 0xed, 0x3e, 0x33, 0x19, 0x3b, - 0x17, 0xaf, 0xde, 0x67, 0x83, 0x37, 0xe4, 0xbb, 0xa4, 0x68, 0x5f, 0x52, 0xf4, 0x5b, 0x52, 0xf4, - 0x55, 0xd1, 0xde, 0xbe, 0xa2, 0xbd, 0x9f, 0x8a, 0xf6, 0x36, 0x23, 0x97, 0xe9, 0xea, 0x2f, 0x00, - 0x00, 0xff, 0xff, 0xc8, 0x63, 0xfd, 0xdb, 0xe6, 0x01, 0x00, 0x00, + // 347 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x90, 0xbd, 0x4e, 0xfb, 0x30, + 0x14, 0xc5, 0xeb, 0xa6, 0x9f, 0xb7, 0x55, 0xf5, 0x97, 0xff, 0x15, 0xb2, 0x3a, 0x44, 0x51, 0xa6, + 0x2c, 0x74, 0x28, 0xbc, 0x00, 0x2c, 0x2c, 0x20, 0xa1, 0x14, 0x09, 0x89, 0xcd, 0x8d, 0x43, 0x12, + 0xa5, 0x69, 0xa2, 0x5e, 0x17, 0xc1, 0x33, 0xb0, 0xf0, 0x0a, 0xbc, 0x0d, 0x63, 0x47, 0x46, 0xd4, + 0xbe, 0x08, 0xb2, 0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0a, 0x9d, 0x93, 0x53, 0x68, 0x4d, + 0x3d, 0xe8, 0x14, 0x3b, 0x8c, 0x59, 0x57, 0xf7, 0x4f, 0x9b, 0xfe, 0xfb, 0x1d, 0xc6, 0x57, 0x52, + 0xf2, 0x20, 0xf6, 0x75, 0x85, 0x7b, 0x03, 0xfd, 0x6d, 0x18, 0xbc, 0x64, 0x18, 0xd1, 0x09, 0xb4, + 0x8d, 0xbd, 0x76, 0x22, 0xd4, 0xe0, 0x13, 0x73, 0x5a, 0xab, 0xd3, 0x17, 0x49, 0xa0, 0xf7, 0x59, + 0xe5, 0xe9, 0x2b, 0xbc, 0x66, 0x5f, 0x07, 0x9b, 0xec, 0x0f, 0x36, 0xf9, 0x39, 0xd8, 0xe4, 0xe3, + 0x68, 0xb7, 0xf6, 0x47, 0xbb, 0xf5, 0x7d, 0xb4, 0x5b, 0xab, 0x9e, 0xde, 0x7e, 0xf1, 0x1b, 0x00, + 0x00, 0xff, 0xff, 0xe1, 0xa1, 0x46, 0x83, 0x21, 0x02, 0x00, 0x00, } func (m *SdkmsgWithTask) Marshal() (dAtA []byte, err error) { @@ -436,6 +446,16 @@ i = encodeVarintCommsg(dAtA, i, uint64(len(m.Data))) i += copy(dAtA[i:], m.Data) } + if m.Push != nil { + dAtA[i] = 0x2a + i++ + i = encodeVarintCommsg(dAtA, i, uint64(m.Push.Size())) + n2, err2 := m.Push.MarshalTo(dAtA[i:]) + if err2 != nil { + return 0, err2 + } + i += n2 + } return i, nil } @@ -551,6 +571,10 @@ } l = len(m.Data) if l > 0 { + n += 1 + l + sovCommsg(uint64(l)) + } + if m.Push != nil { + l = m.Push.Size() n += 1 + l + sovCommsg(uint64(l)) } return n @@ -1074,6 +1098,42 @@ m.Data = []byte{} } iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Push", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommsg + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCommsg + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCommsg + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Push == nil { + m.Push = &PushAttach{} + } + if err := m.Push.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipCommsg(dAtA[iNdEx:]) -- Gitblit v1.8.0