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