github.com/m3db/m3@v1.5.0/src/cluster/generated/proto/changesetpb/changeset.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: github.com/m3db/m3/src/cluster/generated/proto/changesetpb/changeset.proto 3 4 // Copyright (c) 2018 Uber Technologies, Inc. 5 // 6 // Permission is hereby granted, free of charge, to any person obtaining a copy 7 // of this software and associated documentation files (the "Software"), to deal 8 // in the Software without restriction, including without limitation the rights 9 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 // copies of the Software, and to permit persons to whom the Software is 11 // furnished to do so, subject to the following conditions: 12 // 13 // The above copyright notice and this permission notice shall be included in 14 // all copies or substantial portions of the Software. 15 // 16 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 // THE SOFTWARE. 23 24 /* 25 Package changesetpb is a generated protocol buffer package. 26 27 It is generated from these files: 28 github.com/m3db/m3/src/cluster/generated/proto/changesetpb/changeset.proto 29 30 It has these top-level messages: 31 ChangeSet 32 */ 33 package changesetpb 34 35 import proto "github.com/gogo/protobuf/proto" 36 import fmt "fmt" 37 import math "math" 38 39 import io "io" 40 41 // Reference imports to suppress errors if they are not otherwise used. 42 var _ = proto.Marshal 43 var _ = fmt.Errorf 44 var _ = math.Inf 45 46 // This is a compile-time assertion to ensure that this generated file 47 // is compatible with the proto package it is being compiled against. 48 // A compilation error at this line likely means your copy of the 49 // proto package needs to be updated. 50 const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package 51 52 // ChangeSetState tracks the stateof a changeset 53 type ChangeSetState int32 54 55 const ( 56 ChangeSetState_UNKNOWN ChangeSetState = 0 57 ChangeSetState_OPEN ChangeSetState = 1 58 ChangeSetState_CLOSED ChangeSetState = 2 59 ) 60 61 var ChangeSetState_name = map[int32]string{ 62 0: "UNKNOWN", 63 1: "OPEN", 64 2: "CLOSED", 65 } 66 var ChangeSetState_value = map[string]int32{ 67 "UNKNOWN": 0, 68 "OPEN": 1, 69 "CLOSED": 2, 70 } 71 72 func (x ChangeSetState) String() string { 73 return proto.EnumName(ChangeSetState_name, int32(x)) 74 } 75 func (ChangeSetState) EnumDescriptor() ([]byte, []int) { return fileDescriptorChangeset, []int{0} } 76 77 // A ChangeSet is a set of changes that are applied together. The exact 78 // format of the changes is up to the application; the ChangeSet simply 79 // tracks the state of application 80 type ChangeSet struct { 81 // for_version is the version of configuration on which this ChangeSet is built 82 ForVersion int32 `protobuf:"varint,1,opt,name=for_version,json=forVersion,proto3" json:"for_version,omitempty"` 83 // state is the state of the ChangeSet 84 State ChangeSetState `protobuf:"varint,2,opt,name=state,proto3,enum=changesetpb.ChangeSetState" json:"state,omitempty"` 85 // changes are the marshalled form of the changes 86 Changes []byte `protobuf:"bytes,3,opt,name=changes,proto3" json:"changes,omitempty"` 87 } 88 89 func (m *ChangeSet) Reset() { *m = ChangeSet{} } 90 func (m *ChangeSet) String() string { return proto.CompactTextString(m) } 91 func (*ChangeSet) ProtoMessage() {} 92 func (*ChangeSet) Descriptor() ([]byte, []int) { return fileDescriptorChangeset, []int{0} } 93 94 func (m *ChangeSet) GetForVersion() int32 { 95 if m != nil { 96 return m.ForVersion 97 } 98 return 0 99 } 100 101 func (m *ChangeSet) GetState() ChangeSetState { 102 if m != nil { 103 return m.State 104 } 105 return ChangeSetState_UNKNOWN 106 } 107 108 func (m *ChangeSet) GetChanges() []byte { 109 if m != nil { 110 return m.Changes 111 } 112 return nil 113 } 114 115 func init() { 116 proto.RegisterType((*ChangeSet)(nil), "changesetpb.ChangeSet") 117 proto.RegisterEnum("changesetpb.ChangeSetState", ChangeSetState_name, ChangeSetState_value) 118 } 119 func (m *ChangeSet) Marshal() (dAtA []byte, err error) { 120 size := m.Size() 121 dAtA = make([]byte, size) 122 n, err := m.MarshalTo(dAtA) 123 if err != nil { 124 return nil, err 125 } 126 return dAtA[:n], nil 127 } 128 129 func (m *ChangeSet) MarshalTo(dAtA []byte) (int, error) { 130 var i int 131 _ = i 132 var l int 133 _ = l 134 if m.ForVersion != 0 { 135 dAtA[i] = 0x8 136 i++ 137 i = encodeVarintChangeset(dAtA, i, uint64(m.ForVersion)) 138 } 139 if m.State != 0 { 140 dAtA[i] = 0x10 141 i++ 142 i = encodeVarintChangeset(dAtA, i, uint64(m.State)) 143 } 144 if len(m.Changes) > 0 { 145 dAtA[i] = 0x1a 146 i++ 147 i = encodeVarintChangeset(dAtA, i, uint64(len(m.Changes))) 148 i += copy(dAtA[i:], m.Changes) 149 } 150 return i, nil 151 } 152 153 func encodeVarintChangeset(dAtA []byte, offset int, v uint64) int { 154 for v >= 1<<7 { 155 dAtA[offset] = uint8(v&0x7f | 0x80) 156 v >>= 7 157 offset++ 158 } 159 dAtA[offset] = uint8(v) 160 return offset + 1 161 } 162 func (m *ChangeSet) Size() (n int) { 163 var l int 164 _ = l 165 if m.ForVersion != 0 { 166 n += 1 + sovChangeset(uint64(m.ForVersion)) 167 } 168 if m.State != 0 { 169 n += 1 + sovChangeset(uint64(m.State)) 170 } 171 l = len(m.Changes) 172 if l > 0 { 173 n += 1 + l + sovChangeset(uint64(l)) 174 } 175 return n 176 } 177 178 func sovChangeset(x uint64) (n int) { 179 for { 180 n++ 181 x >>= 7 182 if x == 0 { 183 break 184 } 185 } 186 return n 187 } 188 func sozChangeset(x uint64) (n int) { 189 return sovChangeset(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 190 } 191 func (m *ChangeSet) Unmarshal(dAtA []byte) error { 192 l := len(dAtA) 193 iNdEx := 0 194 for iNdEx < l { 195 preIndex := iNdEx 196 var wire uint64 197 for shift := uint(0); ; shift += 7 { 198 if shift >= 64 { 199 return ErrIntOverflowChangeset 200 } 201 if iNdEx >= l { 202 return io.ErrUnexpectedEOF 203 } 204 b := dAtA[iNdEx] 205 iNdEx++ 206 wire |= (uint64(b) & 0x7F) << shift 207 if b < 0x80 { 208 break 209 } 210 } 211 fieldNum := int32(wire >> 3) 212 wireType := int(wire & 0x7) 213 if wireType == 4 { 214 return fmt.Errorf("proto: ChangeSet: wiretype end group for non-group") 215 } 216 if fieldNum <= 0 { 217 return fmt.Errorf("proto: ChangeSet: illegal tag %d (wire type %d)", fieldNum, wire) 218 } 219 switch fieldNum { 220 case 1: 221 if wireType != 0 { 222 return fmt.Errorf("proto: wrong wireType = %d for field ForVersion", wireType) 223 } 224 m.ForVersion = 0 225 for shift := uint(0); ; shift += 7 { 226 if shift >= 64 { 227 return ErrIntOverflowChangeset 228 } 229 if iNdEx >= l { 230 return io.ErrUnexpectedEOF 231 } 232 b := dAtA[iNdEx] 233 iNdEx++ 234 m.ForVersion |= (int32(b) & 0x7F) << shift 235 if b < 0x80 { 236 break 237 } 238 } 239 case 2: 240 if wireType != 0 { 241 return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) 242 } 243 m.State = 0 244 for shift := uint(0); ; shift += 7 { 245 if shift >= 64 { 246 return ErrIntOverflowChangeset 247 } 248 if iNdEx >= l { 249 return io.ErrUnexpectedEOF 250 } 251 b := dAtA[iNdEx] 252 iNdEx++ 253 m.State |= (ChangeSetState(b) & 0x7F) << shift 254 if b < 0x80 { 255 break 256 } 257 } 258 case 3: 259 if wireType != 2 { 260 return fmt.Errorf("proto: wrong wireType = %d for field Changes", wireType) 261 } 262 var byteLen int 263 for shift := uint(0); ; shift += 7 { 264 if shift >= 64 { 265 return ErrIntOverflowChangeset 266 } 267 if iNdEx >= l { 268 return io.ErrUnexpectedEOF 269 } 270 b := dAtA[iNdEx] 271 iNdEx++ 272 byteLen |= (int(b) & 0x7F) << shift 273 if b < 0x80 { 274 break 275 } 276 } 277 if byteLen < 0 { 278 return ErrInvalidLengthChangeset 279 } 280 postIndex := iNdEx + byteLen 281 if postIndex > l { 282 return io.ErrUnexpectedEOF 283 } 284 m.Changes = append(m.Changes[:0], dAtA[iNdEx:postIndex]...) 285 if m.Changes == nil { 286 m.Changes = []byte{} 287 } 288 iNdEx = postIndex 289 default: 290 iNdEx = preIndex 291 skippy, err := skipChangeset(dAtA[iNdEx:]) 292 if err != nil { 293 return err 294 } 295 if skippy < 0 { 296 return ErrInvalidLengthChangeset 297 } 298 if (iNdEx + skippy) > l { 299 return io.ErrUnexpectedEOF 300 } 301 iNdEx += skippy 302 } 303 } 304 305 if iNdEx > l { 306 return io.ErrUnexpectedEOF 307 } 308 return nil 309 } 310 func skipChangeset(dAtA []byte) (n int, err error) { 311 l := len(dAtA) 312 iNdEx := 0 313 for iNdEx < l { 314 var wire uint64 315 for shift := uint(0); ; shift += 7 { 316 if shift >= 64 { 317 return 0, ErrIntOverflowChangeset 318 } 319 if iNdEx >= l { 320 return 0, io.ErrUnexpectedEOF 321 } 322 b := dAtA[iNdEx] 323 iNdEx++ 324 wire |= (uint64(b) & 0x7F) << shift 325 if b < 0x80 { 326 break 327 } 328 } 329 wireType := int(wire & 0x7) 330 switch wireType { 331 case 0: 332 for shift := uint(0); ; shift += 7 { 333 if shift >= 64 { 334 return 0, ErrIntOverflowChangeset 335 } 336 if iNdEx >= l { 337 return 0, io.ErrUnexpectedEOF 338 } 339 iNdEx++ 340 if dAtA[iNdEx-1] < 0x80 { 341 break 342 } 343 } 344 return iNdEx, nil 345 case 1: 346 iNdEx += 8 347 return iNdEx, nil 348 case 2: 349 var length int 350 for shift := uint(0); ; shift += 7 { 351 if shift >= 64 { 352 return 0, ErrIntOverflowChangeset 353 } 354 if iNdEx >= l { 355 return 0, io.ErrUnexpectedEOF 356 } 357 b := dAtA[iNdEx] 358 iNdEx++ 359 length |= (int(b) & 0x7F) << shift 360 if b < 0x80 { 361 break 362 } 363 } 364 iNdEx += length 365 if length < 0 { 366 return 0, ErrInvalidLengthChangeset 367 } 368 return iNdEx, nil 369 case 3: 370 for { 371 var innerWire uint64 372 var start int = iNdEx 373 for shift := uint(0); ; shift += 7 { 374 if shift >= 64 { 375 return 0, ErrIntOverflowChangeset 376 } 377 if iNdEx >= l { 378 return 0, io.ErrUnexpectedEOF 379 } 380 b := dAtA[iNdEx] 381 iNdEx++ 382 innerWire |= (uint64(b) & 0x7F) << shift 383 if b < 0x80 { 384 break 385 } 386 } 387 innerWireType := int(innerWire & 0x7) 388 if innerWireType == 4 { 389 break 390 } 391 next, err := skipChangeset(dAtA[start:]) 392 if err != nil { 393 return 0, err 394 } 395 iNdEx = start + next 396 } 397 return iNdEx, nil 398 case 4: 399 return iNdEx, nil 400 case 5: 401 iNdEx += 4 402 return iNdEx, nil 403 default: 404 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 405 } 406 } 407 panic("unreachable") 408 } 409 410 var ( 411 ErrInvalidLengthChangeset = fmt.Errorf("proto: negative length found during unmarshaling") 412 ErrIntOverflowChangeset = fmt.Errorf("proto: integer overflow") 413 ) 414 415 func init() { 416 proto.RegisterFile("github.com/m3db/m3/src/cluster/generated/proto/changesetpb/changeset.proto", fileDescriptorChangeset) 417 } 418 419 var fileDescriptorChangeset = []byte{ 420 // 241 bytes of a gzipped FileDescriptorProto 421 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xf2, 0x4a, 0xcf, 0x2c, 0xc9, 422 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0xcf, 0x35, 0x4e, 0x49, 0xd2, 0xcf, 0x35, 0xd6, 0x2f, 423 0x2e, 0x4a, 0xd6, 0x4f, 0xce, 0x29, 0x2d, 0x2e, 0x49, 0x2d, 0xd2, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 424 0x4a, 0x2c, 0x49, 0x4d, 0xd1, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0xd7, 0x4f, 0xce, 0x48, 0xcc, 0x4b, 425 0x4f, 0x2d, 0x4e, 0x2d, 0x29, 0x48, 0x42, 0xb0, 0xf5, 0xc0, 0x72, 0x42, 0xdc, 0x48, 0x92, 0x4a, 426 0x95, 0x5c, 0x9c, 0xce, 0x60, 0x6e, 0x70, 0x6a, 0x89, 0x90, 0x3c, 0x17, 0x77, 0x5a, 0x7e, 0x51, 427 0x7c, 0x59, 0x6a, 0x51, 0x71, 0x66, 0x7e, 0x9e, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0x6b, 0x10, 0x57, 428 0x5a, 0x7e, 0x51, 0x18, 0x44, 0x44, 0xc8, 0x90, 0x8b, 0xb5, 0xb8, 0x24, 0xb1, 0x24, 0x55, 0x82, 429 0x49, 0x81, 0x51, 0x83, 0xcf, 0x48, 0x5a, 0x0f, 0xc9, 0x28, 0x3d, 0xb8, 0x39, 0xc1, 0x20, 0x25, 430 0x41, 0x10, 0x95, 0x42, 0x12, 0x5c, 0xec, 0x50, 0x45, 0x12, 0xcc, 0x0a, 0x8c, 0x1a, 0x3c, 0x41, 431 0x30, 0xae, 0x96, 0x31, 0x17, 0x1f, 0xaa, 0x16, 0x21, 0x6e, 0x2e, 0xf6, 0x50, 0x3f, 0x6f, 0x3f, 432 0xff, 0x70, 0x3f, 0x01, 0x06, 0x21, 0x0e, 0x2e, 0x16, 0xff, 0x00, 0x57, 0x3f, 0x01, 0x46, 0x21, 433 0x2e, 0x2e, 0x36, 0x67, 0x1f, 0xff, 0x60, 0x57, 0x17, 0x01, 0x26, 0x27, 0x81, 0x13, 0x8f, 0xe4, 434 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x24, 0x36, 435 0xb0, 0xaf, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xf0, 0xed, 0x57, 0x5c, 0x23, 0x01, 0x00, 436 0x00, 437 }