go.etcd.io/etcd@v3.3.27+incompatible/snap/snappb/snap.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: snap.proto 3 4 package snappb 5 6 import ( 7 fmt "fmt" 8 io "io" 9 math "math" 10 math_bits "math/bits" 11 12 _ "github.com/gogo/protobuf/gogoproto" 13 proto "github.com/golang/protobuf/proto" 14 ) 15 16 // Reference imports to suppress errors if they are not otherwise used. 17 var _ = proto.Marshal 18 var _ = fmt.Errorf 19 var _ = math.Inf 20 21 // This is a compile-time assertion to ensure that this generated file 22 // is compatible with the proto package it is being compiled against. 23 // A compilation error at this line likely means your copy of the 24 // proto package needs to be updated. 25 const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package 26 27 type Snapshot struct { 28 Crc uint32 `protobuf:"varint,1,opt,name=crc" json:"crc"` 29 Data []byte `protobuf:"bytes,2,opt,name=data" json:"data,omitempty"` 30 XXX_NoUnkeyedLiteral struct{} `json:"-"` 31 XXX_unrecognized []byte `json:"-"` 32 XXX_sizecache int32 `json:"-"` 33 } 34 35 func (m *Snapshot) Reset() { *m = Snapshot{} } 36 func (m *Snapshot) String() string { return proto.CompactTextString(m) } 37 func (*Snapshot) ProtoMessage() {} 38 func (*Snapshot) Descriptor() ([]byte, []int) { 39 return fileDescriptor_f2e3c045ebf84d00, []int{0} 40 } 41 func (m *Snapshot) XXX_Unmarshal(b []byte) error { 42 return m.Unmarshal(b) 43 } 44 func (m *Snapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 45 if deterministic { 46 return xxx_messageInfo_Snapshot.Marshal(b, m, deterministic) 47 } else { 48 b = b[:cap(b)] 49 n, err := m.MarshalToSizedBuffer(b) 50 if err != nil { 51 return nil, err 52 } 53 return b[:n], nil 54 } 55 } 56 func (m *Snapshot) XXX_Merge(src proto.Message) { 57 xxx_messageInfo_Snapshot.Merge(m, src) 58 } 59 func (m *Snapshot) XXX_Size() int { 60 return m.Size() 61 } 62 func (m *Snapshot) XXX_DiscardUnknown() { 63 xxx_messageInfo_Snapshot.DiscardUnknown(m) 64 } 65 66 var xxx_messageInfo_Snapshot proto.InternalMessageInfo 67 68 func init() { 69 proto.RegisterType((*Snapshot)(nil), "snappb.snapshot") 70 } 71 72 func init() { proto.RegisterFile("snap.proto", fileDescriptor_f2e3c045ebf84d00) } 73 74 var fileDescriptor_f2e3c045ebf84d00 = []byte{ 75 // 126 bytes of a gzipped FileDescriptorProto 76 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2a, 0xce, 0x4b, 0x2c, 77 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x03, 0xb1, 0x0b, 0x92, 0xa4, 0x44, 0xd2, 0xf3, 78 0xd3, 0xf3, 0xc1, 0x42, 0xfa, 0x20, 0x16, 0x44, 0x56, 0xc9, 0x8c, 0x8b, 0x03, 0x24, 0x5f, 0x9c, 79 0x91, 0x5f, 0x22, 0x24, 0xc6, 0xc5, 0x9c, 0x5c, 0x94, 0x2c, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0xeb, 80 0xc4, 0x72, 0xe2, 0x9e, 0x3c, 0x43, 0x10, 0x48, 0x40, 0x48, 0x88, 0x8b, 0x25, 0x25, 0xb1, 0x24, 81 0x51, 0x82, 0x49, 0x81, 0x51, 0x83, 0x27, 0x08, 0xcc, 0x76, 0x12, 0x39, 0xf1, 0x50, 0x8e, 0xe1, 82 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf1, 0x58, 0x8e, 83 0x01, 0x10, 0x00, 0x00, 0xff, 0xff, 0xd8, 0x0f, 0x32, 0xb2, 0x78, 0x00, 0x00, 0x00, 84 } 85 86 func (m *Snapshot) Marshal() (dAtA []byte, err error) { 87 size := m.Size() 88 dAtA = make([]byte, size) 89 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 90 if err != nil { 91 return nil, err 92 } 93 return dAtA[:n], nil 94 } 95 96 func (m *Snapshot) MarshalTo(dAtA []byte) (int, error) { 97 size := m.Size() 98 return m.MarshalToSizedBuffer(dAtA[:size]) 99 } 100 101 func (m *Snapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) { 102 i := len(dAtA) 103 _ = i 104 var l int 105 _ = l 106 if m.XXX_unrecognized != nil { 107 i -= len(m.XXX_unrecognized) 108 copy(dAtA[i:], m.XXX_unrecognized) 109 } 110 if m.Data != nil { 111 i -= len(m.Data) 112 copy(dAtA[i:], m.Data) 113 i = encodeVarintSnap(dAtA, i, uint64(len(m.Data))) 114 i-- 115 dAtA[i] = 0x12 116 } 117 i = encodeVarintSnap(dAtA, i, uint64(m.Crc)) 118 i-- 119 dAtA[i] = 0x8 120 return len(dAtA) - i, nil 121 } 122 123 func encodeVarintSnap(dAtA []byte, offset int, v uint64) int { 124 offset -= sovSnap(v) 125 base := offset 126 for v >= 1<<7 { 127 dAtA[offset] = uint8(v&0x7f | 0x80) 128 v >>= 7 129 offset++ 130 } 131 dAtA[offset] = uint8(v) 132 return base 133 } 134 func (m *Snapshot) Size() (n int) { 135 if m == nil { 136 return 0 137 } 138 var l int 139 _ = l 140 n += 1 + sovSnap(uint64(m.Crc)) 141 if m.Data != nil { 142 l = len(m.Data) 143 n += 1 + l + sovSnap(uint64(l)) 144 } 145 if m.XXX_unrecognized != nil { 146 n += len(m.XXX_unrecognized) 147 } 148 return n 149 } 150 151 func sovSnap(x uint64) (n int) { 152 return (math_bits.Len64(x|1) + 6) / 7 153 } 154 func sozSnap(x uint64) (n int) { 155 return sovSnap(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 156 } 157 func (m *Snapshot) Unmarshal(dAtA []byte) error { 158 l := len(dAtA) 159 iNdEx := 0 160 for iNdEx < l { 161 preIndex := iNdEx 162 var wire uint64 163 for shift := uint(0); ; shift += 7 { 164 if shift >= 64 { 165 return ErrIntOverflowSnap 166 } 167 if iNdEx >= l { 168 return io.ErrUnexpectedEOF 169 } 170 b := dAtA[iNdEx] 171 iNdEx++ 172 wire |= uint64(b&0x7F) << shift 173 if b < 0x80 { 174 break 175 } 176 } 177 fieldNum := int32(wire >> 3) 178 wireType := int(wire & 0x7) 179 if wireType == 4 { 180 return fmt.Errorf("proto: snapshot: wiretype end group for non-group") 181 } 182 if fieldNum <= 0 { 183 return fmt.Errorf("proto: snapshot: illegal tag %d (wire type %d)", fieldNum, wire) 184 } 185 switch fieldNum { 186 case 1: 187 if wireType != 0 { 188 return fmt.Errorf("proto: wrong wireType = %d for field Crc", wireType) 189 } 190 m.Crc = 0 191 for shift := uint(0); ; shift += 7 { 192 if shift >= 64 { 193 return ErrIntOverflowSnap 194 } 195 if iNdEx >= l { 196 return io.ErrUnexpectedEOF 197 } 198 b := dAtA[iNdEx] 199 iNdEx++ 200 m.Crc |= uint32(b&0x7F) << shift 201 if b < 0x80 { 202 break 203 } 204 } 205 case 2: 206 if wireType != 2 { 207 return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) 208 } 209 var byteLen int 210 for shift := uint(0); ; shift += 7 { 211 if shift >= 64 { 212 return ErrIntOverflowSnap 213 } 214 if iNdEx >= l { 215 return io.ErrUnexpectedEOF 216 } 217 b := dAtA[iNdEx] 218 iNdEx++ 219 byteLen |= int(b&0x7F) << shift 220 if b < 0x80 { 221 break 222 } 223 } 224 if byteLen < 0 { 225 return ErrInvalidLengthSnap 226 } 227 postIndex := iNdEx + byteLen 228 if postIndex < 0 { 229 return ErrInvalidLengthSnap 230 } 231 if postIndex > l { 232 return io.ErrUnexpectedEOF 233 } 234 m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) 235 if m.Data == nil { 236 m.Data = []byte{} 237 } 238 iNdEx = postIndex 239 default: 240 iNdEx = preIndex 241 skippy, err := skipSnap(dAtA[iNdEx:]) 242 if err != nil { 243 return err 244 } 245 if skippy < 0 { 246 return ErrInvalidLengthSnap 247 } 248 if (iNdEx + skippy) < 0 { 249 return ErrInvalidLengthSnap 250 } 251 if (iNdEx + skippy) > l { 252 return io.ErrUnexpectedEOF 253 } 254 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 255 iNdEx += skippy 256 } 257 } 258 259 if iNdEx > l { 260 return io.ErrUnexpectedEOF 261 } 262 return nil 263 } 264 func skipSnap(dAtA []byte) (n int, err error) { 265 l := len(dAtA) 266 iNdEx := 0 267 for iNdEx < l { 268 var wire uint64 269 for shift := uint(0); ; shift += 7 { 270 if shift >= 64 { 271 return 0, ErrIntOverflowSnap 272 } 273 if iNdEx >= l { 274 return 0, io.ErrUnexpectedEOF 275 } 276 b := dAtA[iNdEx] 277 iNdEx++ 278 wire |= (uint64(b) & 0x7F) << shift 279 if b < 0x80 { 280 break 281 } 282 } 283 wireType := int(wire & 0x7) 284 switch wireType { 285 case 0: 286 for shift := uint(0); ; shift += 7 { 287 if shift >= 64 { 288 return 0, ErrIntOverflowSnap 289 } 290 if iNdEx >= l { 291 return 0, io.ErrUnexpectedEOF 292 } 293 iNdEx++ 294 if dAtA[iNdEx-1] < 0x80 { 295 break 296 } 297 } 298 return iNdEx, nil 299 case 1: 300 iNdEx += 8 301 return iNdEx, nil 302 case 2: 303 var length int 304 for shift := uint(0); ; shift += 7 { 305 if shift >= 64 { 306 return 0, ErrIntOverflowSnap 307 } 308 if iNdEx >= l { 309 return 0, io.ErrUnexpectedEOF 310 } 311 b := dAtA[iNdEx] 312 iNdEx++ 313 length |= (int(b) & 0x7F) << shift 314 if b < 0x80 { 315 break 316 } 317 } 318 if length < 0 { 319 return 0, ErrInvalidLengthSnap 320 } 321 iNdEx += length 322 if iNdEx < 0 { 323 return 0, ErrInvalidLengthSnap 324 } 325 return iNdEx, nil 326 case 3: 327 for { 328 var innerWire uint64 329 var start int = iNdEx 330 for shift := uint(0); ; shift += 7 { 331 if shift >= 64 { 332 return 0, ErrIntOverflowSnap 333 } 334 if iNdEx >= l { 335 return 0, io.ErrUnexpectedEOF 336 } 337 b := dAtA[iNdEx] 338 iNdEx++ 339 innerWire |= (uint64(b) & 0x7F) << shift 340 if b < 0x80 { 341 break 342 } 343 } 344 innerWireType := int(innerWire & 0x7) 345 if innerWireType == 4 { 346 break 347 } 348 next, err := skipSnap(dAtA[start:]) 349 if err != nil { 350 return 0, err 351 } 352 iNdEx = start + next 353 if iNdEx < 0 { 354 return 0, ErrInvalidLengthSnap 355 } 356 } 357 return iNdEx, nil 358 case 4: 359 return iNdEx, nil 360 case 5: 361 iNdEx += 4 362 return iNdEx, nil 363 default: 364 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 365 } 366 } 367 panic("unreachable") 368 } 369 370 var ( 371 ErrInvalidLengthSnap = fmt.Errorf("proto: negative length found during unmarshaling") 372 ErrIntOverflowSnap = fmt.Errorf("proto: integer overflow") 373 )