// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: message.proto package pb import ( fmt "fmt" io "io" math "math" math_bits "math/bits" proto "github.com/gogo/protobuf/proto" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type Message_Type int32 const ( Message_ACK Message_Type = 0 Message_ADDRESS_GET Message_Type = 1 Message_APPCHAIN_REGISTER Message_Type = 2 Message_APPCHAIN_UPDATE Message_Type = 3 Message_APPCHAIN_GET Message_Type = 4 Message_INTERCHAIN_META_GET Message_Type = 5 Message_RULE_DEPLOY Message_Type = 6 //异步完成 Message_IBTP_GET Message_Type = 7 Message_IBTP_SEND Message_Type = 8 Message_IBTP_RECEIPT_SEND Message_Type = 9 Message_IBTP_RECEIPT_GET Message_Type = 10 Message_PEER_INFO_GET Message_Type = 11 ) var Message_Type_name = map[int32]string{ 0: "ACK", 1: "ADDRESS_GET", 2: "APPCHAIN_REGISTER", 3: "APPCHAIN_UPDATE", 4: "APPCHAIN_GET", 5: "INTERCHAIN_META_GET", 6: "RULE_DEPLOY", 7: "IBTP_GET", 8: "IBTP_SEND", 9: "IBTP_RECEIPT_SEND", 10: "IBTP_RECEIPT_GET", 11: "PEER_INFO_GET", } var Message_Type_value = map[string]int32{ "ACK": 0, "ADDRESS_GET": 1, "APPCHAIN_REGISTER": 2, "APPCHAIN_UPDATE": 3, "APPCHAIN_GET": 4, "INTERCHAIN_META_GET": 5, "RULE_DEPLOY": 6, "IBTP_GET": 7, "IBTP_SEND": 8, "IBTP_RECEIPT_SEND": 9, "IBTP_RECEIPT_GET": 10, "PEER_INFO_GET": 11, } func (x Message_Type) String() string { return proto.EnumName(Message_Type_name, int32(x)) } func (Message_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptor_33c57e4bae7b9afd, []int{0, 0} } type Message struct { Type Message_Type `protobuf:"varint,1,opt,name=type,proto3,enum=pb.Message_Type" json:"type,omitempty"` Payload *Pack `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` } func (m *Message) Reset() { *m = Message{} } func (m *Message) String() string { return proto.CompactTextString(m) } func (*Message) ProtoMessage() {} func (*Message) Descriptor() ([]byte, []int) { return fileDescriptor_33c57e4bae7b9afd, []int{0} } func (m *Message) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Message.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *Message) XXX_Merge(src proto.Message) { xxx_messageInfo_Message.Merge(m, src) } func (m *Message) XXX_Size() int { return m.Size() } func (m *Message) XXX_DiscardUnknown() { xxx_messageInfo_Message.DiscardUnknown(m) } var xxx_messageInfo_Message proto.InternalMessageInfo func (m *Message) GetType() Message_Type { if m != nil { return m.Type } return Message_ACK } func (m *Message) GetPayload() *Pack { if m != nil { return m.Payload } return nil } func (m *Message) GetVersion() string { if m != nil { return m.Version } return "" } type Pack struct { Ok bool `protobuf:"varint,1,opt,name=ok,proto3" json:"ok,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` } func (m *Pack) Reset() { *m = Pack{} } func (m *Pack) String() string { return proto.CompactTextString(m) } func (*Pack) ProtoMessage() {} func (*Pack) Descriptor() ([]byte, []int) { return fileDescriptor_33c57e4bae7b9afd, []int{1} } func (m *Pack) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Pack) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Pack.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *Pack) XXX_Merge(src proto.Message) { xxx_messageInfo_Pack.Merge(m, src) } func (m *Pack) XXX_Size() int { return m.Size() } func (m *Pack) XXX_DiscardUnknown() { xxx_messageInfo_Pack.DiscardUnknown(m) } var xxx_messageInfo_Pack proto.InternalMessageInfo func (m *Pack) GetOk() bool { if m != nil { return m.Ok } return false } func (m *Pack) GetData() []byte { if m != nil { return m.Data } return nil } type PeerInfo struct { ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` Tag string `protobuf:"bytes,2,opt,name=Tag,proto3" json:"Tag,omitempty"` } func (m *PeerInfo) Reset() { *m = PeerInfo{} } func (m *PeerInfo) String() string { return proto.CompactTextString(m) } func (*PeerInfo) ProtoMessage() {} func (*PeerInfo) Descriptor() ([]byte, []int) { return fileDescriptor_33c57e4bae7b9afd, []int{2} } func (m *PeerInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *PeerInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_PeerInfo.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *PeerInfo) XXX_Merge(src proto.Message) { xxx_messageInfo_PeerInfo.Merge(m, src) } func (m *PeerInfo) XXX_Size() int { return m.Size() } func (m *PeerInfo) XXX_DiscardUnknown() { xxx_messageInfo_PeerInfo.DiscardUnknown(m) } var xxx_messageInfo_PeerInfo proto.InternalMessageInfo func (m *PeerInfo) GetID() string { if m != nil { return m.ID } return "" } func (m *PeerInfo) GetTag() string { if m != nil { return m.Tag } return "" } func init() { proto.RegisterEnum("pb.Message_Type", Message_Type_name, Message_Type_value) proto.RegisterType((*Message)(nil), "pb.Message") proto.RegisterType((*Pack)(nil), "pb.Pack") proto.RegisterType((*PeerInfo)(nil), "pb.PeerInfo") } func init() { proto.RegisterFile("message.proto", fileDescriptor_33c57e4bae7b9afd) } var fileDescriptor_33c57e4bae7b9afd = []byte{ // 381 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x91, 0xc1, 0x8e, 0xd3, 0x30, 0x14, 0x45, 0xe3, 0x24, 0x4c, 0x92, 0xd7, 0x76, 0xc6, 0xf3, 0x06, 0x44, 0x56, 0x51, 0x15, 0xb1, 0xa8, 0x10, 0xca, 0x62, 0xf8, 0x82, 0x4c, 0x63, 0x06, 0x8b, 0x36, 0xb5, 0x1c, 0x77, 0xc1, 0x2a, 0x4a, 0x69, 0xa8, 0x50, 0xa1, 0x89, 0xda, 0x0a, 0xa9, 0x7f, 0xc1, 0x67, 0xb1, 0xec, 0x06, 0x89, 0x25, 0x6a, 0xc5, 0x7f, 0x20, 0xbb, 0xb4, 0xd2, 0xec, 0xde, 0x3d, 0xf7, 0x3e, 0xdb, 0xba, 0x86, 0xde, 0xb7, 0x7a, 0xb3, 0xa9, 0x16, 0x75, 0xd2, 0xae, 0x9b, 0x6d, 0x83, 0x76, 0x3b, 0x8b, 0x7f, 0xd9, 0xe0, 0x8d, 0x4f, 0x14, 0x5f, 0x81, 0xbb, 0xdd, 0xb5, 0x75, 0x48, 0xfa, 0x64, 0x70, 0x7d, 0x4f, 0x93, 0x76, 0x96, 0xfc, 0xb7, 0x12, 0xb5, 0x6b, 0x6b, 0x69, 0x5c, 0x8c, 0xc1, 0x6b, 0xab, 0xdd, 0xd7, 0xa6, 0x9a, 0x87, 0x76, 0x9f, 0x0c, 0x3a, 0xf7, 0xbe, 0x0e, 0x8a, 0xea, 0xd3, 0x52, 0x9e, 0x0d, 0x0c, 0xc1, 0xfb, 0x5e, 0xaf, 0x37, 0x5f, 0x9a, 0x55, 0xe8, 0xf4, 0xc9, 0x20, 0x90, 0x67, 0x19, 0xff, 0x25, 0xe0, 0xea, 0xc3, 0xd0, 0x03, 0x27, 0x1d, 0x7e, 0xa0, 0x16, 0xde, 0x40, 0x27, 0xcd, 0x32, 0xc9, 0x8a, 0xa2, 0x7c, 0x64, 0x8a, 0x12, 0x7c, 0x01, 0xb7, 0xa9, 0x10, 0xc3, 0xf7, 0x29, 0xcf, 0x4b, 0xc9, 0x1e, 0x79, 0xa1, 0x98, 0xa4, 0x36, 0xde, 0xc1, 0xcd, 0x05, 0x4f, 0x45, 0x96, 0x2a, 0x46, 0x1d, 0xa4, 0xd0, 0xbd, 0x40, 0xbd, 0xed, 0xe2, 0x4b, 0xb8, 0xe3, 0xb9, 0x62, 0xf2, 0xc4, 0xc6, 0x4c, 0xa5, 0xc6, 0x78, 0xa6, 0xef, 0x91, 0xd3, 0x11, 0x2b, 0x33, 0x26, 0x46, 0x93, 0x8f, 0xf4, 0x0a, 0xbb, 0xe0, 0xf3, 0x07, 0x25, 0x8c, 0xed, 0x61, 0x0f, 0x02, 0xa3, 0x0a, 0x96, 0x67, 0xd4, 0xd7, 0x8f, 0x30, 0x52, 0xb2, 0x21, 0xe3, 0x42, 0x9d, 0x70, 0x80, 0xcf, 0x81, 0x3e, 0xc1, 0x7a, 0x17, 0xf0, 0x16, 0x7a, 0x82, 0x31, 0x59, 0xf2, 0xfc, 0xdd, 0xc4, 0xa0, 0x4e, 0xfc, 0x1a, 0x5c, 0x5d, 0x09, 0x5e, 0x83, 0xdd, 0x2c, 0x4d, 0xa3, 0xbe, 0xb4, 0x9b, 0x25, 0x22, 0xb8, 0xf3, 0x6a, 0x5b, 0x99, 0xea, 0xba, 0xd2, 0xcc, 0xf1, 0x1b, 0xf0, 0x45, 0x5d, 0xaf, 0xf9, 0xea, 0x73, 0xa3, 0xf3, 0x3c, 0x33, 0xf9, 0x40, 0xda, 0x3c, 0x43, 0x0a, 0x8e, 0xaa, 0x16, 0x26, 0x1e, 0x48, 0x3d, 0x3e, 0x84, 0x3f, 0x0f, 0x11, 0xd9, 0x1f, 0x22, 0xf2, 0xe7, 0x10, 0x91, 0x1f, 0xc7, 0xc8, 0xda, 0x1f, 0x23, 0xeb, 0xf7, 0x31, 0xb2, 0x66, 0x57, 0xe6, 0x5b, 0xdf, 0xfe, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x37, 0x96, 0xad, 0xcc, 0xe7, 0x01, 0x00, 0x00, } func (m *Message) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *Message) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Message) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Version) > 0 { i -= len(m.Version) copy(dAtA[i:], m.Version) i = encodeVarintMessage(dAtA, i, uint64(len(m.Version))) i-- dAtA[i] = 0x1a } if m.Payload != nil { { size, err := m.Payload.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintMessage(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } if m.Type != 0 { i = encodeVarintMessage(dAtA, i, uint64(m.Type)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } func (m *Pack) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *Pack) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Pack) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Data) > 0 { i -= len(m.Data) copy(dAtA[i:], m.Data) i = encodeVarintMessage(dAtA, i, uint64(len(m.Data))) i-- dAtA[i] = 0x12 } if m.Ok { i-- if m.Ok { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } func (m *PeerInfo) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PeerInfo) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *PeerInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Tag) > 0 { i -= len(m.Tag) copy(dAtA[i:], m.Tag) i = encodeVarintMessage(dAtA, i, uint64(len(m.Tag))) i-- dAtA[i] = 0x12 } if len(m.ID) > 0 { i -= len(m.ID) copy(dAtA[i:], m.ID) i = encodeVarintMessage(dAtA, i, uint64(len(m.ID))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func encodeVarintMessage(dAtA []byte, offset int, v uint64) int { offset -= sovMessage(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return base } func (m *Message) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Type != 0 { n += 1 + sovMessage(uint64(m.Type)) } if m.Payload != nil { l = m.Payload.Size() n += 1 + l + sovMessage(uint64(l)) } l = len(m.Version) if l > 0 { n += 1 + l + sovMessage(uint64(l)) } return n } func (m *Pack) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Ok { n += 2 } l = len(m.Data) if l > 0 { n += 1 + l + sovMessage(uint64(l)) } return n } func (m *PeerInfo) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.ID) if l > 0 { n += 1 + l + sovMessage(uint64(l)) } l = len(m.Tag) if l > 0 { n += 1 + l + sovMessage(uint64(l)) } return n } func sovMessage(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } func sozMessage(x uint64) (n int) { return sovMessage(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (m *Message) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: Message: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Message: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) } m.Type = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Type |= Message_Type(b&0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthMessage } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthMessage } if postIndex > l { return io.ErrUnexpectedEOF } if m.Payload == nil { m.Payload = &Pack{} } if err := m.Payload.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthMessage } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthMessage } if postIndex > l { return io.ErrUnexpectedEOF } m.Version = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipMessage(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthMessage } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *Pack) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: Pack: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Pack: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Ok", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.Ok = bool(v != 0) case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthMessage } postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthMessage } if postIndex > l { return io.ErrUnexpectedEOF } m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) if m.Data == nil { m.Data = []byte{} } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipMessage(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthMessage } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PeerInfo) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PeerInfo: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PeerInfo: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthMessage } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthMessage } if postIndex > l { return io.ErrUnexpectedEOF } m.ID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Tag", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessage } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthMessage } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthMessage } if postIndex > l { return io.ErrUnexpectedEOF } m.Tag = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipMessage(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthMessage } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func skipMessage(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowMessage } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } wireType := int(wire & 0x7) switch wireType { case 0: for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowMessage } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } iNdEx++ if dAtA[iNdEx-1] < 0x80 { break } } case 1: iNdEx += 8 case 2: var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowMessage } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ length |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if length < 0 { return 0, ErrInvalidLengthMessage } iNdEx += length case 3: depth++ case 4: if depth == 0 { return 0, ErrUnexpectedEndOfGroupMessage } depth-- case 5: iNdEx += 4 default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { return 0, ErrInvalidLengthMessage } if depth == 0 { return iNdEx, nil } } return 0, io.ErrUnexpectedEOF } var ( ErrInvalidLengthMessage = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowMessage = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupMessage = fmt.Errorf("proto: unexpected end of group") )