github.com/koko1123/flow-go-1@v0.29.6/network/message/message.pb.go (about)

     1  // Code generated by protoc-gen-gogo. DO NOT EDIT.
     2  // source: message.proto
     3  
     4  package message
     5  
     6  import (
     7  	fmt "fmt"
     8  	proto "github.com/golang/protobuf/proto"
     9  	io "io"
    10  	math "math"
    11  	math_bits "math/bits"
    12  )
    13  
    14  // Reference imports to suppress errors if they are not otherwise used.
    15  var _ = proto.Marshal
    16  var _ = fmt.Errorf
    17  var _ = math.Inf
    18  
    19  // This is a compile-time assertion to ensure that this generated file
    20  // is compatible with the proto package it is being compiled against.
    21  // A compilation error at this line likely means your copy of the
    22  // proto package needs to be updated.
    23  const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
    24  
    25  // Message models a single message that is supposed to get exchanged by the
    26  // gossip network
    27  type Message struct {
    28  	ChannelID            string   `protobuf:"bytes,1,opt,name=ChannelID,proto3" json:"ChannelID,omitempty"`
    29  	TargetIDs            [][]byte `protobuf:"bytes,2,rep,name=TargetIDs,proto3" json:"TargetIDs,omitempty"`
    30  	Payload              []byte   `protobuf:"bytes,3,opt,name=Payload,proto3" json:"Payload,omitempty"`
    31  	XXX_NoUnkeyedLiteral struct{} `json:"-"`
    32  	XXX_unrecognized     []byte   `json:"-"`
    33  	XXX_sizecache        int32    `json:"-"`
    34  }
    35  
    36  func (m *Message) Reset()         { *m = Message{} }
    37  func (m *Message) String() string { return proto.CompactTextString(m) }
    38  func (*Message) ProtoMessage()    {}
    39  func (*Message) Descriptor() ([]byte, []int) {
    40  	return fileDescriptor_33c57e4bae7b9afd, []int{0}
    41  }
    42  func (m *Message) XXX_Unmarshal(b []byte) error {
    43  	return m.Unmarshal(b)
    44  }
    45  func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    46  	if deterministic {
    47  		return xxx_messageInfo_Message.Marshal(b, m, deterministic)
    48  	} else {
    49  		b = b[:cap(b)]
    50  		n, err := m.MarshalToSizedBuffer(b)
    51  		if err != nil {
    52  			return nil, err
    53  		}
    54  		return b[:n], nil
    55  	}
    56  }
    57  func (m *Message) XXX_Merge(src proto.Message) {
    58  	xxx_messageInfo_Message.Merge(m, src)
    59  }
    60  func (m *Message) XXX_Size() int {
    61  	return m.Size()
    62  }
    63  func (m *Message) XXX_DiscardUnknown() {
    64  	xxx_messageInfo_Message.DiscardUnknown(m)
    65  }
    66  
    67  var xxx_messageInfo_Message proto.InternalMessageInfo
    68  
    69  func (m *Message) GetChannelID() string {
    70  	if m != nil {
    71  		return m.ChannelID
    72  	}
    73  	return ""
    74  }
    75  
    76  func (m *Message) GetTargetIDs() [][]byte {
    77  	if m != nil {
    78  		return m.TargetIDs
    79  	}
    80  	return nil
    81  }
    82  
    83  func (m *Message) GetPayload() []byte {
    84  	if m != nil {
    85  		return m.Payload
    86  	}
    87  	return nil
    88  }
    89  
    90  func init() {
    91  	proto.RegisterType((*Message)(nil), "message.Message")
    92  }
    93  
    94  func init() { proto.RegisterFile("message.proto", fileDescriptor_33c57e4bae7b9afd) }
    95  
    96  var fileDescriptor_33c57e4bae7b9afd = []byte{
    97  	// 135 bytes of a gzipped FileDescriptorProto
    98  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0xcd, 0x4d, 0x2d, 0x2e,
    99  	0x4e, 0x4c, 0x4f, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x87, 0x72, 0x95, 0xe2, 0xb9,
   100  	0xd8, 0x7d, 0x21, 0x4c, 0x21, 0x19, 0x2e, 0x4e, 0xe7, 0x8c, 0xc4, 0xbc, 0xbc, 0xd4, 0x1c, 0x4f,
   101  	0x17, 0x09, 0x46, 0x05, 0x46, 0x0d, 0xce, 0x20, 0x84, 0x00, 0x48, 0x36, 0x24, 0xb1, 0x28, 0x3d,
   102  	0xb5, 0xc4, 0xd3, 0xa5, 0x58, 0x82, 0x49, 0x81, 0x59, 0x83, 0x27, 0x08, 0x21, 0x20, 0x24, 0xc1,
   103  	0xc5, 0x1e, 0x90, 0x58, 0x99, 0x93, 0x9f, 0x98, 0x22, 0xc1, 0xac, 0xc0, 0xa8, 0xc1, 0x13, 0x04,
   104  	0xe3, 0x3a, 0x09, 0x9c, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c,
   105  	0x33, 0x1e, 0xcb, 0x31, 0x24, 0xb1, 0x81, 0x9d, 0x60, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xdd,
   106  	0xef, 0xa5, 0x7b, 0x93, 0x00, 0x00, 0x00,
   107  }
   108  
   109  func (m *Message) Marshal() (dAtA []byte, err error) {
   110  	size := m.Size()
   111  	dAtA = make([]byte, size)
   112  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   113  	if err != nil {
   114  		return nil, err
   115  	}
   116  	return dAtA[:n], nil
   117  }
   118  
   119  func (m *Message) MarshalTo(dAtA []byte) (int, error) {
   120  	size := m.Size()
   121  	return m.MarshalToSizedBuffer(dAtA[:size])
   122  }
   123  
   124  func (m *Message) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   125  	i := len(dAtA)
   126  	_ = i
   127  	var l int
   128  	_ = l
   129  	if m.XXX_unrecognized != nil {
   130  		i -= len(m.XXX_unrecognized)
   131  		copy(dAtA[i:], m.XXX_unrecognized)
   132  	}
   133  	if len(m.Payload) > 0 {
   134  		i -= len(m.Payload)
   135  		copy(dAtA[i:], m.Payload)
   136  		i = encodeVarintMessage(dAtA, i, uint64(len(m.Payload)))
   137  		i--
   138  		dAtA[i] = 0x1a
   139  	}
   140  	if len(m.TargetIDs) > 0 {
   141  		for iNdEx := len(m.TargetIDs) - 1; iNdEx >= 0; iNdEx-- {
   142  			i -= len(m.TargetIDs[iNdEx])
   143  			copy(dAtA[i:], m.TargetIDs[iNdEx])
   144  			i = encodeVarintMessage(dAtA, i, uint64(len(m.TargetIDs[iNdEx])))
   145  			i--
   146  			dAtA[i] = 0x12
   147  		}
   148  	}
   149  	if len(m.ChannelID) > 0 {
   150  		i -= len(m.ChannelID)
   151  		copy(dAtA[i:], m.ChannelID)
   152  		i = encodeVarintMessage(dAtA, i, uint64(len(m.ChannelID)))
   153  		i--
   154  		dAtA[i] = 0xa
   155  	}
   156  	return len(dAtA) - i, nil
   157  }
   158  
   159  func encodeVarintMessage(dAtA []byte, offset int, v uint64) int {
   160  	offset -= sovMessage(v)
   161  	base := offset
   162  	for v >= 1<<7 {
   163  		dAtA[offset] = uint8(v&0x7f | 0x80)
   164  		v >>= 7
   165  		offset++
   166  	}
   167  	dAtA[offset] = uint8(v)
   168  	return base
   169  }
   170  func (m *Message) Size() (n int) {
   171  	if m == nil {
   172  		return 0
   173  	}
   174  	var l int
   175  	_ = l
   176  	l = len(m.ChannelID)
   177  	if l > 0 {
   178  		n += 1 + l + sovMessage(uint64(l))
   179  	}
   180  	if len(m.TargetIDs) > 0 {
   181  		for _, b := range m.TargetIDs {
   182  			l = len(b)
   183  			n += 1 + l + sovMessage(uint64(l))
   184  		}
   185  	}
   186  	l = len(m.Payload)
   187  	if l > 0 {
   188  		n += 1 + l + sovMessage(uint64(l))
   189  	}
   190  	if m.XXX_unrecognized != nil {
   191  		n += len(m.XXX_unrecognized)
   192  	}
   193  	return n
   194  }
   195  
   196  func sovMessage(x uint64) (n int) {
   197  	return (math_bits.Len64(x|1) + 6) / 7
   198  }
   199  func sozMessage(x uint64) (n int) {
   200  	return sovMessage(uint64((x << 1) ^ uint64((int64(x) >> 63))))
   201  }
   202  func (m *Message) Unmarshal(dAtA []byte) error {
   203  	l := len(dAtA)
   204  	iNdEx := 0
   205  	for iNdEx < l {
   206  		preIndex := iNdEx
   207  		var wire uint64
   208  		for shift := uint(0); ; shift += 7 {
   209  			if shift >= 64 {
   210  				return ErrIntOverflowMessage
   211  			}
   212  			if iNdEx >= l {
   213  				return io.ErrUnexpectedEOF
   214  			}
   215  			b := dAtA[iNdEx]
   216  			iNdEx++
   217  			wire |= uint64(b&0x7F) << shift
   218  			if b < 0x80 {
   219  				break
   220  			}
   221  		}
   222  		fieldNum := int32(wire >> 3)
   223  		wireType := int(wire & 0x7)
   224  		if wireType == 4 {
   225  			return fmt.Errorf("proto: Message: wiretype end group for non-group")
   226  		}
   227  		if fieldNum <= 0 {
   228  			return fmt.Errorf("proto: Message: illegal tag %d (wire type %d)", fieldNum, wire)
   229  		}
   230  		switch fieldNum {
   231  		case 1:
   232  			if wireType != 2 {
   233  				return fmt.Errorf("proto: wrong wireType = %d for field ChannelID", wireType)
   234  			}
   235  			var stringLen uint64
   236  			for shift := uint(0); ; shift += 7 {
   237  				if shift >= 64 {
   238  					return ErrIntOverflowMessage
   239  				}
   240  				if iNdEx >= l {
   241  					return io.ErrUnexpectedEOF
   242  				}
   243  				b := dAtA[iNdEx]
   244  				iNdEx++
   245  				stringLen |= uint64(b&0x7F) << shift
   246  				if b < 0x80 {
   247  					break
   248  				}
   249  			}
   250  			intStringLen := int(stringLen)
   251  			if intStringLen < 0 {
   252  				return ErrInvalidLengthMessage
   253  			}
   254  			postIndex := iNdEx + intStringLen
   255  			if postIndex < 0 {
   256  				return ErrInvalidLengthMessage
   257  			}
   258  			if postIndex > l {
   259  				return io.ErrUnexpectedEOF
   260  			}
   261  			m.ChannelID = string(dAtA[iNdEx:postIndex])
   262  			iNdEx = postIndex
   263  		case 2:
   264  			if wireType != 2 {
   265  				return fmt.Errorf("proto: wrong wireType = %d for field TargetIDs", wireType)
   266  			}
   267  			var byteLen int
   268  			for shift := uint(0); ; shift += 7 {
   269  				if shift >= 64 {
   270  					return ErrIntOverflowMessage
   271  				}
   272  				if iNdEx >= l {
   273  					return io.ErrUnexpectedEOF
   274  				}
   275  				b := dAtA[iNdEx]
   276  				iNdEx++
   277  				byteLen |= int(b&0x7F) << shift
   278  				if b < 0x80 {
   279  					break
   280  				}
   281  			}
   282  			if byteLen < 0 {
   283  				return ErrInvalidLengthMessage
   284  			}
   285  			postIndex := iNdEx + byteLen
   286  			if postIndex < 0 {
   287  				return ErrInvalidLengthMessage
   288  			}
   289  			if postIndex > l {
   290  				return io.ErrUnexpectedEOF
   291  			}
   292  			m.TargetIDs = append(m.TargetIDs, make([]byte, postIndex-iNdEx))
   293  			copy(m.TargetIDs[len(m.TargetIDs)-1], dAtA[iNdEx:postIndex])
   294  			iNdEx = postIndex
   295  		case 3:
   296  			if wireType != 2 {
   297  				return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType)
   298  			}
   299  			var byteLen int
   300  			for shift := uint(0); ; shift += 7 {
   301  				if shift >= 64 {
   302  					return ErrIntOverflowMessage
   303  				}
   304  				if iNdEx >= l {
   305  					return io.ErrUnexpectedEOF
   306  				}
   307  				b := dAtA[iNdEx]
   308  				iNdEx++
   309  				byteLen |= int(b&0x7F) << shift
   310  				if b < 0x80 {
   311  					break
   312  				}
   313  			}
   314  			if byteLen < 0 {
   315  				return ErrInvalidLengthMessage
   316  			}
   317  			postIndex := iNdEx + byteLen
   318  			if postIndex < 0 {
   319  				return ErrInvalidLengthMessage
   320  			}
   321  			if postIndex > l {
   322  				return io.ErrUnexpectedEOF
   323  			}
   324  			m.Payload = append(m.Payload[:0], dAtA[iNdEx:postIndex]...)
   325  			if m.Payload == nil {
   326  				m.Payload = []byte{}
   327  			}
   328  			iNdEx = postIndex
   329  		default:
   330  			iNdEx = preIndex
   331  			skippy, err := skipMessage(dAtA[iNdEx:])
   332  			if err != nil {
   333  				return err
   334  			}
   335  			if (skippy < 0) || (iNdEx+skippy) < 0 {
   336  				return ErrInvalidLengthMessage
   337  			}
   338  			if (iNdEx + skippy) > l {
   339  				return io.ErrUnexpectedEOF
   340  			}
   341  			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
   342  			iNdEx += skippy
   343  		}
   344  	}
   345  
   346  	if iNdEx > l {
   347  		return io.ErrUnexpectedEOF
   348  	}
   349  	return nil
   350  }
   351  func skipMessage(dAtA []byte) (n int, err error) {
   352  	l := len(dAtA)
   353  	iNdEx := 0
   354  	depth := 0
   355  	for iNdEx < l {
   356  		var wire uint64
   357  		for shift := uint(0); ; shift += 7 {
   358  			if shift >= 64 {
   359  				return 0, ErrIntOverflowMessage
   360  			}
   361  			if iNdEx >= l {
   362  				return 0, io.ErrUnexpectedEOF
   363  			}
   364  			b := dAtA[iNdEx]
   365  			iNdEx++
   366  			wire |= (uint64(b) & 0x7F) << shift
   367  			if b < 0x80 {
   368  				break
   369  			}
   370  		}
   371  		wireType := int(wire & 0x7)
   372  		switch wireType {
   373  		case 0:
   374  			for shift := uint(0); ; shift += 7 {
   375  				if shift >= 64 {
   376  					return 0, ErrIntOverflowMessage
   377  				}
   378  				if iNdEx >= l {
   379  					return 0, io.ErrUnexpectedEOF
   380  				}
   381  				iNdEx++
   382  				if dAtA[iNdEx-1] < 0x80 {
   383  					break
   384  				}
   385  			}
   386  		case 1:
   387  			iNdEx += 8
   388  		case 2:
   389  			var length int
   390  			for shift := uint(0); ; shift += 7 {
   391  				if shift >= 64 {
   392  					return 0, ErrIntOverflowMessage
   393  				}
   394  				if iNdEx >= l {
   395  					return 0, io.ErrUnexpectedEOF
   396  				}
   397  				b := dAtA[iNdEx]
   398  				iNdEx++
   399  				length |= (int(b) & 0x7F) << shift
   400  				if b < 0x80 {
   401  					break
   402  				}
   403  			}
   404  			if length < 0 {
   405  				return 0, ErrInvalidLengthMessage
   406  			}
   407  			iNdEx += length
   408  		case 3:
   409  			depth++
   410  		case 4:
   411  			if depth == 0 {
   412  				return 0, ErrUnexpectedEndOfGroupMessage
   413  			}
   414  			depth--
   415  		case 5:
   416  			iNdEx += 4
   417  		default:
   418  			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
   419  		}
   420  		if iNdEx < 0 {
   421  			return 0, ErrInvalidLengthMessage
   422  		}
   423  		if depth == 0 {
   424  			return iNdEx, nil
   425  		}
   426  	}
   427  	return 0, io.ErrUnexpectedEOF
   428  }
   429  
   430  var (
   431  	ErrInvalidLengthMessage        = fmt.Errorf("proto: negative length found during unmarshaling")
   432  	ErrIntOverflowMessage          = fmt.Errorf("proto: integer overflow")
   433  	ErrUnexpectedEndOfGroupMessage = fmt.Errorf("proto: unexpected end of group")
   434  )