| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
package moby_buildkit_v1_sourcepolicy |
| 6 |
|
| 7 |
import ( |
| 8 |
fmt "fmt" |
| 9 |
protohelpers "github.com/planetscale/vtprotobuf/protohelpers" |
| 10 |
proto "google.golang.org/protobuf/proto" |
| 11 |
protoimpl "google.golang.org/protobuf/runtime/protoimpl" |
| 12 |
io "io" |
| 13 |
) |
| 14 |
|
| 15 |
const ( |
| 16 |
|
| 17 |
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) |
| 18 |
|
| 19 |
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) |
| 20 |
) |
| 21 |
|
| 22 |
func (m *Rule) CloneVT() *Rule { |
| 23 |
if m == nil { |
| 24 |
return (*Rule)(nil) |
| 25 |
} |
| 26 |
r := new(Rule) |
| 27 |
r.Action = m.Action |
| 28 |
r.Selector = m.Selector.CloneVT() |
| 29 |
r.Updates = m.Updates.CloneVT() |
| 30 |
if len(m.unknownFields) > 0 { |
| 31 |
r.unknownFields = make([]byte, len(m.unknownFields)) |
| 32 |
copy(r.unknownFields, m.unknownFields) |
| 33 |
} |
| 34 |
return r |
| 35 |
} |
| 36 |
|
| 37 |
func (m *Rule) CloneMessageVT() proto.Message { |
| 38 |
return m.CloneVT() |
| 39 |
} |
| 40 |
|
| 41 |
func (m *Update) CloneVT() *Update { |
| 42 |
if m == nil { |
| 43 |
return (*Update)(nil) |
| 44 |
} |
| 45 |
r := new(Update) |
| 46 |
r.Identifier = m.Identifier |
| 47 |
if rhs := m.Attrs; rhs != nil { |
| 48 |
tmpContainer := make(map[string]string, len(rhs)) |
| 49 |
for k, v := range rhs { |
| 50 |
tmpContainer[k] = v |
| 51 |
} |
| 52 |
r.Attrs = tmpContainer |
| 53 |
} |
| 54 |
if len(m.unknownFields) > 0 { |
| 55 |
r.unknownFields = make([]byte, len(m.unknownFields)) |
| 56 |
copy(r.unknownFields, m.unknownFields) |
| 57 |
} |
| 58 |
return r |
| 59 |
} |
| 60 |
|
| 61 |
func (m *Update) CloneMessageVT() proto.Message { |
| 62 |
return m.CloneVT() |
| 63 |
} |
| 64 |
|
| 65 |
func (m *Selector) CloneVT() *Selector { |
| 66 |
if m == nil { |
| 67 |
return (*Selector)(nil) |
| 68 |
} |
| 69 |
r := new(Selector) |
| 70 |
r.Identifier = m.Identifier |
| 71 |
r.MatchType = m.MatchType |
| 72 |
if rhs := m.Constraints; rhs != nil { |
| 73 |
tmpContainer := make([]*AttrConstraint, len(rhs)) |
| 74 |
for k, v := range rhs { |
| 75 |
tmpContainer[k] = v.CloneVT() |
| 76 |
} |
| 77 |
r.Constraints = tmpContainer |
| 78 |
} |
| 79 |
if len(m.unknownFields) > 0 { |
| 80 |
r.unknownFields = make([]byte, len(m.unknownFields)) |
| 81 |
copy(r.unknownFields, m.unknownFields) |
| 82 |
} |
| 83 |
return r |
| 84 |
} |
| 85 |
|
| 86 |
func (m *Selector) CloneMessageVT() proto.Message { |
| 87 |
return m.CloneVT() |
| 88 |
} |
| 89 |
|
| 90 |
func (m *AttrConstraint) CloneVT() *AttrConstraint { |
| 91 |
if m == nil { |
| 92 |
return (*AttrConstraint)(nil) |
| 93 |
} |
| 94 |
r := new(AttrConstraint) |
| 95 |
r.Key = m.Key |
| 96 |
r.Value = m.Value |
| 97 |
r.Condition = m.Condition |
| 98 |
if len(m.unknownFields) > 0 { |
| 99 |
r.unknownFields = make([]byte, len(m.unknownFields)) |
| 100 |
copy(r.unknownFields, m.unknownFields) |
| 101 |
} |
| 102 |
return r |
| 103 |
} |
| 104 |
|
| 105 |
func (m *AttrConstraint) CloneMessageVT() proto.Message { |
| 106 |
return m.CloneVT() |
| 107 |
} |
| 108 |
|
| 109 |
func (m *Policy) CloneVT() *Policy { |
| 110 |
if m == nil { |
| 111 |
return (*Policy)(nil) |
| 112 |
} |
| 113 |
r := new(Policy) |
| 114 |
r.Version = m.Version |
| 115 |
if rhs := m.Rules; rhs != nil { |
| 116 |
tmpContainer := make([]*Rule, len(rhs)) |
| 117 |
for k, v := range rhs { |
| 118 |
tmpContainer[k] = v.CloneVT() |
| 119 |
} |
| 120 |
r.Rules = tmpContainer |
| 121 |
} |
| 122 |
if len(m.unknownFields) > 0 { |
| 123 |
r.unknownFields = make([]byte, len(m.unknownFields)) |
| 124 |
copy(r.unknownFields, m.unknownFields) |
| 125 |
} |
| 126 |
return r |
| 127 |
} |
| 128 |
|
| 129 |
func (m *Policy) CloneMessageVT() proto.Message { |
| 130 |
return m.CloneVT() |
| 131 |
} |
| 132 |
|
| 133 |
func (this *Rule) EqualVT(that *Rule) bool { |
| 134 |
if this == that { |
| 135 |
return true |
| 136 |
} else if this == nil || that == nil { |
| 137 |
return false |
| 138 |
} |
| 139 |
if this.Action != that.Action { |
| 140 |
return false |
| 141 |
} |
| 142 |
if !this.Selector.EqualVT(that.Selector) { |
| 143 |
return false |
| 144 |
} |
| 145 |
if !this.Updates.EqualVT(that.Updates) { |
| 146 |
return false |
| 147 |
} |
| 148 |
return string(this.unknownFields) == string(that.unknownFields) |
| 149 |
} |
| 150 |
|
| 151 |
func (this *Rule) EqualMessageVT(thatMsg proto.Message) bool { |
| 152 |
that, ok := thatMsg.(*Rule) |
| 153 |
if !ok { |
| 154 |
return false |
| 155 |
} |
| 156 |
return this.EqualVT(that) |
| 157 |
} |
| 158 |
func (this *Update) EqualVT(that *Update) bool { |
| 159 |
if this == that { |
| 160 |
return true |
| 161 |
} else if this == nil || that == nil { |
| 162 |
return false |
| 163 |
} |
| 164 |
if this.Identifier != that.Identifier { |
| 165 |
return false |
| 166 |
} |
| 167 |
if len(this.Attrs) != len(that.Attrs) { |
| 168 |
return false |
| 169 |
} |
| 170 |
for i, vx := range this.Attrs { |
| 171 |
vy, ok := that.Attrs[i] |
| 172 |
if !ok { |
| 173 |
return false |
| 174 |
} |
| 175 |
if vx != vy { |
| 176 |
return false |
| 177 |
} |
| 178 |
} |
| 179 |
return string(this.unknownFields) == string(that.unknownFields) |
| 180 |
} |
| 181 |
|
| 182 |
func (this *Update) EqualMessageVT(thatMsg proto.Message) bool { |
| 183 |
that, ok := thatMsg.(*Update) |
| 184 |
if !ok { |
| 185 |
return false |
| 186 |
} |
| 187 |
return this.EqualVT(that) |
| 188 |
} |
| 189 |
func (this *Selector) EqualVT(that *Selector) bool { |
| 190 |
if this == that { |
| 191 |
return true |
| 192 |
} else if this == nil || that == nil { |
| 193 |
return false |
| 194 |
} |
| 195 |
if this.Identifier != that.Identifier { |
| 196 |
return false |
| 197 |
} |
| 198 |
if this.MatchType != that.MatchType { |
| 199 |
return false |
| 200 |
} |
| 201 |
if len(this.Constraints) != len(that.Constraints) { |
| 202 |
return false |
| 203 |
} |
| 204 |
for i, vx := range this.Constraints { |
| 205 |
vy := that.Constraints[i] |
| 206 |
if p, q := vx, vy; p != q { |
| 207 |
if p == nil { |
| 208 |
p = &AttrConstraint{} |
| 209 |
} |
| 210 |
if q == nil { |
| 211 |
q = &AttrConstraint{} |
| 212 |
} |
| 213 |
if !p.EqualVT(q) { |
| 214 |
return false |
| 215 |
} |
| 216 |
} |
| 217 |
} |
| 218 |
return string(this.unknownFields) == string(that.unknownFields) |
| 219 |
} |
| 220 |
|
| 221 |
func (this *Selector) EqualMessageVT(thatMsg proto.Message) bool { |
| 222 |
that, ok := thatMsg.(*Selector) |
| 223 |
if !ok { |
| 224 |
return false |
| 225 |
} |
| 226 |
return this.EqualVT(that) |
| 227 |
} |
| 228 |
func (this *AttrConstraint) EqualVT(that *AttrConstraint) bool { |
| 229 |
if this == that { |
| 230 |
return true |
| 231 |
} else if this == nil || that == nil { |
| 232 |
return false |
| 233 |
} |
| 234 |
if this.Key != that.Key { |
| 235 |
return false |
| 236 |
} |
| 237 |
if this.Value != that.Value { |
| 238 |
return false |
| 239 |
} |
| 240 |
if this.Condition != that.Condition { |
| 241 |
return false |
| 242 |
} |
| 243 |
return string(this.unknownFields) == string(that.unknownFields) |
| 244 |
} |
| 245 |
|
| 246 |
func (this *AttrConstraint) EqualMessageVT(thatMsg proto.Message) bool { |
| 247 |
that, ok := thatMsg.(*AttrConstraint) |
| 248 |
if !ok { |
| 249 |
return false |
| 250 |
} |
| 251 |
return this.EqualVT(that) |
| 252 |
} |
| 253 |
func (this *Policy) EqualVT(that *Policy) bool { |
| 254 |
if this == that { |
| 255 |
return true |
| 256 |
} else if this == nil || that == nil { |
| 257 |
return false |
| 258 |
} |
| 259 |
if this.Version != that.Version { |
| 260 |
return false |
| 261 |
} |
| 262 |
if len(this.Rules) != len(that.Rules) { |
| 263 |
return false |
| 264 |
} |
| 265 |
for i, vx := range this.Rules { |
| 266 |
vy := that.Rules[i] |
| 267 |
if p, q := vx, vy; p != q { |
| 268 |
if p == nil { |
| 269 |
p = &Rule{} |
| 270 |
} |
| 271 |
if q == nil { |
| 272 |
q = &Rule{} |
| 273 |
} |
| 274 |
if !p.EqualVT(q) { |
| 275 |
return false |
| 276 |
} |
| 277 |
} |
| 278 |
} |
| 279 |
return string(this.unknownFields) == string(that.unknownFields) |
| 280 |
} |
| 281 |
|
| 282 |
func (this *Policy) EqualMessageVT(thatMsg proto.Message) bool { |
| 283 |
that, ok := thatMsg.(*Policy) |
| 284 |
if !ok { |
| 285 |
return false |
| 286 |
} |
| 287 |
return this.EqualVT(that) |
| 288 |
} |
| 289 |
func (m *Rule) MarshalVT() (dAtA []byte, err error) { |
| 290 |
if m == nil { |
| 291 |
return nil, nil |
| 292 |
} |
| 293 |
size := m.SizeVT() |
| 294 |
dAtA = make([]byte, size) |
| 295 |
n, err := m.MarshalToSizedBufferVT(dAtA[:size]) |
| 296 |
if err != nil { |
| 297 |
return nil, err |
| 298 |
} |
| 299 |
return dAtA[:n], nil |
| 300 |
} |
| 301 |
|
| 302 |
func (m *Rule) MarshalToVT(dAtA []byte) (int, error) { |
| 303 |
size := m.SizeVT() |
| 304 |
return m.MarshalToSizedBufferVT(dAtA[:size]) |
| 305 |
} |
| 306 |
|
| 307 |
func (m *Rule) MarshalToSizedBufferVT(dAtA []byte) (int, error) { |
| 308 |
if m == nil { |
| 309 |
return 0, nil |
| 310 |
} |
| 311 |
i := len(dAtA) |
| 312 |
_ = i |
| 313 |
var l int |
| 314 |
_ = l |
| 315 |
if m.unknownFields != nil { |
| 316 |
i -= len(m.unknownFields) |
| 317 |
copy(dAtA[i:], m.unknownFields) |
| 318 |
} |
| 319 |
if m.Updates != nil { |
| 320 |
size, err := m.Updates.MarshalToSizedBufferVT(dAtA[:i]) |
| 321 |
if err != nil { |
| 322 |
return 0, err |
| 323 |
} |
| 324 |
i -= size |
| 325 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) |
| 326 |
i-- |
| 327 |
dAtA[i] = 0x1a |
| 328 |
} |
| 329 |
if m.Selector != nil { |
| 330 |
size, err := m.Selector.MarshalToSizedBufferVT(dAtA[:i]) |
| 331 |
if err != nil { |
| 332 |
return 0, err |
| 333 |
} |
| 334 |
i -= size |
| 335 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) |
| 336 |
i-- |
| 337 |
dAtA[i] = 0x12 |
| 338 |
} |
| 339 |
if m.Action != 0 { |
| 340 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Action)) |
| 341 |
i-- |
| 342 |
dAtA[i] = 0x8 |
| 343 |
} |
| 344 |
return len(dAtA) - i, nil |
| 345 |
} |
| 346 |
|
| 347 |
func (m *Update) MarshalVT() (dAtA []byte, err error) { |
| 348 |
if m == nil { |
| 349 |
return nil, nil |
| 350 |
} |
| 351 |
size := m.SizeVT() |
| 352 |
dAtA = make([]byte, size) |
| 353 |
n, err := m.MarshalToSizedBufferVT(dAtA[:size]) |
| 354 |
if err != nil { |
| 355 |
return nil, err |
| 356 |
} |
| 357 |
return dAtA[:n], nil |
| 358 |
} |
| 359 |
|
| 360 |
func (m *Update) MarshalToVT(dAtA []byte) (int, error) { |
| 361 |
size := m.SizeVT() |
| 362 |
return m.MarshalToSizedBufferVT(dAtA[:size]) |
| 363 |
} |
| 364 |
|
| 365 |
func (m *Update) MarshalToSizedBufferVT(dAtA []byte) (int, error) { |
| 366 |
if m == nil { |
| 367 |
return 0, nil |
| 368 |
} |
| 369 |
i := len(dAtA) |
| 370 |
_ = i |
| 371 |
var l int |
| 372 |
_ = l |
| 373 |
if m.unknownFields != nil { |
| 374 |
i -= len(m.unknownFields) |
| 375 |
copy(dAtA[i:], m.unknownFields) |
| 376 |
} |
| 377 |
if len(m.Attrs) > 0 { |
| 378 |
for k := range m.Attrs { |
| 379 |
v := m.Attrs[k] |
| 380 |
baseI := i |
| 381 |
i -= len(v) |
| 382 |
copy(dAtA[i:], v) |
| 383 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(len(v))) |
| 384 |
i-- |
| 385 |
dAtA[i] = 0x12 |
| 386 |
i -= len(k) |
| 387 |
copy(dAtA[i:], k) |
| 388 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) |
| 389 |
i-- |
| 390 |
dAtA[i] = 0xa |
| 391 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) |
| 392 |
i-- |
| 393 |
dAtA[i] = 0x12 |
| 394 |
} |
| 395 |
} |
| 396 |
if len(m.Identifier) > 0 { |
| 397 |
i -= len(m.Identifier) |
| 398 |
copy(dAtA[i:], m.Identifier) |
| 399 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Identifier))) |
| 400 |
i-- |
| 401 |
dAtA[i] = 0xa |
| 402 |
} |
| 403 |
return len(dAtA) - i, nil |
| 404 |
} |
| 405 |
|
| 406 |
func (m *Selector) MarshalVT() (dAtA []byte, err error) { |
| 407 |
if m == nil { |
| 408 |
return nil, nil |
| 409 |
} |
| 410 |
size := m.SizeVT() |
| 411 |
dAtA = make([]byte, size) |
| 412 |
n, err := m.MarshalToSizedBufferVT(dAtA[:size]) |
| 413 |
if err != nil { |
| 414 |
return nil, err |
| 415 |
} |
| 416 |
return dAtA[:n], nil |
| 417 |
} |
| 418 |
|
| 419 |
func (m *Selector) MarshalToVT(dAtA []byte) (int, error) { |
| 420 |
size := m.SizeVT() |
| 421 |
return m.MarshalToSizedBufferVT(dAtA[:size]) |
| 422 |
} |
| 423 |
|
| 424 |
func (m *Selector) MarshalToSizedBufferVT(dAtA []byte) (int, error) { |
| 425 |
if m == nil { |
| 426 |
return 0, nil |
| 427 |
} |
| 428 |
i := len(dAtA) |
| 429 |
_ = i |
| 430 |
var l int |
| 431 |
_ = l |
| 432 |
if m.unknownFields != nil { |
| 433 |
i -= len(m.unknownFields) |
| 434 |
copy(dAtA[i:], m.unknownFields) |
| 435 |
} |
| 436 |
if len(m.Constraints) > 0 { |
| 437 |
for iNdEx := len(m.Constraints) - 1; iNdEx >= 0; iNdEx-- { |
| 438 |
size, err := m.Constraints[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) |
| 439 |
if err != nil { |
| 440 |
return 0, err |
| 441 |
} |
| 442 |
i -= size |
| 443 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) |
| 444 |
i-- |
| 445 |
dAtA[i] = 0x1a |
| 446 |
} |
| 447 |
} |
| 448 |
if m.MatchType != 0 { |
| 449 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(m.MatchType)) |
| 450 |
i-- |
| 451 |
dAtA[i] = 0x10 |
| 452 |
} |
| 453 |
if len(m.Identifier) > 0 { |
| 454 |
i -= len(m.Identifier) |
| 455 |
copy(dAtA[i:], m.Identifier) |
| 456 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Identifier))) |
| 457 |
i-- |
| 458 |
dAtA[i] = 0xa |
| 459 |
} |
| 460 |
return len(dAtA) - i, nil |
| 461 |
} |
| 462 |
|
| 463 |
func (m *AttrConstraint) MarshalVT() (dAtA []byte, err error) { |
| 464 |
if m == nil { |
| 465 |
return nil, nil |
| 466 |
} |
| 467 |
size := m.SizeVT() |
| 468 |
dAtA = make([]byte, size) |
| 469 |
n, err := m.MarshalToSizedBufferVT(dAtA[:size]) |
| 470 |
if err != nil { |
| 471 |
return nil, err |
| 472 |
} |
| 473 |
return dAtA[:n], nil |
| 474 |
} |
| 475 |
|
| 476 |
func (m *AttrConstraint) MarshalToVT(dAtA []byte) (int, error) { |
| 477 |
size := m.SizeVT() |
| 478 |
return m.MarshalToSizedBufferVT(dAtA[:size]) |
| 479 |
} |
| 480 |
|
| 481 |
func (m *AttrConstraint) MarshalToSizedBufferVT(dAtA []byte) (int, error) { |
| 482 |
if m == nil { |
| 483 |
return 0, nil |
| 484 |
} |
| 485 |
i := len(dAtA) |
| 486 |
_ = i |
| 487 |
var l int |
| 488 |
_ = l |
| 489 |
if m.unknownFields != nil { |
| 490 |
i -= len(m.unknownFields) |
| 491 |
copy(dAtA[i:], m.unknownFields) |
| 492 |
} |
| 493 |
if m.Condition != 0 { |
| 494 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Condition)) |
| 495 |
i-- |
| 496 |
dAtA[i] = 0x18 |
| 497 |
} |
| 498 |
if len(m.Value) > 0 { |
| 499 |
i -= len(m.Value) |
| 500 |
copy(dAtA[i:], m.Value) |
| 501 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Value))) |
| 502 |
i-- |
| 503 |
dAtA[i] = 0x12 |
| 504 |
} |
| 505 |
if len(m.Key) > 0 { |
| 506 |
i -= len(m.Key) |
| 507 |
copy(dAtA[i:], m.Key) |
| 508 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Key))) |
| 509 |
i-- |
| 510 |
dAtA[i] = 0xa |
| 511 |
} |
| 512 |
return len(dAtA) - i, nil |
| 513 |
} |
| 514 |
|
| 515 |
func (m *Policy) MarshalVT() (dAtA []byte, err error) { |
| 516 |
if m == nil { |
| 517 |
return nil, nil |
| 518 |
} |
| 519 |
size := m.SizeVT() |
| 520 |
dAtA = make([]byte, size) |
| 521 |
n, err := m.MarshalToSizedBufferVT(dAtA[:size]) |
| 522 |
if err != nil { |
| 523 |
return nil, err |
| 524 |
} |
| 525 |
return dAtA[:n], nil |
| 526 |
} |
| 527 |
|
| 528 |
func (m *Policy) MarshalToVT(dAtA []byte) (int, error) { |
| 529 |
size := m.SizeVT() |
| 530 |
return m.MarshalToSizedBufferVT(dAtA[:size]) |
| 531 |
} |
| 532 |
|
| 533 |
func (m *Policy) MarshalToSizedBufferVT(dAtA []byte) (int, error) { |
| 534 |
if m == nil { |
| 535 |
return 0, nil |
| 536 |
} |
| 537 |
i := len(dAtA) |
| 538 |
_ = i |
| 539 |
var l int |
| 540 |
_ = l |
| 541 |
if m.unknownFields != nil { |
| 542 |
i -= len(m.unknownFields) |
| 543 |
copy(dAtA[i:], m.unknownFields) |
| 544 |
} |
| 545 |
if len(m.Rules) > 0 { |
| 546 |
for iNdEx := len(m.Rules) - 1; iNdEx >= 0; iNdEx-- { |
| 547 |
size, err := m.Rules[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) |
| 548 |
if err != nil { |
| 549 |
return 0, err |
| 550 |
} |
| 551 |
i -= size |
| 552 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) |
| 553 |
i-- |
| 554 |
dAtA[i] = 0x12 |
| 555 |
} |
| 556 |
} |
| 557 |
if m.Version != 0 { |
| 558 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Version)) |
| 559 |
i-- |
| 560 |
dAtA[i] = 0x8 |
| 561 |
} |
| 562 |
return len(dAtA) - i, nil |
| 563 |
} |
| 564 |
|
| 565 |
func (m *Rule) SizeVT() (n int) { |
| 566 |
if m == nil { |
| 567 |
return 0 |
| 568 |
} |
| 569 |
var l int |
| 570 |
_ = l |
| 571 |
if m.Action != 0 { |
| 572 |
n += 1 + protohelpers.SizeOfVarint(uint64(m.Action)) |
| 573 |
} |
| 574 |
if m.Selector != nil { |
| 575 |
l = m.Selector.SizeVT() |
| 576 |
n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 577 |
} |
| 578 |
if m.Updates != nil { |
| 579 |
l = m.Updates.SizeVT() |
| 580 |
n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 581 |
} |
| 582 |
n += len(m.unknownFields) |
| 583 |
return n |
| 584 |
} |
| 585 |
|
| 586 |
func (m *Update) SizeVT() (n int) { |
| 587 |
if m == nil { |
| 588 |
return 0 |
| 589 |
} |
| 590 |
var l int |
| 591 |
_ = l |
| 592 |
l = len(m.Identifier) |
| 593 |
if l > 0 { |
| 594 |
n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 595 |
} |
| 596 |
if len(m.Attrs) > 0 { |
| 597 |
for k, v := range m.Attrs { |
| 598 |
_ = k |
| 599 |
_ = v |
| 600 |
mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + 1 + len(v) + protohelpers.SizeOfVarint(uint64(len(v))) |
| 601 |
n += mapEntrySize + 1 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) |
| 602 |
} |
| 603 |
} |
| 604 |
n += len(m.unknownFields) |
| 605 |
return n |
| 606 |
} |
| 607 |
|
| 608 |
func (m *Selector) SizeVT() (n int) { |
| 609 |
if m == nil { |
| 610 |
return 0 |
| 611 |
} |
| 612 |
var l int |
| 613 |
_ = l |
| 614 |
l = len(m.Identifier) |
| 615 |
if l > 0 { |
| 616 |
n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 617 |
} |
| 618 |
if m.MatchType != 0 { |
| 619 |
n += 1 + protohelpers.SizeOfVarint(uint64(m.MatchType)) |
| 620 |
} |
| 621 |
if len(m.Constraints) > 0 { |
| 622 |
for _, e := range m.Constraints { |
| 623 |
l = e.SizeVT() |
| 624 |
n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 625 |
} |
| 626 |
} |
| 627 |
n += len(m.unknownFields) |
| 628 |
return n |
| 629 |
} |
| 630 |
|
| 631 |
func (m *AttrConstraint) SizeVT() (n int) { |
| 632 |
if m == nil { |
| 633 |
return 0 |
| 634 |
} |
| 635 |
var l int |
| 636 |
_ = l |
| 637 |
l = len(m.Key) |
| 638 |
if l > 0 { |
| 639 |
n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 640 |
} |
| 641 |
l = len(m.Value) |
| 642 |
if l > 0 { |
| 643 |
n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 644 |
} |
| 645 |
if m.Condition != 0 { |
| 646 |
n += 1 + protohelpers.SizeOfVarint(uint64(m.Condition)) |
| 647 |
} |
| 648 |
n += len(m.unknownFields) |
| 649 |
return n |
| 650 |
} |
| 651 |
|
| 652 |
func (m *Policy) SizeVT() (n int) { |
| 653 |
if m == nil { |
| 654 |
return 0 |
| 655 |
} |
| 656 |
var l int |
| 657 |
_ = l |
| 658 |
if m.Version != 0 { |
| 659 |
n += 1 + protohelpers.SizeOfVarint(uint64(m.Version)) |
| 660 |
} |
| 661 |
if len(m.Rules) > 0 { |
| 662 |
for _, e := range m.Rules { |
| 663 |
l = e.SizeVT() |
| 664 |
n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 665 |
} |
| 666 |
} |
| 667 |
n += len(m.unknownFields) |
| 668 |
return n |
| 669 |
} |
| 670 |
|
| 671 |
func (m *Rule) UnmarshalVT(dAtA []byte) error { |
| 672 |
l := len(dAtA) |
| 673 |
iNdEx := 0 |
| 674 |
for iNdEx < l { |
| 675 |
preIndex := iNdEx |
| 676 |
var wire uint64 |
| 677 |
for shift := uint(0); ; shift += 7 { |
| 678 |
if shift >= 64 { |
| 679 |
return protohelpers.ErrIntOverflow |
| 680 |
} |
| 681 |
if iNdEx >= l { |
| 682 |
return io.ErrUnexpectedEOF |
| 683 |
} |
| 684 |
b := dAtA[iNdEx] |
| 685 |
iNdEx++ |
| 686 |
wire |= uint64(b&0x7F) << shift |
| 687 |
if b < 0x80 { |
| 688 |
break |
| 689 |
} |
| 690 |
} |
| 691 |
fieldNum := int32(wire >> 3) |
| 692 |
wireType := int(wire & 0x7) |
| 693 |
if wireType == 4 { |
| 694 |
return fmt.Errorf("proto: Rule: wiretype end group for non-group") |
| 695 |
} |
| 696 |
if fieldNum <= 0 { |
| 697 |
return fmt.Errorf("proto: Rule: illegal tag %d (wire type %d)", fieldNum, wire) |
| 698 |
} |
| 699 |
switch fieldNum { |
| 700 |
case 1: |
| 701 |
if wireType != 0 { |
| 702 |
return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) |
| 703 |
} |
| 704 |
m.Action = 0 |
| 705 |
for shift := uint(0); ; shift += 7 { |
| 706 |
if shift >= 64 { |
| 707 |
return protohelpers.ErrIntOverflow |
| 708 |
} |
| 709 |
if iNdEx >= l { |
| 710 |
return io.ErrUnexpectedEOF |
| 711 |
} |
| 712 |
b := dAtA[iNdEx] |
| 713 |
iNdEx++ |
| 714 |
m.Action |= PolicyAction(b&0x7F) << shift |
| 715 |
if b < 0x80 { |
| 716 |
break |
| 717 |
} |
| 718 |
} |
| 719 |
case 2: |
| 720 |
if wireType != 2 { |
| 721 |
return fmt.Errorf("proto: wrong wireType = %d for field Selector", wireType) |
| 722 |
} |
| 723 |
var msglen int |
| 724 |
for shift := uint(0); ; shift += 7 { |
| 725 |
if shift >= 64 { |
| 726 |
return protohelpers.ErrIntOverflow |
| 727 |
} |
| 728 |
if iNdEx >= l { |
| 729 |
return io.ErrUnexpectedEOF |
| 730 |
} |
| 731 |
b := dAtA[iNdEx] |
| 732 |
iNdEx++ |
| 733 |
msglen |= int(b&0x7F) << shift |
| 734 |
if b < 0x80 { |
| 735 |
break |
| 736 |
} |
| 737 |
} |
| 738 |
if msglen < 0 { |
| 739 |
return protohelpers.ErrInvalidLength |
| 740 |
} |
| 741 |
postIndex := iNdEx + msglen |
| 742 |
if postIndex < 0 { |
| 743 |
return protohelpers.ErrInvalidLength |
| 744 |
} |
| 745 |
if postIndex > l { |
| 746 |
return io.ErrUnexpectedEOF |
| 747 |
} |
| 748 |
if m.Selector == nil { |
| 749 |
m.Selector = &Selector{} |
| 750 |
} |
| 751 |
if err := m.Selector.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { |
| 752 |
return err |
| 753 |
} |
| 754 |
iNdEx = postIndex |
| 755 |
case 3: |
| 756 |
if wireType != 2 { |
| 757 |
return fmt.Errorf("proto: wrong wireType = %d for field Updates", wireType) |
| 758 |
} |
| 759 |
var msglen int |
| 760 |
for shift := uint(0); ; shift += 7 { |
| 761 |
if shift >= 64 { |
| 762 |
return protohelpers.ErrIntOverflow |
| 763 |
} |
| 764 |
if iNdEx >= l { |
| 765 |
return io.ErrUnexpectedEOF |
| 766 |
} |
| 767 |
b := dAtA[iNdEx] |
| 768 |
iNdEx++ |
| 769 |
msglen |= int(b&0x7F) << shift |
| 770 |
if b < 0x80 { |
| 771 |
break |
| 772 |
} |
| 773 |
} |
| 774 |
if msglen < 0 { |
| 775 |
return protohelpers.ErrInvalidLength |
| 776 |
} |
| 777 |
postIndex := iNdEx + msglen |
| 778 |
if postIndex < 0 { |
| 779 |
return protohelpers.ErrInvalidLength |
| 780 |
} |
| 781 |
if postIndex > l { |
| 782 |
return io.ErrUnexpectedEOF |
| 783 |
} |
| 784 |
if m.Updates == nil { |
| 785 |
m.Updates = &Update{} |
| 786 |
} |
| 787 |
if err := m.Updates.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { |
| 788 |
return err |
| 789 |
} |
| 790 |
iNdEx = postIndex |
| 791 |
default: |
| 792 |
iNdEx = preIndex |
| 793 |
skippy, err := protohelpers.Skip(dAtA[iNdEx:]) |
| 794 |
if err != nil { |
| 795 |
return err |
| 796 |
} |
| 797 |
if (skippy < 0) || (iNdEx+skippy) < 0 { |
| 798 |
return protohelpers.ErrInvalidLength |
| 799 |
} |
| 800 |
if (iNdEx + skippy) > l { |
| 801 |
return io.ErrUnexpectedEOF |
| 802 |
} |
| 803 |
m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) |
| 804 |
iNdEx += skippy |
| 805 |
} |
| 806 |
} |
| 807 |
|
| 808 |
if iNdEx > l { |
| 809 |
return io.ErrUnexpectedEOF |
| 810 |
} |
| 811 |
return nil |
| 812 |
} |
| 813 |
func (m *Update) UnmarshalVT(dAtA []byte) error { |
| 814 |
l := len(dAtA) |
| 815 |
iNdEx := 0 |
| 816 |
for iNdEx < l { |
| 817 |
preIndex := iNdEx |
| 818 |
var wire uint64 |
| 819 |
for shift := uint(0); ; shift += 7 { |
| 820 |
if shift >= 64 { |
| 821 |
return protohelpers.ErrIntOverflow |
| 822 |
} |
| 823 |
if iNdEx >= l { |
| 824 |
return io.ErrUnexpectedEOF |
| 825 |
} |
| 826 |
b := dAtA[iNdEx] |
| 827 |
iNdEx++ |
| 828 |
wire |= uint64(b&0x7F) << shift |
| 829 |
if b < 0x80 { |
| 830 |
break |
| 831 |
} |
| 832 |
} |
| 833 |
fieldNum := int32(wire >> 3) |
| 834 |
wireType := int(wire & 0x7) |
| 835 |
if wireType == 4 { |
| 836 |
return fmt.Errorf("proto: Update: wiretype end group for non-group") |
| 837 |
} |
| 838 |
if fieldNum <= 0 { |
| 839 |
return fmt.Errorf("proto: Update: illegal tag %d (wire type %d)", fieldNum, wire) |
| 840 |
} |
| 841 |
switch fieldNum { |
| 842 |
case 1: |
| 843 |
if wireType != 2 { |
| 844 |
return fmt.Errorf("proto: wrong wireType = %d for field Identifier", wireType) |
| 845 |
} |
| 846 |
var stringLen uint64 |
| 847 |
for shift := uint(0); ; shift += 7 { |
| 848 |
if shift >= 64 { |
| 849 |
return protohelpers.ErrIntOverflow |
| 850 |
} |
| 851 |
if iNdEx >= l { |
| 852 |
return io.ErrUnexpectedEOF |
| 853 |
} |
| 854 |
b := dAtA[iNdEx] |
| 855 |
iNdEx++ |
| 856 |
stringLen |= uint64(b&0x7F) << shift |
| 857 |
if b < 0x80 { |
| 858 |
break |
| 859 |
} |
| 860 |
} |
| 861 |
intStringLen := int(stringLen) |
| 862 |
if intStringLen < 0 { |
| 863 |
return protohelpers.ErrInvalidLength |
| 864 |
} |
| 865 |
postIndex := iNdEx + intStringLen |
| 866 |
if postIndex < 0 { |
| 867 |
return protohelpers.ErrInvalidLength |
| 868 |
} |
| 869 |
if postIndex > l { |
| 870 |
return io.ErrUnexpectedEOF |
| 871 |
} |
| 872 |
m.Identifier = string(dAtA[iNdEx:postIndex]) |
| 873 |
iNdEx = postIndex |
| 874 |
case 2: |
| 875 |
if wireType != 2 { |
| 876 |
return fmt.Errorf("proto: wrong wireType = %d for field Attrs", wireType) |
| 877 |
} |
| 878 |
var msglen int |
| 879 |
for shift := uint(0); ; shift += 7 { |
| 880 |
if shift >= 64 { |
| 881 |
return protohelpers.ErrIntOverflow |
| 882 |
} |
| 883 |
if iNdEx >= l { |
| 884 |
return io.ErrUnexpectedEOF |
| 885 |
} |
| 886 |
b := dAtA[iNdEx] |
| 887 |
iNdEx++ |
| 888 |
msglen |= int(b&0x7F) << shift |
| 889 |
if b < 0x80 { |
| 890 |
break |
| 891 |
} |
| 892 |
} |
| 893 |
if msglen < 0 { |
| 894 |
return protohelpers.ErrInvalidLength |
| 895 |
} |
| 896 |
postIndex := iNdEx + msglen |
| 897 |
if postIndex < 0 { |
| 898 |
return protohelpers.ErrInvalidLength |
| 899 |
} |
| 900 |
if postIndex > l { |
| 901 |
return io.ErrUnexpectedEOF |
| 902 |
} |
| 903 |
if m.Attrs == nil { |
| 904 |
m.Attrs = make(map[string]string) |
| 905 |
} |
| 906 |
var mapkey string |
| 907 |
var mapvalue string |
| 908 |
for iNdEx < postIndex { |
| 909 |
entryPreIndex := iNdEx |
| 910 |
var wire uint64 |
| 911 |
for shift := uint(0); ; shift += 7 { |
| 912 |
if shift >= 64 { |
| 913 |
return protohelpers.ErrIntOverflow |
| 914 |
} |
| 915 |
if iNdEx >= l { |
| 916 |
return io.ErrUnexpectedEOF |
| 917 |
} |
| 918 |
b := dAtA[iNdEx] |
| 919 |
iNdEx++ |
| 920 |
wire |= uint64(b&0x7F) << shift |
| 921 |
if b < 0x80 { |
| 922 |
break |
| 923 |
} |
| 924 |
} |
| 925 |
fieldNum := int32(wire >> 3) |
| 926 |
if fieldNum == 1 { |
| 927 |
var stringLenmapkey uint64 |
| 928 |
for shift := uint(0); ; shift += 7 { |
| 929 |
if shift >= 64 { |
| 930 |
return protohelpers.ErrIntOverflow |
| 931 |
} |
| 932 |
if iNdEx >= l { |
| 933 |
return io.ErrUnexpectedEOF |
| 934 |
} |
| 935 |
b := dAtA[iNdEx] |
| 936 |
iNdEx++ |
| 937 |
stringLenmapkey |= uint64(b&0x7F) << shift |
| 938 |
if b < 0x80 { |
| 939 |
break |
| 940 |
} |
| 941 |
} |
| 942 |
intStringLenmapkey := int(stringLenmapkey) |
| 943 |
if intStringLenmapkey < 0 { |
| 944 |
return protohelpers.ErrInvalidLength |
| 945 |
} |
| 946 |
postStringIndexmapkey := iNdEx + intStringLenmapkey |
| 947 |
if postStringIndexmapkey < 0 { |
| 948 |
return protohelpers.ErrInvalidLength |
| 949 |
} |
| 950 |
if postStringIndexmapkey > l { |
| 951 |
return io.ErrUnexpectedEOF |
| 952 |
} |
| 953 |
mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) |
| 954 |
iNdEx = postStringIndexmapkey |
| 955 |
} else if fieldNum == 2 { |
| 956 |
var stringLenmapvalue uint64 |
| 957 |
for shift := uint(0); ; shift += 7 { |
| 958 |
if shift >= 64 { |
| 959 |
return protohelpers.ErrIntOverflow |
| 960 |
} |
| 961 |
if iNdEx >= l { |
| 962 |
return io.ErrUnexpectedEOF |
| 963 |
} |
| 964 |
b := dAtA[iNdEx] |
| 965 |
iNdEx++ |
| 966 |
stringLenmapvalue |= uint64(b&0x7F) << shift |
| 967 |
if b < 0x80 { |
| 968 |
break |
| 969 |
} |
| 970 |
} |
| 971 |
intStringLenmapvalue := int(stringLenmapvalue) |
| 972 |
if intStringLenmapvalue < 0 { |
| 973 |
return protohelpers.ErrInvalidLength |
| 974 |
} |
| 975 |
postStringIndexmapvalue := iNdEx + intStringLenmapvalue |
| 976 |
if postStringIndexmapvalue < 0 { |
| 977 |
return protohelpers.ErrInvalidLength |
| 978 |
} |
| 979 |
if postStringIndexmapvalue > l { |
| 980 |
return io.ErrUnexpectedEOF |
| 981 |
} |
| 982 |
mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) |
| 983 |
iNdEx = postStringIndexmapvalue |
| 984 |
} else { |
| 985 |
iNdEx = entryPreIndex |
| 986 |
skippy, err := protohelpers.Skip(dAtA[iNdEx:]) |
| 987 |
if err != nil { |
| 988 |
return err |
| 989 |
} |
| 990 |
if (skippy < 0) || (iNdEx+skippy) < 0 { |
| 991 |
return protohelpers.ErrInvalidLength |
| 992 |
} |
| 993 |
if (iNdEx + skippy) > postIndex { |
| 994 |
return io.ErrUnexpectedEOF |
| 995 |
} |
| 996 |
iNdEx += skippy |
| 997 |
} |
| 998 |
} |
| 999 |
m.Attrs[mapkey] = mapvalue |
| 1000 |
iNdEx = postIndex |
| 1001 |
default: |
| 1002 |
iNdEx = preIndex |
| 1003 |
skippy, err := protohelpers.Skip(dAtA[iNdEx:]) |
| 1004 |
if err != nil { |
| 1005 |
return err |
| 1006 |
} |
| 1007 |
if (skippy < 0) || (iNdEx+skippy) < 0 { |
| 1008 |
return protohelpers.ErrInvalidLength |
| 1009 |
} |
| 1010 |
if (iNdEx + skippy) > l { |
| 1011 |
return io.ErrUnexpectedEOF |
| 1012 |
} |
| 1013 |
m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) |
| 1014 |
iNdEx += skippy |
| 1015 |
} |
| 1016 |
} |
| 1017 |
|
| 1018 |
if iNdEx > l { |
| 1019 |
return io.ErrUnexpectedEOF |
| 1020 |
} |
| 1021 |
return nil |
| 1022 |
} |
| 1023 |
func (m *Selector) UnmarshalVT(dAtA []byte) error { |
| 1024 |
l := len(dAtA) |
| 1025 |
iNdEx := 0 |
| 1026 |
for iNdEx < l { |
| 1027 |
preIndex := iNdEx |
| 1028 |
var wire uint64 |
| 1029 |
for shift := uint(0); ; shift += 7 { |
| 1030 |
if shift >= 64 { |
| 1031 |
return protohelpers.ErrIntOverflow |
| 1032 |
} |
| 1033 |
if iNdEx >= l { |
| 1034 |
return io.ErrUnexpectedEOF |
| 1035 |
} |
| 1036 |
b := dAtA[iNdEx] |
| 1037 |
iNdEx++ |
| 1038 |
wire |= uint64(b&0x7F) << shift |
| 1039 |
if b < 0x80 { |
| 1040 |
break |
| 1041 |
} |
| 1042 |
} |
| 1043 |
fieldNum := int32(wire >> 3) |
| 1044 |
wireType := int(wire & 0x7) |
| 1045 |
if wireType == 4 { |
| 1046 |
return fmt.Errorf("proto: Selector: wiretype end group for non-group") |
| 1047 |
} |
| 1048 |
if fieldNum <= 0 { |
| 1049 |
return fmt.Errorf("proto: Selector: illegal tag %d (wire type %d)", fieldNum, wire) |
| 1050 |
} |
| 1051 |
switch fieldNum { |
| 1052 |
case 1: |
| 1053 |
if wireType != 2 { |
| 1054 |
return fmt.Errorf("proto: wrong wireType = %d for field Identifier", wireType) |
| 1055 |
} |
| 1056 |
var stringLen uint64 |
| 1057 |
for shift := uint(0); ; shift += 7 { |
| 1058 |
if shift >= 64 { |
| 1059 |
return protohelpers.ErrIntOverflow |
| 1060 |
} |
| 1061 |
if iNdEx >= l { |
| 1062 |
return io.ErrUnexpectedEOF |
| 1063 |
} |
| 1064 |
b := dAtA[iNdEx] |
| 1065 |
iNdEx++ |
| 1066 |
stringLen |= uint64(b&0x7F) << shift |
| 1067 |
if b < 0x80 { |
| 1068 |
break |
| 1069 |
} |
| 1070 |
} |
| 1071 |
intStringLen := int(stringLen) |
| 1072 |
if intStringLen < 0 { |
| 1073 |
return protohelpers.ErrInvalidLength |
| 1074 |
} |
| 1075 |
postIndex := iNdEx + intStringLen |
| 1076 |
if postIndex < 0 { |
| 1077 |
return protohelpers.ErrInvalidLength |
| 1078 |
} |
| 1079 |
if postIndex > l { |
| 1080 |
return io.ErrUnexpectedEOF |
| 1081 |
} |
| 1082 |
m.Identifier = string(dAtA[iNdEx:postIndex]) |
| 1083 |
iNdEx = postIndex |
| 1084 |
case 2: |
| 1085 |
if wireType != 0 { |
| 1086 |
return fmt.Errorf("proto: wrong wireType = %d for field MatchType", wireType) |
| 1087 |
} |
| 1088 |
m.MatchType = 0 |
| 1089 |
for shift := uint(0); ; shift += 7 { |
| 1090 |
if shift >= 64 { |
| 1091 |
return protohelpers.ErrIntOverflow |
| 1092 |
} |
| 1093 |
if iNdEx >= l { |
| 1094 |
return io.ErrUnexpectedEOF |
| 1095 |
} |
| 1096 |
b := dAtA[iNdEx] |
| 1097 |
iNdEx++ |
| 1098 |
m.MatchType |= MatchType(b&0x7F) << shift |
| 1099 |
if b < 0x80 { |
| 1100 |
break |
| 1101 |
} |
| 1102 |
} |
| 1103 |
case 3: |
| 1104 |
if wireType != 2 { |
| 1105 |
return fmt.Errorf("proto: wrong wireType = %d for field Constraints", wireType) |
| 1106 |
} |
| 1107 |
var msglen int |
| 1108 |
for shift := uint(0); ; shift += 7 { |
| 1109 |
if shift >= 64 { |
| 1110 |
return protohelpers.ErrIntOverflow |
| 1111 |
} |
| 1112 |
if iNdEx >= l { |
| 1113 |
return io.ErrUnexpectedEOF |
| 1114 |
} |
| 1115 |
b := dAtA[iNdEx] |
| 1116 |
iNdEx++ |
| 1117 |
msglen |= int(b&0x7F) << shift |
| 1118 |
if b < 0x80 { |
| 1119 |
break |
| 1120 |
} |
| 1121 |
} |
| 1122 |
if msglen < 0 { |
| 1123 |
return protohelpers.ErrInvalidLength |
| 1124 |
} |
| 1125 |
postIndex := iNdEx + msglen |
| 1126 |
if postIndex < 0 { |
| 1127 |
return protohelpers.ErrInvalidLength |
| 1128 |
} |
| 1129 |
if postIndex > l { |
| 1130 |
return io.ErrUnexpectedEOF |
| 1131 |
} |
| 1132 |
m.Constraints = append(m.Constraints, &AttrConstraint{}) |
| 1133 |
if err := m.Constraints[len(m.Constraints)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { |
| 1134 |
return err |
| 1135 |
} |
| 1136 |
iNdEx = postIndex |
| 1137 |
default: |
| 1138 |
iNdEx = preIndex |
| 1139 |
skippy, err := protohelpers.Skip(dAtA[iNdEx:]) |
| 1140 |
if err != nil { |
| 1141 |
return err |
| 1142 |
} |
| 1143 |
if (skippy < 0) || (iNdEx+skippy) < 0 { |
| 1144 |
return protohelpers.ErrInvalidLength |
| 1145 |
} |
| 1146 |
if (iNdEx + skippy) > l { |
| 1147 |
return io.ErrUnexpectedEOF |
| 1148 |
} |
| 1149 |
m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) |
| 1150 |
iNdEx += skippy |
| 1151 |
} |
| 1152 |
} |
| 1153 |
|
| 1154 |
if iNdEx > l { |
| 1155 |
return io.ErrUnexpectedEOF |
| 1156 |
} |
| 1157 |
return nil |
| 1158 |
} |
| 1159 |
func (m *AttrConstraint) UnmarshalVT(dAtA []byte) error { |
| 1160 |
l := len(dAtA) |
| 1161 |
iNdEx := 0 |
| 1162 |
for iNdEx < l { |
| 1163 |
preIndex := iNdEx |
| 1164 |
var wire uint64 |
| 1165 |
for shift := uint(0); ; shift += 7 { |
| 1166 |
if shift >= 64 { |
| 1167 |
return protohelpers.ErrIntOverflow |
| 1168 |
} |
| 1169 |
if iNdEx >= l { |
| 1170 |
return io.ErrUnexpectedEOF |
| 1171 |
} |
| 1172 |
b := dAtA[iNdEx] |
| 1173 |
iNdEx++ |
| 1174 |
wire |= uint64(b&0x7F) << shift |
| 1175 |
if b < 0x80 { |
| 1176 |
break |
| 1177 |
} |
| 1178 |
} |
| 1179 |
fieldNum := int32(wire >> 3) |
| 1180 |
wireType := int(wire & 0x7) |
| 1181 |
if wireType == 4 { |
| 1182 |
return fmt.Errorf("proto: AttrConstraint: wiretype end group for non-group") |
| 1183 |
} |
| 1184 |
if fieldNum <= 0 { |
| 1185 |
return fmt.Errorf("proto: AttrConstraint: illegal tag %d (wire type %d)", fieldNum, wire) |
| 1186 |
} |
| 1187 |
switch fieldNum { |
| 1188 |
case 1: |
| 1189 |
if wireType != 2 { |
| 1190 |
return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) |
| 1191 |
} |
| 1192 |
var stringLen uint64 |
| 1193 |
for shift := uint(0); ; shift += 7 { |
| 1194 |
if shift >= 64 { |
| 1195 |
return protohelpers.ErrIntOverflow |
| 1196 |
} |
| 1197 |
if iNdEx >= l { |
| 1198 |
return io.ErrUnexpectedEOF |
| 1199 |
} |
| 1200 |
b := dAtA[iNdEx] |
| 1201 |
iNdEx++ |
| 1202 |
stringLen |= uint64(b&0x7F) << shift |
| 1203 |
if b < 0x80 { |
| 1204 |
break |
| 1205 |
} |
| 1206 |
} |
| 1207 |
intStringLen := int(stringLen) |
| 1208 |
if intStringLen < 0 { |
| 1209 |
return protohelpers.ErrInvalidLength |
| 1210 |
} |
| 1211 |
postIndex := iNdEx + intStringLen |
| 1212 |
if postIndex < 0 { |
| 1213 |
return protohelpers.ErrInvalidLength |
| 1214 |
} |
| 1215 |
if postIndex > l { |
| 1216 |
return io.ErrUnexpectedEOF |
| 1217 |
} |
| 1218 |
m.Key = string(dAtA[iNdEx:postIndex]) |
| 1219 |
iNdEx = postIndex |
| 1220 |
case 2: |
| 1221 |
if wireType != 2 { |
| 1222 |
return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) |
| 1223 |
} |
| 1224 |
var stringLen uint64 |
| 1225 |
for shift := uint(0); ; shift += 7 { |
| 1226 |
if shift >= 64 { |
| 1227 |
return protohelpers.ErrIntOverflow |
| 1228 |
} |
| 1229 |
if iNdEx >= l { |
| 1230 |
return io.ErrUnexpectedEOF |
| 1231 |
} |
| 1232 |
b := dAtA[iNdEx] |
| 1233 |
iNdEx++ |
| 1234 |
stringLen |= uint64(b&0x7F) << shift |
| 1235 |
if b < 0x80 { |
| 1236 |
break |
| 1237 |
} |
| 1238 |
} |
| 1239 |
intStringLen := int(stringLen) |
| 1240 |
if intStringLen < 0 { |
| 1241 |
return protohelpers.ErrInvalidLength |
| 1242 |
} |
| 1243 |
postIndex := iNdEx + intStringLen |
| 1244 |
if postIndex < 0 { |
| 1245 |
return protohelpers.ErrInvalidLength |
| 1246 |
} |
| 1247 |
if postIndex > l { |
| 1248 |
return io.ErrUnexpectedEOF |
| 1249 |
} |
| 1250 |
m.Value = string(dAtA[iNdEx:postIndex]) |
| 1251 |
iNdEx = postIndex |
| 1252 |
case 3: |
| 1253 |
if wireType != 0 { |
| 1254 |
return fmt.Errorf("proto: wrong wireType = %d for field Condition", wireType) |
| 1255 |
} |
| 1256 |
m.Condition = 0 |
| 1257 |
for shift := uint(0); ; shift += 7 { |
| 1258 |
if shift >= 64 { |
| 1259 |
return protohelpers.ErrIntOverflow |
| 1260 |
} |
| 1261 |
if iNdEx >= l { |
| 1262 |
return io.ErrUnexpectedEOF |
| 1263 |
} |
| 1264 |
b := dAtA[iNdEx] |
| 1265 |
iNdEx++ |
| 1266 |
m.Condition |= AttrMatch(b&0x7F) << shift |
| 1267 |
if b < 0x80 { |
| 1268 |
break |
| 1269 |
} |
| 1270 |
} |
| 1271 |
default: |
| 1272 |
iNdEx = preIndex |
| 1273 |
skippy, err := protohelpers.Skip(dAtA[iNdEx:]) |
| 1274 |
if err != nil { |
| 1275 |
return err |
| 1276 |
} |
| 1277 |
if (skippy < 0) || (iNdEx+skippy) < 0 { |
| 1278 |
return protohelpers.ErrInvalidLength |
| 1279 |
} |
| 1280 |
if (iNdEx + skippy) > l { |
| 1281 |
return io.ErrUnexpectedEOF |
| 1282 |
} |
| 1283 |
m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) |
| 1284 |
iNdEx += skippy |
| 1285 |
} |
| 1286 |
} |
| 1287 |
|
| 1288 |
if iNdEx > l { |
| 1289 |
return io.ErrUnexpectedEOF |
| 1290 |
} |
| 1291 |
return nil |
| 1292 |
} |
| 1293 |
func (m *Policy) UnmarshalVT(dAtA []byte) error { |
| 1294 |
l := len(dAtA) |
| 1295 |
iNdEx := 0 |
| 1296 |
for iNdEx < l { |
| 1297 |
preIndex := iNdEx |
| 1298 |
var wire uint64 |
| 1299 |
for shift := uint(0); ; shift += 7 { |
| 1300 |
if shift >= 64 { |
| 1301 |
return protohelpers.ErrIntOverflow |
| 1302 |
} |
| 1303 |
if iNdEx >= l { |
| 1304 |
return io.ErrUnexpectedEOF |
| 1305 |
} |
| 1306 |
b := dAtA[iNdEx] |
| 1307 |
iNdEx++ |
| 1308 |
wire |= uint64(b&0x7F) << shift |
| 1309 |
if b < 0x80 { |
| 1310 |
break |
| 1311 |
} |
| 1312 |
} |
| 1313 |
fieldNum := int32(wire >> 3) |
| 1314 |
wireType := int(wire & 0x7) |
| 1315 |
if wireType == 4 { |
| 1316 |
return fmt.Errorf("proto: Policy: wiretype end group for non-group") |
| 1317 |
} |
| 1318 |
if fieldNum <= 0 { |
| 1319 |
return fmt.Errorf("proto: Policy: illegal tag %d (wire type %d)", fieldNum, wire) |
| 1320 |
} |
| 1321 |
switch fieldNum { |
| 1322 |
case 1: |
| 1323 |
if wireType != 0 { |
| 1324 |
return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) |
| 1325 |
} |
| 1326 |
m.Version = 0 |
| 1327 |
for shift := uint(0); ; shift += 7 { |
| 1328 |
if shift >= 64 { |
| 1329 |
return protohelpers.ErrIntOverflow |
| 1330 |
} |
| 1331 |
if iNdEx >= l { |
| 1332 |
return io.ErrUnexpectedEOF |
| 1333 |
} |
| 1334 |
b := dAtA[iNdEx] |
| 1335 |
iNdEx++ |
| 1336 |
m.Version |= int64(b&0x7F) << shift |
| 1337 |
if b < 0x80 { |
| 1338 |
break |
| 1339 |
} |
| 1340 |
} |
| 1341 |
case 2: |
| 1342 |
if wireType != 2 { |
| 1343 |
return fmt.Errorf("proto: wrong wireType = %d for field Rules", wireType) |
| 1344 |
} |
| 1345 |
var msglen int |
| 1346 |
for shift := uint(0); ; shift += 7 { |
| 1347 |
if shift >= 64 { |
| 1348 |
return protohelpers.ErrIntOverflow |
| 1349 |
} |
| 1350 |
if iNdEx >= l { |
| 1351 |
return io.ErrUnexpectedEOF |
| 1352 |
} |
| 1353 |
b := dAtA[iNdEx] |
| 1354 |
iNdEx++ |
| 1355 |
msglen |= int(b&0x7F) << shift |
| 1356 |
if b < 0x80 { |
| 1357 |
break |
| 1358 |
} |
| 1359 |
} |
| 1360 |
if msglen < 0 { |
| 1361 |
return protohelpers.ErrInvalidLength |
| 1362 |
} |
| 1363 |
postIndex := iNdEx + msglen |
| 1364 |
if postIndex < 0 { |
| 1365 |
return protohelpers.ErrInvalidLength |
| 1366 |
} |
| 1367 |
if postIndex > l { |
| 1368 |
return io.ErrUnexpectedEOF |
| 1369 |
} |
| 1370 |
m.Rules = append(m.Rules, &Rule{}) |
| 1371 |
if err := m.Rules[len(m.Rules)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { |
| 1372 |
return err |
| 1373 |
} |
| 1374 |
iNdEx = postIndex |
| 1375 |
default: |
| 1376 |
iNdEx = preIndex |
| 1377 |
skippy, err := protohelpers.Skip(dAtA[iNdEx:]) |
| 1378 |
if err != nil { |
| 1379 |
return err |
| 1380 |
} |
| 1381 |
if (skippy < 0) || (iNdEx+skippy) < 0 { |
| 1382 |
return protohelpers.ErrInvalidLength |
| 1383 |
} |
| 1384 |
if (iNdEx + skippy) > l { |
| 1385 |
return io.ErrUnexpectedEOF |
| 1386 |
} |
| 1387 |
m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) |
| 1388 |
iNdEx += skippy |
| 1389 |
} |
| 1390 |
} |
| 1391 |
|
| 1392 |
if iNdEx > l { |
| 1393 |
return io.ErrUnexpectedEOF |
| 1394 |
} |
| 1395 |
return nil |
| 1396 |
} |