| // Code generated by protoc-gen-gogo. DO NOT EDIT. |
| // source: auth.proto |
| |
| package authpb |
| |
| import ( |
| fmt "fmt" |
| io "io" |
| math "math" |
| math_bits "math/bits" |
| |
| _ "github.com/gogo/protobuf/gogoproto" |
| proto "github.com/golang/protobuf/proto" |
| ) |
| |
| // Reference imports to suppress errors if they are not otherwise used. |
| var _ = proto.Marshal |
| var _ = fmt.Errorf |
| var _ = math.Inf |
| |
| // This is a compile-time assertion to ensure that this generated file |
| // is compatible with the proto package it is being compiled against. |
| // A compilation error at this line likely means your copy of the |
| // proto package needs to be updated. |
| const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package |
| |
| type Permission_Type int32 |
| |
| const ( |
| READ Permission_Type = 0 |
| WRITE Permission_Type = 1 |
| READWRITE Permission_Type = 2 |
| ) |
| |
| var Permission_Type_name = map[int32]string{ |
| 0: "READ", |
| 1: "WRITE", |
| 2: "READWRITE", |
| } |
| |
| var Permission_Type_value = map[string]int32{ |
| "READ": 0, |
| "WRITE": 1, |
| "READWRITE": 2, |
| } |
| |
| func (x Permission_Type) String() string { |
| return proto.EnumName(Permission_Type_name, int32(x)) |
| } |
| |
| func (Permission_Type) EnumDescriptor() ([]byte, []int) { |
| return fileDescriptor_8bbd6f3875b0e874, []int{2, 0} |
| } |
| |
| type UserAddOptions struct { |
| NoPassword bool `protobuf:"varint,1,opt,name=no_password,json=noPassword,proto3" json:"no_password,omitempty"` |
| XXX_NoUnkeyedLiteral struct{} `json:"-"` |
| XXX_unrecognized []byte `json:"-"` |
| XXX_sizecache int32 `json:"-"` |
| } |
| |
| func (m *UserAddOptions) Reset() { *m = UserAddOptions{} } |
| func (m *UserAddOptions) String() string { return proto.CompactTextString(m) } |
| func (*UserAddOptions) ProtoMessage() {} |
| func (*UserAddOptions) Descriptor() ([]byte, []int) { |
| return fileDescriptor_8bbd6f3875b0e874, []int{0} |
| } |
| func (m *UserAddOptions) XXX_Unmarshal(b []byte) error { |
| return m.Unmarshal(b) |
| } |
| func (m *UserAddOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { |
| if deterministic { |
| return xxx_messageInfo_UserAddOptions.Marshal(b, m, deterministic) |
| } else { |
| b = b[:cap(b)] |
| n, err := m.MarshalToSizedBuffer(b) |
| if err != nil { |
| return nil, err |
| } |
| return b[:n], nil |
| } |
| } |
| func (m *UserAddOptions) XXX_Merge(src proto.Message) { |
| xxx_messageInfo_UserAddOptions.Merge(m, src) |
| } |
| func (m *UserAddOptions) XXX_Size() int { |
| return m.Size() |
| } |
| func (m *UserAddOptions) XXX_DiscardUnknown() { |
| xxx_messageInfo_UserAddOptions.DiscardUnknown(m) |
| } |
| |
| var xxx_messageInfo_UserAddOptions proto.InternalMessageInfo |
| |
| // User is a single entry in the bucket authUsers |
| type User struct { |
| Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` |
| Password []byte `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` |
| Roles []string `protobuf:"bytes,3,rep,name=roles,proto3" json:"roles,omitempty"` |
| Options *UserAddOptions `protobuf:"bytes,4,opt,name=options,proto3" json:"options,omitempty"` |
| XXX_NoUnkeyedLiteral struct{} `json:"-"` |
| XXX_unrecognized []byte `json:"-"` |
| XXX_sizecache int32 `json:"-"` |
| } |
| |
| func (m *User) Reset() { *m = User{} } |
| func (m *User) String() string { return proto.CompactTextString(m) } |
| func (*User) ProtoMessage() {} |
| func (*User) Descriptor() ([]byte, []int) { |
| return fileDescriptor_8bbd6f3875b0e874, []int{1} |
| } |
| func (m *User) XXX_Unmarshal(b []byte) error { |
| return m.Unmarshal(b) |
| } |
| func (m *User) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { |
| if deterministic { |
| return xxx_messageInfo_User.Marshal(b, m, deterministic) |
| } else { |
| b = b[:cap(b)] |
| n, err := m.MarshalToSizedBuffer(b) |
| if err != nil { |
| return nil, err |
| } |
| return b[:n], nil |
| } |
| } |
| func (m *User) XXX_Merge(src proto.Message) { |
| xxx_messageInfo_User.Merge(m, src) |
| } |
| func (m *User) XXX_Size() int { |
| return m.Size() |
| } |
| func (m *User) XXX_DiscardUnknown() { |
| xxx_messageInfo_User.DiscardUnknown(m) |
| } |
| |
| var xxx_messageInfo_User proto.InternalMessageInfo |
| |
| // Permission is a single entity |
| type Permission struct { |
| PermType Permission_Type `protobuf:"varint,1,opt,name=permType,proto3,enum=authpb.Permission_Type" json:"permType,omitempty"` |
| Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` |
| RangeEnd []byte `protobuf:"bytes,3,opt,name=range_end,json=rangeEnd,proto3" json:"range_end,omitempty"` |
| XXX_NoUnkeyedLiteral struct{} `json:"-"` |
| XXX_unrecognized []byte `json:"-"` |
| XXX_sizecache int32 `json:"-"` |
| } |
| |
| func (m *Permission) Reset() { *m = Permission{} } |
| func (m *Permission) String() string { return proto.CompactTextString(m) } |
| func (*Permission) ProtoMessage() {} |
| func (*Permission) Descriptor() ([]byte, []int) { |
| return fileDescriptor_8bbd6f3875b0e874, []int{2} |
| } |
| func (m *Permission) XXX_Unmarshal(b []byte) error { |
| return m.Unmarshal(b) |
| } |
| func (m *Permission) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { |
| if deterministic { |
| return xxx_messageInfo_Permission.Marshal(b, m, deterministic) |
| } else { |
| b = b[:cap(b)] |
| n, err := m.MarshalToSizedBuffer(b) |
| if err != nil { |
| return nil, err |
| } |
| return b[:n], nil |
| } |
| } |
| func (m *Permission) XXX_Merge(src proto.Message) { |
| xxx_messageInfo_Permission.Merge(m, src) |
| } |
| func (m *Permission) XXX_Size() int { |
| return m.Size() |
| } |
| func (m *Permission) XXX_DiscardUnknown() { |
| xxx_messageInfo_Permission.DiscardUnknown(m) |
| } |
| |
| var xxx_messageInfo_Permission proto.InternalMessageInfo |
| |
| // Role is a single entry in the bucket authRoles |
| type Role struct { |
| Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` |
| KeyPermission []*Permission `protobuf:"bytes,2,rep,name=keyPermission,proto3" json:"keyPermission,omitempty"` |
| XXX_NoUnkeyedLiteral struct{} `json:"-"` |
| XXX_unrecognized []byte `json:"-"` |
| XXX_sizecache int32 `json:"-"` |
| } |
| |
| func (m *Role) Reset() { *m = Role{} } |
| func (m *Role) String() string { return proto.CompactTextString(m) } |
| func (*Role) ProtoMessage() {} |
| func (*Role) Descriptor() ([]byte, []int) { |
| return fileDescriptor_8bbd6f3875b0e874, []int{3} |
| } |
| func (m *Role) XXX_Unmarshal(b []byte) error { |
| return m.Unmarshal(b) |
| } |
| func (m *Role) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { |
| if deterministic { |
| return xxx_messageInfo_Role.Marshal(b, m, deterministic) |
| } else { |
| b = b[:cap(b)] |
| n, err := m.MarshalToSizedBuffer(b) |
| if err != nil { |
| return nil, err |
| } |
| return b[:n], nil |
| } |
| } |
| func (m *Role) XXX_Merge(src proto.Message) { |
| xxx_messageInfo_Role.Merge(m, src) |
| } |
| func (m *Role) XXX_Size() int { |
| return m.Size() |
| } |
| func (m *Role) XXX_DiscardUnknown() { |
| xxx_messageInfo_Role.DiscardUnknown(m) |
| } |
| |
| var xxx_messageInfo_Role proto.InternalMessageInfo |
| |
| func init() { |
| proto.RegisterEnum("authpb.Permission_Type", Permission_Type_name, Permission_Type_value) |
| proto.RegisterType((*UserAddOptions)(nil), "authpb.UserAddOptions") |
| proto.RegisterType((*User)(nil), "authpb.User") |
| proto.RegisterType((*Permission)(nil), "authpb.Permission") |
| proto.RegisterType((*Role)(nil), "authpb.Role") |
| } |
| |
| func init() { proto.RegisterFile("auth.proto", fileDescriptor_8bbd6f3875b0e874) } |
| |
| var fileDescriptor_8bbd6f3875b0e874 = []byte{ |
| // 359 bytes of a gzipped FileDescriptorProto |
| 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0xcf, 0x4e, 0xc2, 0x40, |
| 0x10, 0xc6, 0xbb, 0xb4, 0x60, 0x3b, 0x08, 0x21, 0x1b, 0xa2, 0x0d, 0xc6, 0xda, 0xf4, 0xd4, 0x78, |
| 0x68, 0x15, 0x0e, 0x7a, 0xc5, 0xc8, 0xc1, 0x93, 0x64, 0x83, 0x31, 0xf1, 0x42, 0x8a, 0xdd, 0xd4, |
| 0x06, 0xd8, 0x6d, 0xda, 0xaa, 0xe1, 0xe2, 0x73, 0x78, 0xf0, 0x81, 0x38, 0xf2, 0x08, 0x82, 0x2f, |
| 0x62, 0xba, 0xcb, 0x9f, 0x10, 0x3d, 0xed, 0x37, 0xdf, 0x7c, 0x33, 0xfb, 0xcb, 0x2e, 0x40, 0xf0, |
| 0x9a, 0xbf, 0x78, 0x49, 0xca, 0x73, 0x8e, 0x2b, 0x85, 0x4e, 0x46, 0xad, 0x66, 0xc4, 0x23, 0x2e, |
| 0x2c, 0xbf, 0x50, 0xb2, 0xeb, 0x5c, 0x42, 0xfd, 0x21, 0xa3, 0x69, 0x37, 0x0c, 0xef, 0x93, 0x3c, |
| 0xe6, 0x2c, 0xc3, 0x67, 0x50, 0x65, 0x7c, 0x98, 0x04, 0x59, 0xf6, 0xce, 0xd3, 0xd0, 0x44, 0x36, |
| 0x72, 0x75, 0x02, 0x8c, 0xf7, 0xd7, 0x8e, 0xf3, 0x01, 0x5a, 0x31, 0x82, 0x31, 0x68, 0x2c, 0x98, |
| 0x52, 0x91, 0x38, 0x24, 0x42, 0xe3, 0x16, 0xe8, 0xdb, 0xc9, 0x92, 0xf0, 0xb7, 0x35, 0x6e, 0x42, |
| 0x39, 0xe5, 0x13, 0x9a, 0x99, 0xaa, 0xad, 0xba, 0x06, 0x91, 0x05, 0xbe, 0x80, 0x03, 0x2e, 0x6f, |
| 0x36, 0x35, 0x1b, 0xb9, 0xd5, 0xf6, 0x91, 0x27, 0x81, 0xbd, 0x7d, 0x2e, 0xb2, 0x89, 0x39, 0x5f, |
| 0x08, 0xa0, 0x4f, 0xd3, 0x69, 0x9c, 0x65, 0x31, 0x67, 0xb8, 0x03, 0x7a, 0x42, 0xd3, 0xe9, 0x60, |
| 0x96, 0x48, 0x94, 0x7a, 0xfb, 0x78, 0xb3, 0x61, 0x97, 0xf2, 0x8a, 0x36, 0xd9, 0x06, 0x71, 0x03, |
| 0xd4, 0x31, 0x9d, 0xad, 0x11, 0x0b, 0x89, 0x4f, 0xc0, 0x48, 0x03, 0x16, 0xd1, 0x21, 0x65, 0xa1, |
| 0xa9, 0x4a, 0x74, 0x61, 0xf4, 0x58, 0xe8, 0x9c, 0x83, 0x26, 0xc6, 0x74, 0xd0, 0x48, 0xaf, 0x7b, |
| 0xdb, 0x50, 0xb0, 0x01, 0xe5, 0x47, 0x72, 0x37, 0xe8, 0x35, 0x10, 0xae, 0x81, 0x51, 0x98, 0xb2, |
| 0x2c, 0x39, 0x03, 0xd0, 0x08, 0x9f, 0xd0, 0x7f, 0x9f, 0xe7, 0x1a, 0x6a, 0x63, 0x3a, 0xdb, 0x61, |
| 0x99, 0x25, 0x5b, 0x75, 0xab, 0x6d, 0xfc, 0x17, 0x98, 0xec, 0x07, 0x6f, 0xae, 0xe6, 0x4b, 0x4b, |
| 0x59, 0x2c, 0x2d, 0x65, 0xbe, 0xb2, 0xd0, 0x62, 0x65, 0xa1, 0xef, 0x95, 0x85, 0x3e, 0x7f, 0x2c, |
| 0xe5, 0xe9, 0x34, 0xe2, 0x1e, 0xcd, 0x9f, 0x43, 0x2f, 0xe6, 0x7e, 0x71, 0xfa, 0x41, 0x12, 0xfb, |
| 0x6f, 0x1d, 0x5f, 0xae, 0x1c, 0x55, 0xc4, 0x3f, 0x77, 0x7e, 0x03, 0x00, 0x00, 0xff, 0xff, 0x61, |
| 0x5a, 0xfe, 0x48, 0x13, 0x02, 0x00, 0x00, |
| } |
| |
| func (m *UserAddOptions) Marshal() (dAtA []byte, err error) { |
| size := m.Size() |
| dAtA = make([]byte, size) |
| n, err := m.MarshalToSizedBuffer(dAtA[:size]) |
| if err != nil { |
| return nil, err |
| } |
| return dAtA[:n], nil |
| } |
| |
| func (m *UserAddOptions) MarshalTo(dAtA []byte) (int, error) { |
| size := m.Size() |
| return m.MarshalToSizedBuffer(dAtA[:size]) |
| } |
| |
| func (m *UserAddOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { |
| i := len(dAtA) |
| _ = i |
| var l int |
| _ = l |
| if m.XXX_unrecognized != nil { |
| i -= len(m.XXX_unrecognized) |
| copy(dAtA[i:], m.XXX_unrecognized) |
| } |
| if m.NoPassword { |
| i-- |
| if m.NoPassword { |
| dAtA[i] = 1 |
| } else { |
| dAtA[i] = 0 |
| } |
| i-- |
| dAtA[i] = 0x8 |
| } |
| return len(dAtA) - i, nil |
| } |
| |
| func (m *User) Marshal() (dAtA []byte, err error) { |
| size := m.Size() |
| dAtA = make([]byte, size) |
| n, err := m.MarshalToSizedBuffer(dAtA[:size]) |
| if err != nil { |
| return nil, err |
| } |
| return dAtA[:n], nil |
| } |
| |
| func (m *User) MarshalTo(dAtA []byte) (int, error) { |
| size := m.Size() |
| return m.MarshalToSizedBuffer(dAtA[:size]) |
| } |
| |
| func (m *User) MarshalToSizedBuffer(dAtA []byte) (int, error) { |
| i := len(dAtA) |
| _ = i |
| var l int |
| _ = l |
| if m.XXX_unrecognized != nil { |
| i -= len(m.XXX_unrecognized) |
| copy(dAtA[i:], m.XXX_unrecognized) |
| } |
| if m.Options != nil { |
| { |
| size, err := m.Options.MarshalToSizedBuffer(dAtA[:i]) |
| if err != nil { |
| return 0, err |
| } |
| i -= size |
| i = encodeVarintAuth(dAtA, i, uint64(size)) |
| } |
| i-- |
| dAtA[i] = 0x22 |
| } |
| if len(m.Roles) > 0 { |
| for iNdEx := len(m.Roles) - 1; iNdEx >= 0; iNdEx-- { |
| i -= len(m.Roles[iNdEx]) |
| copy(dAtA[i:], m.Roles[iNdEx]) |
| i = encodeVarintAuth(dAtA, i, uint64(len(m.Roles[iNdEx]))) |
| i-- |
| dAtA[i] = 0x1a |
| } |
| } |
| if len(m.Password) > 0 { |
| i -= len(m.Password) |
| copy(dAtA[i:], m.Password) |
| i = encodeVarintAuth(dAtA, i, uint64(len(m.Password))) |
| i-- |
| dAtA[i] = 0x12 |
| } |
| if len(m.Name) > 0 { |
| i -= len(m.Name) |
| copy(dAtA[i:], m.Name) |
| i = encodeVarintAuth(dAtA, i, uint64(len(m.Name))) |
| i-- |
| dAtA[i] = 0xa |
| } |
| return len(dAtA) - i, nil |
| } |
| |
| func (m *Permission) Marshal() (dAtA []byte, err error) { |
| size := m.Size() |
| dAtA = make([]byte, size) |
| n, err := m.MarshalToSizedBuffer(dAtA[:size]) |
| if err != nil { |
| return nil, err |
| } |
| return dAtA[:n], nil |
| } |
| |
| func (m *Permission) MarshalTo(dAtA []byte) (int, error) { |
| size := m.Size() |
| return m.MarshalToSizedBuffer(dAtA[:size]) |
| } |
| |
| func (m *Permission) MarshalToSizedBuffer(dAtA []byte) (int, error) { |
| i := len(dAtA) |
| _ = i |
| var l int |
| _ = l |
| if m.XXX_unrecognized != nil { |
| i -= len(m.XXX_unrecognized) |
| copy(dAtA[i:], m.XXX_unrecognized) |
| } |
| if len(m.RangeEnd) > 0 { |
| i -= len(m.RangeEnd) |
| copy(dAtA[i:], m.RangeEnd) |
| i = encodeVarintAuth(dAtA, i, uint64(len(m.RangeEnd))) |
| i-- |
| dAtA[i] = 0x1a |
| } |
| if len(m.Key) > 0 { |
| i -= len(m.Key) |
| copy(dAtA[i:], m.Key) |
| i = encodeVarintAuth(dAtA, i, uint64(len(m.Key))) |
| i-- |
| dAtA[i] = 0x12 |
| } |
| if m.PermType != 0 { |
| i = encodeVarintAuth(dAtA, i, uint64(m.PermType)) |
| i-- |
| dAtA[i] = 0x8 |
| } |
| return len(dAtA) - i, nil |
| } |
| |
| func (m *Role) Marshal() (dAtA []byte, err error) { |
| size := m.Size() |
| dAtA = make([]byte, size) |
| n, err := m.MarshalToSizedBuffer(dAtA[:size]) |
| if err != nil { |
| return nil, err |
| } |
| return dAtA[:n], nil |
| } |
| |
| func (m *Role) MarshalTo(dAtA []byte) (int, error) { |
| size := m.Size() |
| return m.MarshalToSizedBuffer(dAtA[:size]) |
| } |
| |
| func (m *Role) MarshalToSizedBuffer(dAtA []byte) (int, error) { |
| i := len(dAtA) |
| _ = i |
| var l int |
| _ = l |
| if m.XXX_unrecognized != nil { |
| i -= len(m.XXX_unrecognized) |
| copy(dAtA[i:], m.XXX_unrecognized) |
| } |
| if len(m.KeyPermission) > 0 { |
| for iNdEx := len(m.KeyPermission) - 1; iNdEx >= 0; iNdEx-- { |
| { |
| size, err := m.KeyPermission[iNdEx].MarshalToSizedBuffer(dAtA[:i]) |
| if err != nil { |
| return 0, err |
| } |
| i -= size |
| i = encodeVarintAuth(dAtA, i, uint64(size)) |
| } |
| i-- |
| dAtA[i] = 0x12 |
| } |
| } |
| if len(m.Name) > 0 { |
| i -= len(m.Name) |
| copy(dAtA[i:], m.Name) |
| i = encodeVarintAuth(dAtA, i, uint64(len(m.Name))) |
| i-- |
| dAtA[i] = 0xa |
| } |
| return len(dAtA) - i, nil |
| } |
| |
| func encodeVarintAuth(dAtA []byte, offset int, v uint64) int { |
| offset -= sovAuth(v) |
| base := offset |
| for v >= 1<<7 { |
| dAtA[offset] = uint8(v&0x7f | 0x80) |
| v >>= 7 |
| offset++ |
| } |
| dAtA[offset] = uint8(v) |
| return base |
| } |
| func (m *UserAddOptions) Size() (n int) { |
| if m == nil { |
| return 0 |
| } |
| var l int |
| _ = l |
| if m.NoPassword { |
| n += 2 |
| } |
| if m.XXX_unrecognized != nil { |
| n += len(m.XXX_unrecognized) |
| } |
| return n |
| } |
| |
| func (m *User) Size() (n int) { |
| if m == nil { |
| return 0 |
| } |
| var l int |
| _ = l |
| l = len(m.Name) |
| if l > 0 { |
| n += 1 + l + sovAuth(uint64(l)) |
| } |
| l = len(m.Password) |
| if l > 0 { |
| n += 1 + l + sovAuth(uint64(l)) |
| } |
| if len(m.Roles) > 0 { |
| for _, s := range m.Roles { |
| l = len(s) |
| n += 1 + l + sovAuth(uint64(l)) |
| } |
| } |
| if m.Options != nil { |
| l = m.Options.Size() |
| n += 1 + l + sovAuth(uint64(l)) |
| } |
| if m.XXX_unrecognized != nil { |
| n += len(m.XXX_unrecognized) |
| } |
| return n |
| } |
| |
| func (m *Permission) Size() (n int) { |
| if m == nil { |
| return 0 |
| } |
| var l int |
| _ = l |
| if m.PermType != 0 { |
| n += 1 + sovAuth(uint64(m.PermType)) |
| } |
| l = len(m.Key) |
| if l > 0 { |
| n += 1 + l + sovAuth(uint64(l)) |
| } |
| l = len(m.RangeEnd) |
| if l > 0 { |
| n += 1 + l + sovAuth(uint64(l)) |
| } |
| if m.XXX_unrecognized != nil { |
| n += len(m.XXX_unrecognized) |
| } |
| return n |
| } |
| |
| func (m *Role) Size() (n int) { |
| if m == nil { |
| return 0 |
| } |
| var l int |
| _ = l |
| l = len(m.Name) |
| if l > 0 { |
| n += 1 + l + sovAuth(uint64(l)) |
| } |
| if len(m.KeyPermission) > 0 { |
| for _, e := range m.KeyPermission { |
| l = e.Size() |
| n += 1 + l + sovAuth(uint64(l)) |
| } |
| } |
| if m.XXX_unrecognized != nil { |
| n += len(m.XXX_unrecognized) |
| } |
| return n |
| } |
| |
| func sovAuth(x uint64) (n int) { |
| return (math_bits.Len64(x|1) + 6) / 7 |
| } |
| func sozAuth(x uint64) (n int) { |
| return sovAuth(uint64((x << 1) ^ uint64((int64(x) >> 63)))) |
| } |
| func (m *UserAddOptions) Unmarshal(dAtA []byte) error { |
| l := len(dAtA) |
| iNdEx := 0 |
| for iNdEx < l { |
| preIndex := iNdEx |
| var wire uint64 |
| for shift := uint(0); ; shift += 7 { |
| if shift >= 64 { |
| return ErrIntOverflowAuth |
| } |
| if iNdEx >= l { |
| return io.ErrUnexpectedEOF |
| } |
| b := dAtA[iNdEx] |
| iNdEx++ |
| wire |= uint64(b&0x7F) << shift |
| if b < 0x80 { |
| break |
| } |
| } |
| fieldNum := int32(wire >> 3) |
| wireType := int(wire & 0x7) |
| if wireType == 4 { |
| return fmt.Errorf("proto: UserAddOptions: wiretype end group for non-group") |
| } |
| if fieldNum <= 0 { |
| return fmt.Errorf("proto: UserAddOptions: illegal tag %d (wire type %d)", fieldNum, wire) |
| } |
| switch fieldNum { |
| case 1: |
| if wireType != 0 { |
| return fmt.Errorf("proto: wrong wireType = %d for field NoPassword", wireType) |
| } |
| var v int |
| for shift := uint(0); ; shift += 7 { |
| if shift >= 64 { |
| return ErrIntOverflowAuth |
| } |
| if iNdEx >= l { |
| return io.ErrUnexpectedEOF |
| } |
| b := dAtA[iNdEx] |
| iNdEx++ |
| v |= int(b&0x7F) << shift |
| if b < 0x80 { |
| break |
| } |
| } |
| m.NoPassword = bool(v != 0) |
| default: |
| iNdEx = preIndex |
| skippy, err := skipAuth(dAtA[iNdEx:]) |
| if err != nil { |
| return err |
| } |
| if (skippy < 0) || (iNdEx+skippy) < 0 { |
| return ErrInvalidLengthAuth |
| } |
| if (iNdEx + skippy) > l { |
| return io.ErrUnexpectedEOF |
| } |
| m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) |
| iNdEx += skippy |
| } |
| } |
| |
| if iNdEx > l { |
| return io.ErrUnexpectedEOF |
| } |
| return nil |
| } |
| func (m *User) Unmarshal(dAtA []byte) error { |
| l := len(dAtA) |
| iNdEx := 0 |
| for iNdEx < l { |
| preIndex := iNdEx |
| var wire uint64 |
| for shift := uint(0); ; shift += 7 { |
| if shift >= 64 { |
| return ErrIntOverflowAuth |
| } |
| if iNdEx >= l { |
| return io.ErrUnexpectedEOF |
| } |
| b := dAtA[iNdEx] |
| iNdEx++ |
| wire |= uint64(b&0x7F) << shift |
| if b < 0x80 { |
| break |
| } |
| } |
| fieldNum := int32(wire >> 3) |
| wireType := int(wire & 0x7) |
| if wireType == 4 { |
| return fmt.Errorf("proto: User: wiretype end group for non-group") |
| } |
| if fieldNum <= 0 { |
| return fmt.Errorf("proto: User: illegal tag %d (wire type %d)", fieldNum, wire) |
| } |
| switch fieldNum { |
| case 1: |
| if wireType != 2 { |
| return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) |
| } |
| var byteLen int |
| for shift := uint(0); ; shift += 7 { |
| if shift >= 64 { |
| return ErrIntOverflowAuth |
| } |
| if iNdEx >= l { |
| return io.ErrUnexpectedEOF |
| } |
| b := dAtA[iNdEx] |
| iNdEx++ |
| byteLen |= int(b&0x7F) << shift |
| if b < 0x80 { |
| break |
| } |
| } |
| if byteLen < 0 { |
| return ErrInvalidLengthAuth |
| } |
| postIndex := iNdEx + byteLen |
| if postIndex < 0 { |
| return ErrInvalidLengthAuth |
| } |
| if postIndex > l { |
| return io.ErrUnexpectedEOF |
| } |
| m.Name = append(m.Name[:0], dAtA[iNdEx:postIndex]...) |
| if m.Name == nil { |
| m.Name = []byte{} |
| } |
| iNdEx = postIndex |
| case 2: |
| if wireType != 2 { |
| return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) |
| } |
| var byteLen int |
| for shift := uint(0); ; shift += 7 { |
| if shift >= 64 { |
| return ErrIntOverflowAuth |
| } |
| if iNdEx >= l { |
| return io.ErrUnexpectedEOF |
| } |
| b := dAtA[iNdEx] |
| iNdEx++ |
| byteLen |= int(b&0x7F) << shift |
| if b < 0x80 { |
| break |
| } |
| } |
| if byteLen < 0 { |
| return ErrInvalidLengthAuth |
| } |
| postIndex := iNdEx + byteLen |
| if postIndex < 0 { |
| return ErrInvalidLengthAuth |
| } |
| if postIndex > l { |
| return io.ErrUnexpectedEOF |
| } |
| m.Password = append(m.Password[:0], dAtA[iNdEx:postIndex]...) |
| if m.Password == nil { |
| m.Password = []byte{} |
| } |
| iNdEx = postIndex |
| case 3: |
| if wireType != 2 { |
| return fmt.Errorf("proto: wrong wireType = %d for field Roles", wireType) |
| } |
| var stringLen uint64 |
| for shift := uint(0); ; shift += 7 { |
| if shift >= 64 { |
| return ErrIntOverflowAuth |
| } |
| if iNdEx >= l { |
| return io.ErrUnexpectedEOF |
| } |
| b := dAtA[iNdEx] |
| iNdEx++ |
| stringLen |= uint64(b&0x7F) << shift |
| if b < 0x80 { |
| break |
| } |
| } |
| intStringLen := int(stringLen) |
| if intStringLen < 0 { |
| return ErrInvalidLengthAuth |
| } |
| postIndex := iNdEx + intStringLen |
| if postIndex < 0 { |
| return ErrInvalidLengthAuth |
| } |
| if postIndex > l { |
| return io.ErrUnexpectedEOF |
| } |
| m.Roles = append(m.Roles, string(dAtA[iNdEx:postIndex])) |
| iNdEx = postIndex |
| case 4: |
| if wireType != 2 { |
| return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) |
| } |
| var msglen int |
| for shift := uint(0); ; shift += 7 { |
| if shift >= 64 { |
| return ErrIntOverflowAuth |
| } |
| if iNdEx >= l { |
| return io.ErrUnexpectedEOF |
| } |
| b := dAtA[iNdEx] |
| iNdEx++ |
| msglen |= int(b&0x7F) << shift |
| if b < 0x80 { |
| break |
| } |
| } |
| if msglen < 0 { |
| return ErrInvalidLengthAuth |
| } |
| postIndex := iNdEx + msglen |
| if postIndex < 0 { |
| return ErrInvalidLengthAuth |
| } |
| if postIndex > l { |
| return io.ErrUnexpectedEOF |
| } |
| if m.Options == nil { |
| m.Options = &UserAddOptions{} |
| } |
| if err := m.Options.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
| return err |
| } |
| iNdEx = postIndex |
| default: |
| iNdEx = preIndex |
| skippy, err := skipAuth(dAtA[iNdEx:]) |
| if err != nil { |
| return err |
| } |
| if (skippy < 0) || (iNdEx+skippy) < 0 { |
| return ErrInvalidLengthAuth |
| } |
| if (iNdEx + skippy) > l { |
| return io.ErrUnexpectedEOF |
| } |
| m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) |
| iNdEx += skippy |
| } |
| } |
| |
| if iNdEx > l { |
| return io.ErrUnexpectedEOF |
| } |
| return nil |
| } |
| func (m *Permission) Unmarshal(dAtA []byte) error { |
| l := len(dAtA) |
| iNdEx := 0 |
| for iNdEx < l { |
| preIndex := iNdEx |
| var wire uint64 |
| for shift := uint(0); ; shift += 7 { |
| if shift >= 64 { |
| return ErrIntOverflowAuth |
| } |
| if iNdEx >= l { |
| return io.ErrUnexpectedEOF |
| } |
| b := dAtA[iNdEx] |
| iNdEx++ |
| wire |= uint64(b&0x7F) << shift |
| if b < 0x80 { |
| break |
| } |
| } |
| fieldNum := int32(wire >> 3) |
| wireType := int(wire & 0x7) |
| if wireType == 4 { |
| return fmt.Errorf("proto: Permission: wiretype end group for non-group") |
| } |
| if fieldNum <= 0 { |
| return fmt.Errorf("proto: Permission: illegal tag %d (wire type %d)", fieldNum, wire) |
| } |
| switch fieldNum { |
| case 1: |
| if wireType != 0 { |
| return fmt.Errorf("proto: wrong wireType = %d for field PermType", wireType) |
| } |
| m.PermType = 0 |
| for shift := uint(0); ; shift += 7 { |
| if shift >= 64 { |
| return ErrIntOverflowAuth |
| } |
| if iNdEx >= l { |
| return io.ErrUnexpectedEOF |
| } |
| b := dAtA[iNdEx] |
| iNdEx++ |
| m.PermType |= Permission_Type(b&0x7F) << shift |
| if b < 0x80 { |
| break |
| } |
| } |
| case 2: |
| if wireType != 2 { |
| return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) |
| } |
| var byteLen int |
| for shift := uint(0); ; shift += 7 { |
| if shift >= 64 { |
| return ErrIntOverflowAuth |
| } |
| if iNdEx >= l { |
| return io.ErrUnexpectedEOF |
| } |
| b := dAtA[iNdEx] |
| iNdEx++ |
| byteLen |= int(b&0x7F) << shift |
| if b < 0x80 { |
| break |
| } |
| } |
| if byteLen < 0 { |
| return ErrInvalidLengthAuth |
| } |
| postIndex := iNdEx + byteLen |
| if postIndex < 0 { |
| return ErrInvalidLengthAuth |
| } |
| if postIndex > l { |
| return io.ErrUnexpectedEOF |
| } |
| m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) |
| if m.Key == nil { |
| m.Key = []byte{} |
| } |
| iNdEx = postIndex |
| case 3: |
| if wireType != 2 { |
| return fmt.Errorf("proto: wrong wireType = %d for field RangeEnd", wireType) |
| } |
| var byteLen int |
| for shift := uint(0); ; shift += 7 { |
| if shift >= 64 { |
| return ErrIntOverflowAuth |
| } |
| if iNdEx >= l { |
| return io.ErrUnexpectedEOF |
| } |
| b := dAtA[iNdEx] |
| iNdEx++ |
| byteLen |= int(b&0x7F) << shift |
| if b < 0x80 { |
| break |
| } |
| } |
| if byteLen < 0 { |
| return ErrInvalidLengthAuth |
| } |
| postIndex := iNdEx + byteLen |
| if postIndex < 0 { |
| return ErrInvalidLengthAuth |
| } |
| if postIndex > l { |
| return io.ErrUnexpectedEOF |
| } |
| m.RangeEnd = append(m.RangeEnd[:0], dAtA[iNdEx:postIndex]...) |
| if m.RangeEnd == nil { |
| m.RangeEnd = []byte{} |
| } |
| iNdEx = postIndex |
| default: |
| iNdEx = preIndex |
| skippy, err := skipAuth(dAtA[iNdEx:]) |
| if err != nil { |
| return err |
| } |
| if (skippy < 0) || (iNdEx+skippy) < 0 { |
| return ErrInvalidLengthAuth |
| } |
| if (iNdEx + skippy) > l { |
| return io.ErrUnexpectedEOF |
| } |
| m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) |
| iNdEx += skippy |
| } |
| } |
| |
| if iNdEx > l { |
| return io.ErrUnexpectedEOF |
| } |
| return nil |
| } |
| func (m *Role) Unmarshal(dAtA []byte) error { |
| l := len(dAtA) |
| iNdEx := 0 |
| for iNdEx < l { |
| preIndex := iNdEx |
| var wire uint64 |
| for shift := uint(0); ; shift += 7 { |
| if shift >= 64 { |
| return ErrIntOverflowAuth |
| } |
| if iNdEx >= l { |
| return io.ErrUnexpectedEOF |
| } |
| b := dAtA[iNdEx] |
| iNdEx++ |
| wire |= uint64(b&0x7F) << shift |
| if b < 0x80 { |
| break |
| } |
| } |
| fieldNum := int32(wire >> 3) |
| wireType := int(wire & 0x7) |
| if wireType == 4 { |
| return fmt.Errorf("proto: Role: wiretype end group for non-group") |
| } |
| if fieldNum <= 0 { |
| return fmt.Errorf("proto: Role: illegal tag %d (wire type %d)", fieldNum, wire) |
| } |
| switch fieldNum { |
| case 1: |
| if wireType != 2 { |
| return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) |
| } |
| var byteLen int |
| for shift := uint(0); ; shift += 7 { |
| if shift >= 64 { |
| return ErrIntOverflowAuth |
| } |
| if iNdEx >= l { |
| return io.ErrUnexpectedEOF |
| } |
| b := dAtA[iNdEx] |
| iNdEx++ |
| byteLen |= int(b&0x7F) << shift |
| if b < 0x80 { |
| break |
| } |
| } |
| if byteLen < 0 { |
| return ErrInvalidLengthAuth |
| } |
| postIndex := iNdEx + byteLen |
| if postIndex < 0 { |
| return ErrInvalidLengthAuth |
| } |
| if postIndex > l { |
| return io.ErrUnexpectedEOF |
| } |
| m.Name = append(m.Name[:0], dAtA[iNdEx:postIndex]...) |
| if m.Name == nil { |
| m.Name = []byte{} |
| } |
| iNdEx = postIndex |
| case 2: |
| if wireType != 2 { |
| return fmt.Errorf("proto: wrong wireType = %d for field KeyPermission", wireType) |
| } |
| var msglen int |
| for shift := uint(0); ; shift += 7 { |
| if shift >= 64 { |
| return ErrIntOverflowAuth |
| } |
| if iNdEx >= l { |
| return io.ErrUnexpectedEOF |
| } |
| b := dAtA[iNdEx] |
| iNdEx++ |
| msglen |= int(b&0x7F) << shift |
| if b < 0x80 { |
| break |
| } |
| } |
| if msglen < 0 { |
| return ErrInvalidLengthAuth |
| } |
| postIndex := iNdEx + msglen |
| if postIndex < 0 { |
| return ErrInvalidLengthAuth |
| } |
| if postIndex > l { |
| return io.ErrUnexpectedEOF |
| } |
| m.KeyPermission = append(m.KeyPermission, &Permission{}) |
| if err := m.KeyPermission[len(m.KeyPermission)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
| return err |
| } |
| iNdEx = postIndex |
| default: |
| iNdEx = preIndex |
| skippy, err := skipAuth(dAtA[iNdEx:]) |
| if err != nil { |
| return err |
| } |
| if (skippy < 0) || (iNdEx+skippy) < 0 { |
| return ErrInvalidLengthAuth |
| } |
| if (iNdEx + skippy) > l { |
| return io.ErrUnexpectedEOF |
| } |
| m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) |
| iNdEx += skippy |
| } |
| } |
| |
| if iNdEx > l { |
| return io.ErrUnexpectedEOF |
| } |
| return nil |
| } |
| func skipAuth(dAtA []byte) (n int, err error) { |
| l := len(dAtA) |
| iNdEx := 0 |
| depth := 0 |
| for iNdEx < l { |
| var wire uint64 |
| for shift := uint(0); ; shift += 7 { |
| if shift >= 64 { |
| return 0, ErrIntOverflowAuth |
| } |
| if iNdEx >= l { |
| return 0, io.ErrUnexpectedEOF |
| } |
| b := dAtA[iNdEx] |
| iNdEx++ |
| wire |= (uint64(b) & 0x7F) << shift |
| if b < 0x80 { |
| break |
| } |
| } |
| wireType := int(wire & 0x7) |
| switch wireType { |
| case 0: |
| for shift := uint(0); ; shift += 7 { |
| if shift >= 64 { |
| return 0, ErrIntOverflowAuth |
| } |
| if iNdEx >= l { |
| return 0, io.ErrUnexpectedEOF |
| } |
| iNdEx++ |
| if dAtA[iNdEx-1] < 0x80 { |
| break |
| } |
| } |
| case 1: |
| iNdEx += 8 |
| case 2: |
| var length int |
| for shift := uint(0); ; shift += 7 { |
| if shift >= 64 { |
| return 0, ErrIntOverflowAuth |
| } |
| if iNdEx >= l { |
| return 0, io.ErrUnexpectedEOF |
| } |
| b := dAtA[iNdEx] |
| iNdEx++ |
| length |= (int(b) & 0x7F) << shift |
| if b < 0x80 { |
| break |
| } |
| } |
| if length < 0 { |
| return 0, ErrInvalidLengthAuth |
| } |
| iNdEx += length |
| case 3: |
| depth++ |
| case 4: |
| if depth == 0 { |
| return 0, ErrUnexpectedEndOfGroupAuth |
| } |
| depth-- |
| case 5: |
| iNdEx += 4 |
| default: |
| return 0, fmt.Errorf("proto: illegal wireType %d", wireType) |
| } |
| if iNdEx < 0 { |
| return 0, ErrInvalidLengthAuth |
| } |
| if depth == 0 { |
| return iNdEx, nil |
| } |
| } |
| return 0, io.ErrUnexpectedEOF |
| } |
| |
| var ( |
| ErrInvalidLengthAuth = fmt.Errorf("proto: negative length found during unmarshaling") |
| ErrIntOverflowAuth = fmt.Errorf("proto: integer overflow") |
| ErrUnexpectedEndOfGroupAuth = fmt.Errorf("proto: unexpected end of group") |
| ) |