William Kurkian | ea86948 | 2019-04-09 15:16:11 -0400 | [diff] [blame] | 1 | // Code generated by protoc-gen-gogo. DO NOT EDIT. |
| 2 | // source: auth.proto |
| 3 | |
| 4 | /* |
| 5 | Package authpb is a generated protocol buffer package. |
| 6 | |
| 7 | It is generated from these files: |
| 8 | auth.proto |
| 9 | |
| 10 | It has these top-level messages: |
| 11 | User |
| 12 | Permission |
| 13 | Role |
| 14 | */ |
| 15 | package authpb |
| 16 | |
| 17 | import ( |
| 18 | "fmt" |
| 19 | |
| 20 | proto "github.com/golang/protobuf/proto" |
| 21 | |
| 22 | math "math" |
| 23 | |
| 24 | _ "github.com/gogo/protobuf/gogoproto" |
| 25 | |
| 26 | io "io" |
| 27 | ) |
| 28 | |
| 29 | // Reference imports to suppress errors if they are not otherwise used. |
| 30 | var _ = proto.Marshal |
| 31 | var _ = fmt.Errorf |
| 32 | var _ = math.Inf |
| 33 | |
| 34 | // This is a compile-time assertion to ensure that this generated file |
| 35 | // is compatible with the proto package it is being compiled against. |
| 36 | // A compilation error at this line likely means your copy of the |
| 37 | // proto package needs to be updated. |
| 38 | const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package |
| 39 | |
| 40 | type Permission_Type int32 |
| 41 | |
| 42 | const ( |
| 43 | READ Permission_Type = 0 |
| 44 | WRITE Permission_Type = 1 |
| 45 | READWRITE Permission_Type = 2 |
| 46 | ) |
| 47 | |
| 48 | var Permission_Type_name = map[int32]string{ |
| 49 | 0: "READ", |
| 50 | 1: "WRITE", |
| 51 | 2: "READWRITE", |
| 52 | } |
| 53 | var Permission_Type_value = map[string]int32{ |
| 54 | "READ": 0, |
| 55 | "WRITE": 1, |
| 56 | "READWRITE": 2, |
| 57 | } |
| 58 | |
| 59 | func (x Permission_Type) String() string { |
| 60 | return proto.EnumName(Permission_Type_name, int32(x)) |
| 61 | } |
| 62 | func (Permission_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptorAuth, []int{1, 0} } |
| 63 | |
| 64 | // User is a single entry in the bucket authUsers |
| 65 | type User struct { |
| 66 | Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` |
| 67 | Password []byte `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` |
| 68 | Roles []string `protobuf:"bytes,3,rep,name=roles" json:"roles,omitempty"` |
| 69 | } |
| 70 | |
| 71 | func (m *User) Reset() { *m = User{} } |
| 72 | func (m *User) String() string { return proto.CompactTextString(m) } |
| 73 | func (*User) ProtoMessage() {} |
| 74 | func (*User) Descriptor() ([]byte, []int) { return fileDescriptorAuth, []int{0} } |
| 75 | |
| 76 | // Permission is a single entity |
| 77 | type Permission struct { |
| 78 | PermType Permission_Type `protobuf:"varint,1,opt,name=permType,proto3,enum=authpb.Permission_Type" json:"permType,omitempty"` |
| 79 | Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` |
| 80 | RangeEnd []byte `protobuf:"bytes,3,opt,name=range_end,json=rangeEnd,proto3" json:"range_end,omitempty"` |
| 81 | } |
| 82 | |
| 83 | func (m *Permission) Reset() { *m = Permission{} } |
| 84 | func (m *Permission) String() string { return proto.CompactTextString(m) } |
| 85 | func (*Permission) ProtoMessage() {} |
| 86 | func (*Permission) Descriptor() ([]byte, []int) { return fileDescriptorAuth, []int{1} } |
| 87 | |
| 88 | // Role is a single entry in the bucket authRoles |
| 89 | type Role struct { |
| 90 | Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` |
| 91 | KeyPermission []*Permission `protobuf:"bytes,2,rep,name=keyPermission" json:"keyPermission,omitempty"` |
| 92 | } |
| 93 | |
| 94 | func (m *Role) Reset() { *m = Role{} } |
| 95 | func (m *Role) String() string { return proto.CompactTextString(m) } |
| 96 | func (*Role) ProtoMessage() {} |
| 97 | func (*Role) Descriptor() ([]byte, []int) { return fileDescriptorAuth, []int{2} } |
| 98 | |
| 99 | func init() { |
| 100 | proto.RegisterType((*User)(nil), "authpb.User") |
| 101 | proto.RegisterType((*Permission)(nil), "authpb.Permission") |
| 102 | proto.RegisterType((*Role)(nil), "authpb.Role") |
| 103 | proto.RegisterEnum("authpb.Permission_Type", Permission_Type_name, Permission_Type_value) |
| 104 | } |
| 105 | func (m *User) Marshal() (dAtA []byte, err error) { |
| 106 | size := m.Size() |
| 107 | dAtA = make([]byte, size) |
| 108 | n, err := m.MarshalTo(dAtA) |
| 109 | if err != nil { |
| 110 | return nil, err |
| 111 | } |
| 112 | return dAtA[:n], nil |
| 113 | } |
| 114 | |
| 115 | func (m *User) MarshalTo(dAtA []byte) (int, error) { |
| 116 | var i int |
| 117 | _ = i |
| 118 | var l int |
| 119 | _ = l |
| 120 | if len(m.Name) > 0 { |
| 121 | dAtA[i] = 0xa |
| 122 | i++ |
| 123 | i = encodeVarintAuth(dAtA, i, uint64(len(m.Name))) |
| 124 | i += copy(dAtA[i:], m.Name) |
| 125 | } |
| 126 | if len(m.Password) > 0 { |
| 127 | dAtA[i] = 0x12 |
| 128 | i++ |
| 129 | i = encodeVarintAuth(dAtA, i, uint64(len(m.Password))) |
| 130 | i += copy(dAtA[i:], m.Password) |
| 131 | } |
| 132 | if len(m.Roles) > 0 { |
| 133 | for _, s := range m.Roles { |
| 134 | dAtA[i] = 0x1a |
| 135 | i++ |
| 136 | l = len(s) |
| 137 | for l >= 1<<7 { |
| 138 | dAtA[i] = uint8(uint64(l)&0x7f | 0x80) |
| 139 | l >>= 7 |
| 140 | i++ |
| 141 | } |
| 142 | dAtA[i] = uint8(l) |
| 143 | i++ |
| 144 | i += copy(dAtA[i:], s) |
| 145 | } |
| 146 | } |
| 147 | return i, nil |
| 148 | } |
| 149 | |
| 150 | func (m *Permission) Marshal() (dAtA []byte, err error) { |
| 151 | size := m.Size() |
| 152 | dAtA = make([]byte, size) |
| 153 | n, err := m.MarshalTo(dAtA) |
| 154 | if err != nil { |
| 155 | return nil, err |
| 156 | } |
| 157 | return dAtA[:n], nil |
| 158 | } |
| 159 | |
| 160 | func (m *Permission) MarshalTo(dAtA []byte) (int, error) { |
| 161 | var i int |
| 162 | _ = i |
| 163 | var l int |
| 164 | _ = l |
| 165 | if m.PermType != 0 { |
| 166 | dAtA[i] = 0x8 |
| 167 | i++ |
| 168 | i = encodeVarintAuth(dAtA, i, uint64(m.PermType)) |
| 169 | } |
| 170 | if len(m.Key) > 0 { |
| 171 | dAtA[i] = 0x12 |
| 172 | i++ |
| 173 | i = encodeVarintAuth(dAtA, i, uint64(len(m.Key))) |
| 174 | i += copy(dAtA[i:], m.Key) |
| 175 | } |
| 176 | if len(m.RangeEnd) > 0 { |
| 177 | dAtA[i] = 0x1a |
| 178 | i++ |
| 179 | i = encodeVarintAuth(dAtA, i, uint64(len(m.RangeEnd))) |
| 180 | i += copy(dAtA[i:], m.RangeEnd) |
| 181 | } |
| 182 | return i, nil |
| 183 | } |
| 184 | |
| 185 | func (m *Role) Marshal() (dAtA []byte, err error) { |
| 186 | size := m.Size() |
| 187 | dAtA = make([]byte, size) |
| 188 | n, err := m.MarshalTo(dAtA) |
| 189 | if err != nil { |
| 190 | return nil, err |
| 191 | } |
| 192 | return dAtA[:n], nil |
| 193 | } |
| 194 | |
| 195 | func (m *Role) MarshalTo(dAtA []byte) (int, error) { |
| 196 | var i int |
| 197 | _ = i |
| 198 | var l int |
| 199 | _ = l |
| 200 | if len(m.Name) > 0 { |
| 201 | dAtA[i] = 0xa |
| 202 | i++ |
| 203 | i = encodeVarintAuth(dAtA, i, uint64(len(m.Name))) |
| 204 | i += copy(dAtA[i:], m.Name) |
| 205 | } |
| 206 | if len(m.KeyPermission) > 0 { |
| 207 | for _, msg := range m.KeyPermission { |
| 208 | dAtA[i] = 0x12 |
| 209 | i++ |
| 210 | i = encodeVarintAuth(dAtA, i, uint64(msg.Size())) |
| 211 | n, err := msg.MarshalTo(dAtA[i:]) |
| 212 | if err != nil { |
| 213 | return 0, err |
| 214 | } |
| 215 | i += n |
| 216 | } |
| 217 | } |
| 218 | return i, nil |
| 219 | } |
| 220 | |
| 221 | func encodeVarintAuth(dAtA []byte, offset int, v uint64) int { |
| 222 | for v >= 1<<7 { |
| 223 | dAtA[offset] = uint8(v&0x7f | 0x80) |
| 224 | v >>= 7 |
| 225 | offset++ |
| 226 | } |
| 227 | dAtA[offset] = uint8(v) |
| 228 | return offset + 1 |
| 229 | } |
| 230 | func (m *User) Size() (n int) { |
| 231 | var l int |
| 232 | _ = l |
| 233 | l = len(m.Name) |
| 234 | if l > 0 { |
| 235 | n += 1 + l + sovAuth(uint64(l)) |
| 236 | } |
| 237 | l = len(m.Password) |
| 238 | if l > 0 { |
| 239 | n += 1 + l + sovAuth(uint64(l)) |
| 240 | } |
| 241 | if len(m.Roles) > 0 { |
| 242 | for _, s := range m.Roles { |
| 243 | l = len(s) |
| 244 | n += 1 + l + sovAuth(uint64(l)) |
| 245 | } |
| 246 | } |
| 247 | return n |
| 248 | } |
| 249 | |
| 250 | func (m *Permission) Size() (n int) { |
| 251 | var l int |
| 252 | _ = l |
| 253 | if m.PermType != 0 { |
| 254 | n += 1 + sovAuth(uint64(m.PermType)) |
| 255 | } |
| 256 | l = len(m.Key) |
| 257 | if l > 0 { |
| 258 | n += 1 + l + sovAuth(uint64(l)) |
| 259 | } |
| 260 | l = len(m.RangeEnd) |
| 261 | if l > 0 { |
| 262 | n += 1 + l + sovAuth(uint64(l)) |
| 263 | } |
| 264 | return n |
| 265 | } |
| 266 | |
| 267 | func (m *Role) Size() (n int) { |
| 268 | var l int |
| 269 | _ = l |
| 270 | l = len(m.Name) |
| 271 | if l > 0 { |
| 272 | n += 1 + l + sovAuth(uint64(l)) |
| 273 | } |
| 274 | if len(m.KeyPermission) > 0 { |
| 275 | for _, e := range m.KeyPermission { |
| 276 | l = e.Size() |
| 277 | n += 1 + l + sovAuth(uint64(l)) |
| 278 | } |
| 279 | } |
| 280 | return n |
| 281 | } |
| 282 | |
| 283 | func sovAuth(x uint64) (n int) { |
| 284 | for { |
| 285 | n++ |
| 286 | x >>= 7 |
| 287 | if x == 0 { |
| 288 | break |
| 289 | } |
| 290 | } |
| 291 | return n |
| 292 | } |
| 293 | func sozAuth(x uint64) (n int) { |
| 294 | return sovAuth(uint64((x << 1) ^ uint64((int64(x) >> 63)))) |
| 295 | } |
| 296 | func (m *User) Unmarshal(dAtA []byte) error { |
| 297 | l := len(dAtA) |
| 298 | iNdEx := 0 |
| 299 | for iNdEx < l { |
| 300 | preIndex := iNdEx |
| 301 | var wire uint64 |
| 302 | for shift := uint(0); ; shift += 7 { |
| 303 | if shift >= 64 { |
| 304 | return ErrIntOverflowAuth |
| 305 | } |
| 306 | if iNdEx >= l { |
| 307 | return io.ErrUnexpectedEOF |
| 308 | } |
| 309 | b := dAtA[iNdEx] |
| 310 | iNdEx++ |
| 311 | wire |= (uint64(b) & 0x7F) << shift |
| 312 | if b < 0x80 { |
| 313 | break |
| 314 | } |
| 315 | } |
| 316 | fieldNum := int32(wire >> 3) |
| 317 | wireType := int(wire & 0x7) |
| 318 | if wireType == 4 { |
| 319 | return fmt.Errorf("proto: User: wiretype end group for non-group") |
| 320 | } |
| 321 | if fieldNum <= 0 { |
| 322 | return fmt.Errorf("proto: User: illegal tag %d (wire type %d)", fieldNum, wire) |
| 323 | } |
| 324 | switch fieldNum { |
| 325 | case 1: |
| 326 | if wireType != 2 { |
| 327 | return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) |
| 328 | } |
| 329 | var byteLen int |
| 330 | for shift := uint(0); ; shift += 7 { |
| 331 | if shift >= 64 { |
| 332 | return ErrIntOverflowAuth |
| 333 | } |
| 334 | if iNdEx >= l { |
| 335 | return io.ErrUnexpectedEOF |
| 336 | } |
| 337 | b := dAtA[iNdEx] |
| 338 | iNdEx++ |
| 339 | byteLen |= (int(b) & 0x7F) << shift |
| 340 | if b < 0x80 { |
| 341 | break |
| 342 | } |
| 343 | } |
| 344 | if byteLen < 0 { |
| 345 | return ErrInvalidLengthAuth |
| 346 | } |
| 347 | postIndex := iNdEx + byteLen |
| 348 | if postIndex > l { |
| 349 | return io.ErrUnexpectedEOF |
| 350 | } |
| 351 | m.Name = append(m.Name[:0], dAtA[iNdEx:postIndex]...) |
| 352 | if m.Name == nil { |
| 353 | m.Name = []byte{} |
| 354 | } |
| 355 | iNdEx = postIndex |
| 356 | case 2: |
| 357 | if wireType != 2 { |
| 358 | return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) |
| 359 | } |
| 360 | var byteLen int |
| 361 | for shift := uint(0); ; shift += 7 { |
| 362 | if shift >= 64 { |
| 363 | return ErrIntOverflowAuth |
| 364 | } |
| 365 | if iNdEx >= l { |
| 366 | return io.ErrUnexpectedEOF |
| 367 | } |
| 368 | b := dAtA[iNdEx] |
| 369 | iNdEx++ |
| 370 | byteLen |= (int(b) & 0x7F) << shift |
| 371 | if b < 0x80 { |
| 372 | break |
| 373 | } |
| 374 | } |
| 375 | if byteLen < 0 { |
| 376 | return ErrInvalidLengthAuth |
| 377 | } |
| 378 | postIndex := iNdEx + byteLen |
| 379 | if postIndex > l { |
| 380 | return io.ErrUnexpectedEOF |
| 381 | } |
| 382 | m.Password = append(m.Password[:0], dAtA[iNdEx:postIndex]...) |
| 383 | if m.Password == nil { |
| 384 | m.Password = []byte{} |
| 385 | } |
| 386 | iNdEx = postIndex |
| 387 | case 3: |
| 388 | if wireType != 2 { |
| 389 | return fmt.Errorf("proto: wrong wireType = %d for field Roles", wireType) |
| 390 | } |
| 391 | var stringLen uint64 |
| 392 | for shift := uint(0); ; shift += 7 { |
| 393 | if shift >= 64 { |
| 394 | return ErrIntOverflowAuth |
| 395 | } |
| 396 | if iNdEx >= l { |
| 397 | return io.ErrUnexpectedEOF |
| 398 | } |
| 399 | b := dAtA[iNdEx] |
| 400 | iNdEx++ |
| 401 | stringLen |= (uint64(b) & 0x7F) << shift |
| 402 | if b < 0x80 { |
| 403 | break |
| 404 | } |
| 405 | } |
| 406 | intStringLen := int(stringLen) |
| 407 | if intStringLen < 0 { |
| 408 | return ErrInvalidLengthAuth |
| 409 | } |
| 410 | postIndex := iNdEx + intStringLen |
| 411 | if postIndex > l { |
| 412 | return io.ErrUnexpectedEOF |
| 413 | } |
| 414 | m.Roles = append(m.Roles, string(dAtA[iNdEx:postIndex])) |
| 415 | iNdEx = postIndex |
| 416 | default: |
| 417 | iNdEx = preIndex |
| 418 | skippy, err := skipAuth(dAtA[iNdEx:]) |
| 419 | if err != nil { |
| 420 | return err |
| 421 | } |
| 422 | if skippy < 0 { |
| 423 | return ErrInvalidLengthAuth |
| 424 | } |
| 425 | if (iNdEx + skippy) > l { |
| 426 | return io.ErrUnexpectedEOF |
| 427 | } |
| 428 | iNdEx += skippy |
| 429 | } |
| 430 | } |
| 431 | |
| 432 | if iNdEx > l { |
| 433 | return io.ErrUnexpectedEOF |
| 434 | } |
| 435 | return nil |
| 436 | } |
| 437 | func (m *Permission) Unmarshal(dAtA []byte) error { |
| 438 | l := len(dAtA) |
| 439 | iNdEx := 0 |
| 440 | for iNdEx < l { |
| 441 | preIndex := iNdEx |
| 442 | var wire uint64 |
| 443 | for shift := uint(0); ; shift += 7 { |
| 444 | if shift >= 64 { |
| 445 | return ErrIntOverflowAuth |
| 446 | } |
| 447 | if iNdEx >= l { |
| 448 | return io.ErrUnexpectedEOF |
| 449 | } |
| 450 | b := dAtA[iNdEx] |
| 451 | iNdEx++ |
| 452 | wire |= (uint64(b) & 0x7F) << shift |
| 453 | if b < 0x80 { |
| 454 | break |
| 455 | } |
| 456 | } |
| 457 | fieldNum := int32(wire >> 3) |
| 458 | wireType := int(wire & 0x7) |
| 459 | if wireType == 4 { |
| 460 | return fmt.Errorf("proto: Permission: wiretype end group for non-group") |
| 461 | } |
| 462 | if fieldNum <= 0 { |
| 463 | return fmt.Errorf("proto: Permission: illegal tag %d (wire type %d)", fieldNum, wire) |
| 464 | } |
| 465 | switch fieldNum { |
| 466 | case 1: |
| 467 | if wireType != 0 { |
| 468 | return fmt.Errorf("proto: wrong wireType = %d for field PermType", wireType) |
| 469 | } |
| 470 | m.PermType = 0 |
| 471 | for shift := uint(0); ; shift += 7 { |
| 472 | if shift >= 64 { |
| 473 | return ErrIntOverflowAuth |
| 474 | } |
| 475 | if iNdEx >= l { |
| 476 | return io.ErrUnexpectedEOF |
| 477 | } |
| 478 | b := dAtA[iNdEx] |
| 479 | iNdEx++ |
| 480 | m.PermType |= (Permission_Type(b) & 0x7F) << shift |
| 481 | if b < 0x80 { |
| 482 | break |
| 483 | } |
| 484 | } |
| 485 | case 2: |
| 486 | if wireType != 2 { |
| 487 | return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) |
| 488 | } |
| 489 | var byteLen int |
| 490 | for shift := uint(0); ; shift += 7 { |
| 491 | if shift >= 64 { |
| 492 | return ErrIntOverflowAuth |
| 493 | } |
| 494 | if iNdEx >= l { |
| 495 | return io.ErrUnexpectedEOF |
| 496 | } |
| 497 | b := dAtA[iNdEx] |
| 498 | iNdEx++ |
| 499 | byteLen |= (int(b) & 0x7F) << shift |
| 500 | if b < 0x80 { |
| 501 | break |
| 502 | } |
| 503 | } |
| 504 | if byteLen < 0 { |
| 505 | return ErrInvalidLengthAuth |
| 506 | } |
| 507 | postIndex := iNdEx + byteLen |
| 508 | if postIndex > l { |
| 509 | return io.ErrUnexpectedEOF |
| 510 | } |
| 511 | m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) |
| 512 | if m.Key == nil { |
| 513 | m.Key = []byte{} |
| 514 | } |
| 515 | iNdEx = postIndex |
| 516 | case 3: |
| 517 | if wireType != 2 { |
| 518 | return fmt.Errorf("proto: wrong wireType = %d for field RangeEnd", wireType) |
| 519 | } |
| 520 | var byteLen int |
| 521 | for shift := uint(0); ; shift += 7 { |
| 522 | if shift >= 64 { |
| 523 | return ErrIntOverflowAuth |
| 524 | } |
| 525 | if iNdEx >= l { |
| 526 | return io.ErrUnexpectedEOF |
| 527 | } |
| 528 | b := dAtA[iNdEx] |
| 529 | iNdEx++ |
| 530 | byteLen |= (int(b) & 0x7F) << shift |
| 531 | if b < 0x80 { |
| 532 | break |
| 533 | } |
| 534 | } |
| 535 | if byteLen < 0 { |
| 536 | return ErrInvalidLengthAuth |
| 537 | } |
| 538 | postIndex := iNdEx + byteLen |
| 539 | if postIndex > l { |
| 540 | return io.ErrUnexpectedEOF |
| 541 | } |
| 542 | m.RangeEnd = append(m.RangeEnd[:0], dAtA[iNdEx:postIndex]...) |
| 543 | if m.RangeEnd == nil { |
| 544 | m.RangeEnd = []byte{} |
| 545 | } |
| 546 | iNdEx = postIndex |
| 547 | default: |
| 548 | iNdEx = preIndex |
| 549 | skippy, err := skipAuth(dAtA[iNdEx:]) |
| 550 | if err != nil { |
| 551 | return err |
| 552 | } |
| 553 | if skippy < 0 { |
| 554 | return ErrInvalidLengthAuth |
| 555 | } |
| 556 | if (iNdEx + skippy) > l { |
| 557 | return io.ErrUnexpectedEOF |
| 558 | } |
| 559 | iNdEx += skippy |
| 560 | } |
| 561 | } |
| 562 | |
| 563 | if iNdEx > l { |
| 564 | return io.ErrUnexpectedEOF |
| 565 | } |
| 566 | return nil |
| 567 | } |
| 568 | func (m *Role) Unmarshal(dAtA []byte) error { |
| 569 | l := len(dAtA) |
| 570 | iNdEx := 0 |
| 571 | for iNdEx < l { |
| 572 | preIndex := iNdEx |
| 573 | var wire uint64 |
| 574 | for shift := uint(0); ; shift += 7 { |
| 575 | if shift >= 64 { |
| 576 | return ErrIntOverflowAuth |
| 577 | } |
| 578 | if iNdEx >= l { |
| 579 | return io.ErrUnexpectedEOF |
| 580 | } |
| 581 | b := dAtA[iNdEx] |
| 582 | iNdEx++ |
| 583 | wire |= (uint64(b) & 0x7F) << shift |
| 584 | if b < 0x80 { |
| 585 | break |
| 586 | } |
| 587 | } |
| 588 | fieldNum := int32(wire >> 3) |
| 589 | wireType := int(wire & 0x7) |
| 590 | if wireType == 4 { |
| 591 | return fmt.Errorf("proto: Role: wiretype end group for non-group") |
| 592 | } |
| 593 | if fieldNum <= 0 { |
| 594 | return fmt.Errorf("proto: Role: illegal tag %d (wire type %d)", fieldNum, wire) |
| 595 | } |
| 596 | switch fieldNum { |
| 597 | case 1: |
| 598 | if wireType != 2 { |
| 599 | return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) |
| 600 | } |
| 601 | var byteLen int |
| 602 | for shift := uint(0); ; shift += 7 { |
| 603 | if shift >= 64 { |
| 604 | return ErrIntOverflowAuth |
| 605 | } |
| 606 | if iNdEx >= l { |
| 607 | return io.ErrUnexpectedEOF |
| 608 | } |
| 609 | b := dAtA[iNdEx] |
| 610 | iNdEx++ |
| 611 | byteLen |= (int(b) & 0x7F) << shift |
| 612 | if b < 0x80 { |
| 613 | break |
| 614 | } |
| 615 | } |
| 616 | if byteLen < 0 { |
| 617 | return ErrInvalidLengthAuth |
| 618 | } |
| 619 | postIndex := iNdEx + byteLen |
| 620 | if postIndex > l { |
| 621 | return io.ErrUnexpectedEOF |
| 622 | } |
| 623 | m.Name = append(m.Name[:0], dAtA[iNdEx:postIndex]...) |
| 624 | if m.Name == nil { |
| 625 | m.Name = []byte{} |
| 626 | } |
| 627 | iNdEx = postIndex |
| 628 | case 2: |
| 629 | if wireType != 2 { |
| 630 | return fmt.Errorf("proto: wrong wireType = %d for field KeyPermission", wireType) |
| 631 | } |
| 632 | var msglen int |
| 633 | for shift := uint(0); ; shift += 7 { |
| 634 | if shift >= 64 { |
| 635 | return ErrIntOverflowAuth |
| 636 | } |
| 637 | if iNdEx >= l { |
| 638 | return io.ErrUnexpectedEOF |
| 639 | } |
| 640 | b := dAtA[iNdEx] |
| 641 | iNdEx++ |
| 642 | msglen |= (int(b) & 0x7F) << shift |
| 643 | if b < 0x80 { |
| 644 | break |
| 645 | } |
| 646 | } |
| 647 | if msglen < 0 { |
| 648 | return ErrInvalidLengthAuth |
| 649 | } |
| 650 | postIndex := iNdEx + msglen |
| 651 | if postIndex > l { |
| 652 | return io.ErrUnexpectedEOF |
| 653 | } |
| 654 | m.KeyPermission = append(m.KeyPermission, &Permission{}) |
| 655 | if err := m.KeyPermission[len(m.KeyPermission)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
| 656 | return err |
| 657 | } |
| 658 | iNdEx = postIndex |
| 659 | default: |
| 660 | iNdEx = preIndex |
| 661 | skippy, err := skipAuth(dAtA[iNdEx:]) |
| 662 | if err != nil { |
| 663 | return err |
| 664 | } |
| 665 | if skippy < 0 { |
| 666 | return ErrInvalidLengthAuth |
| 667 | } |
| 668 | if (iNdEx + skippy) > l { |
| 669 | return io.ErrUnexpectedEOF |
| 670 | } |
| 671 | iNdEx += skippy |
| 672 | } |
| 673 | } |
| 674 | |
| 675 | if iNdEx > l { |
| 676 | return io.ErrUnexpectedEOF |
| 677 | } |
| 678 | return nil |
| 679 | } |
| 680 | func skipAuth(dAtA []byte) (n int, err error) { |
| 681 | l := len(dAtA) |
| 682 | iNdEx := 0 |
| 683 | for iNdEx < l { |
| 684 | var wire uint64 |
| 685 | for shift := uint(0); ; shift += 7 { |
| 686 | if shift >= 64 { |
| 687 | return 0, ErrIntOverflowAuth |
| 688 | } |
| 689 | if iNdEx >= l { |
| 690 | return 0, io.ErrUnexpectedEOF |
| 691 | } |
| 692 | b := dAtA[iNdEx] |
| 693 | iNdEx++ |
| 694 | wire |= (uint64(b) & 0x7F) << shift |
| 695 | if b < 0x80 { |
| 696 | break |
| 697 | } |
| 698 | } |
| 699 | wireType := int(wire & 0x7) |
| 700 | switch wireType { |
| 701 | case 0: |
| 702 | for shift := uint(0); ; shift += 7 { |
| 703 | if shift >= 64 { |
| 704 | return 0, ErrIntOverflowAuth |
| 705 | } |
| 706 | if iNdEx >= l { |
| 707 | return 0, io.ErrUnexpectedEOF |
| 708 | } |
| 709 | iNdEx++ |
| 710 | if dAtA[iNdEx-1] < 0x80 { |
| 711 | break |
| 712 | } |
| 713 | } |
| 714 | return iNdEx, nil |
| 715 | case 1: |
| 716 | iNdEx += 8 |
| 717 | return iNdEx, nil |
| 718 | case 2: |
| 719 | var length int |
| 720 | for shift := uint(0); ; shift += 7 { |
| 721 | if shift >= 64 { |
| 722 | return 0, ErrIntOverflowAuth |
| 723 | } |
| 724 | if iNdEx >= l { |
| 725 | return 0, io.ErrUnexpectedEOF |
| 726 | } |
| 727 | b := dAtA[iNdEx] |
| 728 | iNdEx++ |
| 729 | length |= (int(b) & 0x7F) << shift |
| 730 | if b < 0x80 { |
| 731 | break |
| 732 | } |
| 733 | } |
| 734 | iNdEx += length |
| 735 | if length < 0 { |
| 736 | return 0, ErrInvalidLengthAuth |
| 737 | } |
| 738 | return iNdEx, nil |
| 739 | case 3: |
| 740 | for { |
| 741 | var innerWire uint64 |
| 742 | var start int = iNdEx |
| 743 | for shift := uint(0); ; shift += 7 { |
| 744 | if shift >= 64 { |
| 745 | return 0, ErrIntOverflowAuth |
| 746 | } |
| 747 | if iNdEx >= l { |
| 748 | return 0, io.ErrUnexpectedEOF |
| 749 | } |
| 750 | b := dAtA[iNdEx] |
| 751 | iNdEx++ |
| 752 | innerWire |= (uint64(b) & 0x7F) << shift |
| 753 | if b < 0x80 { |
| 754 | break |
| 755 | } |
| 756 | } |
| 757 | innerWireType := int(innerWire & 0x7) |
| 758 | if innerWireType == 4 { |
| 759 | break |
| 760 | } |
| 761 | next, err := skipAuth(dAtA[start:]) |
| 762 | if err != nil { |
| 763 | return 0, err |
| 764 | } |
| 765 | iNdEx = start + next |
| 766 | } |
| 767 | return iNdEx, nil |
| 768 | case 4: |
| 769 | return iNdEx, nil |
| 770 | case 5: |
| 771 | iNdEx += 4 |
| 772 | return iNdEx, nil |
| 773 | default: |
| 774 | return 0, fmt.Errorf("proto: illegal wireType %d", wireType) |
| 775 | } |
| 776 | } |
| 777 | panic("unreachable") |
| 778 | } |
| 779 | |
| 780 | var ( |
| 781 | ErrInvalidLengthAuth = fmt.Errorf("proto: negative length found during unmarshaling") |
| 782 | ErrIntOverflowAuth = fmt.Errorf("proto: integer overflow") |
| 783 | ) |
| 784 | |
| 785 | func init() { proto.RegisterFile("auth.proto", fileDescriptorAuth) } |
| 786 | |
| 787 | var fileDescriptorAuth = []byte{ |
| 788 | // 288 bytes of a gzipped FileDescriptorProto |
| 789 | 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0xc1, 0x4a, 0xc3, 0x30, |
| 790 | 0x1c, 0xc6, 0x9b, 0xb6, 0x1b, 0xed, 0x5f, 0x27, 0x25, 0x0c, 0x0c, 0x13, 0x42, 0xe9, 0xa9, 0x78, |
| 791 | 0xa8, 0xb0, 0x5d, 0xbc, 0x2a, 0xf6, 0x20, 0x78, 0x90, 0x50, 0xf1, 0x28, 0x1d, 0x0d, 0x75, 0x6c, |
| 792 | 0x6d, 0x4a, 0x32, 0x91, 0xbe, 0x89, 0x07, 0x1f, 0x68, 0xc7, 0x3d, 0x82, 0xab, 0x2f, 0x22, 0x4d, |
| 793 | 0x64, 0x43, 0xdc, 0xed, 0xfb, 0xbe, 0xff, 0x97, 0xe4, 0x97, 0x3f, 0x40, 0xfe, 0xb6, 0x7e, 0x4d, |
| 794 | 0x1a, 0x29, 0xd6, 0x02, 0x0f, 0x7b, 0xdd, 0xcc, 0x27, 0xe3, 0x52, 0x94, 0x42, 0x47, 0x57, 0xbd, |
| 795 | 0x32, 0xd3, 0xe8, 0x01, 0xdc, 0x27, 0xc5, 0x25, 0xc6, 0xe0, 0xd6, 0x79, 0xc5, 0x09, 0x0a, 0x51, |
| 796 | 0x7c, 0xca, 0xb4, 0xc6, 0x13, 0xf0, 0x9a, 0x5c, 0xa9, 0x77, 0x21, 0x0b, 0x62, 0xeb, 0x7c, 0xef, |
| 797 | 0xf1, 0x18, 0x06, 0x52, 0xac, 0xb8, 0x22, 0x4e, 0xe8, 0xc4, 0x3e, 0x33, 0x26, 0xfa, 0x44, 0x00, |
| 798 | 0x8f, 0x5c, 0x56, 0x0b, 0xa5, 0x16, 0xa2, 0xc6, 0x33, 0xf0, 0x1a, 0x2e, 0xab, 0xac, 0x6d, 0xcc, |
| 799 | 0xc5, 0x67, 0xd3, 0xf3, 0xc4, 0xd0, 0x24, 0x87, 0x56, 0xd2, 0x8f, 0xd9, 0xbe, 0x88, 0x03, 0x70, |
| 800 | 0x96, 0xbc, 0xfd, 0x7d, 0xb0, 0x97, 0xf8, 0x02, 0x7c, 0x99, 0xd7, 0x25, 0x7f, 0xe1, 0x75, 0x41, |
| 801 | 0x1c, 0x03, 0xa2, 0x83, 0xb4, 0x2e, 0xa2, 0x4b, 0x70, 0xf5, 0x31, 0x0f, 0x5c, 0x96, 0xde, 0xdc, |
| 802 | 0x05, 0x16, 0xf6, 0x61, 0xf0, 0xcc, 0xee, 0xb3, 0x34, 0x40, 0x78, 0x04, 0x7e, 0x1f, 0x1a, 0x6b, |
| 803 | 0x47, 0x19, 0xb8, 0x4c, 0xac, 0xf8, 0xd1, 0xcf, 0x5e, 0xc3, 0x68, 0xc9, 0xdb, 0x03, 0x16, 0xb1, |
| 804 | 0x43, 0x27, 0x3e, 0x99, 0xe2, 0xff, 0xc0, 0xec, 0x6f, 0xf1, 0x96, 0x6c, 0x76, 0xd4, 0xda, 0xee, |
| 805 | 0xa8, 0xb5, 0xe9, 0x28, 0xda, 0x76, 0x14, 0x7d, 0x75, 0x14, 0x7d, 0x7c, 0x53, 0x6b, 0x3e, 0xd4, |
| 806 | 0x3b, 0x9e, 0xfd, 0x04, 0x00, 0x00, 0xff, 0xff, 0xcc, 0x76, 0x8d, 0x4f, 0x8f, 0x01, 0x00, 0x00, |
| 807 | } |