970 lines
22 KiB
Go
970 lines
22 KiB
Go
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
|
// source: app/admin/main/manager/api/api.proto
|
|
|
|
package api
|
|
|
|
import proto "github.com/gogo/protobuf/proto"
|
|
import fmt "fmt"
|
|
import math "math"
|
|
import _ "github.com/gogo/protobuf/gogoproto"
|
|
|
|
import (
|
|
context "golang.org/x/net/context"
|
|
grpc "google.golang.org/grpc"
|
|
)
|
|
|
|
import io "io"
|
|
|
|
// 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.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
|
|
|
type LoginReq struct {
|
|
Mngsid string `protobuf:"bytes,1,opt,name=mngsid,proto3" json:"mngsid,omitempty"`
|
|
Dsbsid string `protobuf:"bytes,2,opt,name=dsbsid,proto3" json:"dsbsid,omitempty"`
|
|
}
|
|
|
|
func (m *LoginReq) Reset() { *m = LoginReq{} }
|
|
func (m *LoginReq) String() string { return proto.CompactTextString(m) }
|
|
func (*LoginReq) ProtoMessage() {}
|
|
func (*LoginReq) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_api_2329f30e789e58b5, []int{0}
|
|
}
|
|
|
|
func (m *LoginReq) GetMngsid() string {
|
|
if m != nil {
|
|
return m.Mngsid
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *LoginReq) GetDsbsid() string {
|
|
if m != nil {
|
|
return m.Dsbsid
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type LoginReply struct {
|
|
Sid string `protobuf:"bytes,1,opt,name=sid,proto3" json:"sid,omitempty"`
|
|
Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
|
|
}
|
|
|
|
func (m *LoginReply) Reset() { *m = LoginReply{} }
|
|
func (m *LoginReply) String() string { return proto.CompactTextString(m) }
|
|
func (*LoginReply) ProtoMessage() {}
|
|
func (*LoginReply) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_api_2329f30e789e58b5, []int{1}
|
|
}
|
|
|
|
func (m *LoginReply) GetSid() string {
|
|
if m != nil {
|
|
return m.Sid
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *LoginReply) GetUsername() string {
|
|
if m != nil {
|
|
return m.Username
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type PermissionReq struct {
|
|
Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
|
|
}
|
|
|
|
func (m *PermissionReq) Reset() { *m = PermissionReq{} }
|
|
func (m *PermissionReq) String() string { return proto.CompactTextString(m) }
|
|
func (*PermissionReq) ProtoMessage() {}
|
|
func (*PermissionReq) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_api_2329f30e789e58b5, []int{2}
|
|
}
|
|
|
|
func (m *PermissionReq) GetUsername() string {
|
|
if m != nil {
|
|
return m.Username
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type PermissionReply struct {
|
|
Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"`
|
|
Perms []string `protobuf:"bytes,2,rep,name=perms" json:"perms,omitempty"`
|
|
}
|
|
|
|
func (m *PermissionReply) Reset() { *m = PermissionReply{} }
|
|
func (m *PermissionReply) String() string { return proto.CompactTextString(m) }
|
|
func (*PermissionReply) ProtoMessage() {}
|
|
func (*PermissionReply) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_api_2329f30e789e58b5, []int{3}
|
|
}
|
|
|
|
func (m *PermissionReply) GetUid() int64 {
|
|
if m != nil {
|
|
return m.Uid
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (m *PermissionReply) GetPerms() []string {
|
|
if m != nil {
|
|
return m.Perms
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterType((*LoginReq)(nil), "main.manager.admin.LoginReq")
|
|
proto.RegisterType((*LoginReply)(nil), "main.manager.admin.LoginReply")
|
|
proto.RegisterType((*PermissionReq)(nil), "main.manager.admin.PermissionReq")
|
|
proto.RegisterType((*PermissionReply)(nil), "main.manager.admin.PermissionReply")
|
|
}
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ context.Context
|
|
var _ grpc.ClientConn
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the grpc package it is being compiled against.
|
|
const _ = grpc.SupportPackageIsVersion4
|
|
|
|
// PermitClient is the client API for Permit service.
|
|
//
|
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
|
type PermitClient interface {
|
|
Login(ctx context.Context, in *LoginReq, opts ...grpc.CallOption) (*LoginReply, error)
|
|
Permissions(ctx context.Context, in *PermissionReq, opts ...grpc.CallOption) (*PermissionReply, error)
|
|
}
|
|
|
|
type permitClient struct {
|
|
cc *grpc.ClientConn
|
|
}
|
|
|
|
func NewPermitClient(cc *grpc.ClientConn) PermitClient {
|
|
return &permitClient{cc}
|
|
}
|
|
|
|
func (c *permitClient) Login(ctx context.Context, in *LoginReq, opts ...grpc.CallOption) (*LoginReply, error) {
|
|
out := new(LoginReply)
|
|
err := c.cc.Invoke(ctx, "/main.manager.admin.Permit/Login", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *permitClient) Permissions(ctx context.Context, in *PermissionReq, opts ...grpc.CallOption) (*PermissionReply, error) {
|
|
out := new(PermissionReply)
|
|
err := c.cc.Invoke(ctx, "/main.manager.admin.Permit/Permissions", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// PermitServer is the server API for Permit service.
|
|
type PermitServer interface {
|
|
Login(context.Context, *LoginReq) (*LoginReply, error)
|
|
Permissions(context.Context, *PermissionReq) (*PermissionReply, error)
|
|
}
|
|
|
|
func RegisterPermitServer(s *grpc.Server, srv PermitServer) {
|
|
s.RegisterService(&_Permit_serviceDesc, srv)
|
|
}
|
|
|
|
func _Permit_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(LoginReq)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(PermitServer).Login(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/main.manager.admin.Permit/Login",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(PermitServer).Login(ctx, req.(*LoginReq))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Permit_Permissions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(PermissionReq)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(PermitServer).Permissions(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/main.manager.admin.Permit/Permissions",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(PermitServer).Permissions(ctx, req.(*PermissionReq))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
var _Permit_serviceDesc = grpc.ServiceDesc{
|
|
ServiceName: "main.manager.admin.Permit",
|
|
HandlerType: (*PermitServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "Login",
|
|
Handler: _Permit_Login_Handler,
|
|
},
|
|
{
|
|
MethodName: "Permissions",
|
|
Handler: _Permit_Permissions_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "app/admin/main/manager/api/api.proto",
|
|
}
|
|
|
|
func (m *LoginReq) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalTo(dAtA)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *LoginReq) MarshalTo(dAtA []byte) (int, error) {
|
|
var i int
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if len(m.Mngsid) > 0 {
|
|
dAtA[i] = 0xa
|
|
i++
|
|
i = encodeVarintApi(dAtA, i, uint64(len(m.Mngsid)))
|
|
i += copy(dAtA[i:], m.Mngsid)
|
|
}
|
|
if len(m.Dsbsid) > 0 {
|
|
dAtA[i] = 0x12
|
|
i++
|
|
i = encodeVarintApi(dAtA, i, uint64(len(m.Dsbsid)))
|
|
i += copy(dAtA[i:], m.Dsbsid)
|
|
}
|
|
return i, nil
|
|
}
|
|
|
|
func (m *LoginReply) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalTo(dAtA)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *LoginReply) MarshalTo(dAtA []byte) (int, error) {
|
|
var i int
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if len(m.Sid) > 0 {
|
|
dAtA[i] = 0xa
|
|
i++
|
|
i = encodeVarintApi(dAtA, i, uint64(len(m.Sid)))
|
|
i += copy(dAtA[i:], m.Sid)
|
|
}
|
|
if len(m.Username) > 0 {
|
|
dAtA[i] = 0x12
|
|
i++
|
|
i = encodeVarintApi(dAtA, i, uint64(len(m.Username)))
|
|
i += copy(dAtA[i:], m.Username)
|
|
}
|
|
return i, nil
|
|
}
|
|
|
|
func (m *PermissionReq) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalTo(dAtA)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *PermissionReq) MarshalTo(dAtA []byte) (int, error) {
|
|
var i int
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if len(m.Username) > 0 {
|
|
dAtA[i] = 0xa
|
|
i++
|
|
i = encodeVarintApi(dAtA, i, uint64(len(m.Username)))
|
|
i += copy(dAtA[i:], m.Username)
|
|
}
|
|
return i, nil
|
|
}
|
|
|
|
func (m *PermissionReply) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalTo(dAtA)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *PermissionReply) MarshalTo(dAtA []byte) (int, error) {
|
|
var i int
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if m.Uid != 0 {
|
|
dAtA[i] = 0x8
|
|
i++
|
|
i = encodeVarintApi(dAtA, i, uint64(m.Uid))
|
|
}
|
|
if len(m.Perms) > 0 {
|
|
for _, s := range m.Perms {
|
|
dAtA[i] = 0x12
|
|
i++
|
|
l = len(s)
|
|
for l >= 1<<7 {
|
|
dAtA[i] = uint8(uint64(l)&0x7f | 0x80)
|
|
l >>= 7
|
|
i++
|
|
}
|
|
dAtA[i] = uint8(l)
|
|
i++
|
|
i += copy(dAtA[i:], s)
|
|
}
|
|
}
|
|
return i, nil
|
|
}
|
|
|
|
func encodeVarintApi(dAtA []byte, offset int, v uint64) int {
|
|
for v >= 1<<7 {
|
|
dAtA[offset] = uint8(v&0x7f | 0x80)
|
|
v >>= 7
|
|
offset++
|
|
}
|
|
dAtA[offset] = uint8(v)
|
|
return offset + 1
|
|
}
|
|
func (m *LoginReq) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
l = len(m.Mngsid)
|
|
if l > 0 {
|
|
n += 1 + l + sovApi(uint64(l))
|
|
}
|
|
l = len(m.Dsbsid)
|
|
if l > 0 {
|
|
n += 1 + l + sovApi(uint64(l))
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *LoginReply) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
l = len(m.Sid)
|
|
if l > 0 {
|
|
n += 1 + l + sovApi(uint64(l))
|
|
}
|
|
l = len(m.Username)
|
|
if l > 0 {
|
|
n += 1 + l + sovApi(uint64(l))
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *PermissionReq) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
l = len(m.Username)
|
|
if l > 0 {
|
|
n += 1 + l + sovApi(uint64(l))
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *PermissionReply) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
if m.Uid != 0 {
|
|
n += 1 + sovApi(uint64(m.Uid))
|
|
}
|
|
if len(m.Perms) > 0 {
|
|
for _, s := range m.Perms {
|
|
l = len(s)
|
|
n += 1 + l + sovApi(uint64(l))
|
|
}
|
|
}
|
|
return n
|
|
}
|
|
|
|
func sovApi(x uint64) (n int) {
|
|
for {
|
|
n++
|
|
x >>= 7
|
|
if x == 0 {
|
|
break
|
|
}
|
|
}
|
|
return n
|
|
}
|
|
func sozApi(x uint64) (n int) {
|
|
return sovApi(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
|
}
|
|
func (m *LoginReq) 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 ErrIntOverflowApi
|
|
}
|
|
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: LoginReq: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: LoginReq: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Mngsid", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowApi
|
|
}
|
|
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 ErrInvalidLengthApi
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Mngsid = string(dAtA[iNdEx:postIndex])
|
|
iNdEx = postIndex
|
|
case 2:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Dsbsid", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowApi
|
|
}
|
|
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 ErrInvalidLengthApi
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Dsbsid = string(dAtA[iNdEx:postIndex])
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipApi(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if skippy < 0 {
|
|
return ErrInvalidLengthApi
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *LoginReply) 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 ErrIntOverflowApi
|
|
}
|
|
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: LoginReply: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: LoginReply: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Sid", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowApi
|
|
}
|
|
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 ErrInvalidLengthApi
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Sid = string(dAtA[iNdEx:postIndex])
|
|
iNdEx = postIndex
|
|
case 2:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowApi
|
|
}
|
|
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 ErrInvalidLengthApi
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Username = string(dAtA[iNdEx:postIndex])
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipApi(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if skippy < 0 {
|
|
return ErrInvalidLengthApi
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *PermissionReq) 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 ErrIntOverflowApi
|
|
}
|
|
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: PermissionReq: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: PermissionReq: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowApi
|
|
}
|
|
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 ErrInvalidLengthApi
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Username = string(dAtA[iNdEx:postIndex])
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipApi(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if skippy < 0 {
|
|
return ErrInvalidLengthApi
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *PermissionReply) 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 ErrIntOverflowApi
|
|
}
|
|
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: PermissionReply: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: PermissionReply: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 0 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Uid", wireType)
|
|
}
|
|
m.Uid = 0
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowApi
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
m.Uid |= (int64(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
case 2:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Perms", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowApi
|
|
}
|
|
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 ErrInvalidLengthApi
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Perms = append(m.Perms, string(dAtA[iNdEx:postIndex]))
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipApi(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if skippy < 0 {
|
|
return ErrInvalidLengthApi
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func skipApi(dAtA []byte) (n int, err error) {
|
|
l := len(dAtA)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return 0, ErrIntOverflowApi
|
|
}
|
|
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, ErrIntOverflowApi
|
|
}
|
|
if iNdEx >= l {
|
|
return 0, io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx++
|
|
if dAtA[iNdEx-1] < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
return iNdEx, nil
|
|
case 1:
|
|
iNdEx += 8
|
|
return iNdEx, nil
|
|
case 2:
|
|
var length int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return 0, ErrIntOverflowApi
|
|
}
|
|
if iNdEx >= l {
|
|
return 0, io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
length |= (int(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
iNdEx += length
|
|
if length < 0 {
|
|
return 0, ErrInvalidLengthApi
|
|
}
|
|
return iNdEx, nil
|
|
case 3:
|
|
for {
|
|
var innerWire uint64
|
|
var start int = iNdEx
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return 0, ErrIntOverflowApi
|
|
}
|
|
if iNdEx >= l {
|
|
return 0, io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
innerWire |= (uint64(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
innerWireType := int(innerWire & 0x7)
|
|
if innerWireType == 4 {
|
|
break
|
|
}
|
|
next, err := skipApi(dAtA[start:])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
iNdEx = start + next
|
|
}
|
|
return iNdEx, nil
|
|
case 4:
|
|
return iNdEx, nil
|
|
case 5:
|
|
iNdEx += 4
|
|
return iNdEx, nil
|
|
default:
|
|
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
|
}
|
|
}
|
|
panic("unreachable")
|
|
}
|
|
|
|
var (
|
|
ErrInvalidLengthApi = fmt.Errorf("proto: negative length found during unmarshaling")
|
|
ErrIntOverflowApi = fmt.Errorf("proto: integer overflow")
|
|
)
|
|
|
|
func init() {
|
|
proto.RegisterFile("app/admin/main/manager/api/api.proto", fileDescriptor_api_2329f30e789e58b5)
|
|
}
|
|
|
|
var fileDescriptor_api_2329f30e789e58b5 = []byte{
|
|
// 297 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x91, 0xcf, 0x4a, 0xc4, 0x30,
|
|
0x10, 0xc6, 0xc9, 0x96, 0x2d, 0xbb, 0x23, 0xa2, 0x06, 0x91, 0xa5, 0x48, 0x59, 0xab, 0x87, 0x05,
|
|
0x31, 0x05, 0x3d, 0xb9, 0x47, 0xc1, 0x9b, 0x07, 0x29, 0x78, 0xf1, 0x96, 0xda, 0x18, 0x03, 0x9b,
|
|
0x26, 0x26, 0xed, 0x61, 0x5f, 0xc8, 0x67, 0xf1, 0xe8, 0x23, 0x48, 0x9f, 0x44, 0x92, 0x46, 0x77,
|
|
0xfd, 0x83, 0x7b, 0x68, 0x99, 0x6f, 0xe6, 0xf7, 0xf5, 0x4b, 0x27, 0x70, 0x42, 0xb5, 0xce, 0x69,
|
|
0x25, 0x45, 0x9d, 0x4b, 0xea, 0x5f, 0x35, 0xe5, 0xcc, 0xe4, 0x54, 0x0b, 0xf7, 0x10, 0x6d, 0x54,
|
|
0xa3, 0x30, 0x76, 0x33, 0x12, 0x66, 0xc4, 0xe3, 0xc9, 0x19, 0x17, 0xcd, 0x53, 0x5b, 0x92, 0x07,
|
|
0x25, 0x73, 0xae, 0xb8, 0xca, 0x3d, 0x5a, 0xb6, 0x8f, 0x5e, 0x79, 0xe1, 0xab, 0xfe, 0x13, 0xd9,
|
|
0x1c, 0x46, 0x37, 0x8a, 0x8b, 0xba, 0x60, 0xcf, 0xf8, 0x00, 0x62, 0x59, 0x73, 0x2b, 0xaa, 0x09,
|
|
0x9a, 0xa2, 0xd9, 0xb8, 0x08, 0xca, 0xf5, 0x2b, 0x5b, 0xba, 0xfe, 0xa0, 0xef, 0xf7, 0x2a, 0x9b,
|
|
0x03, 0x04, 0xaf, 0x5e, 0x2c, 0xf1, 0x2e, 0x44, 0x2b, 0xab, 0x2b, 0x71, 0x02, 0xa3, 0xd6, 0x32,
|
|
0x53, 0x53, 0xc9, 0x82, 0xf3, 0x4b, 0x67, 0xa7, 0xb0, 0x7d, 0xcb, 0x8c, 0x14, 0xd6, 0x0a, 0xe5,
|
|
0xc3, 0xd7, 0x61, 0xf4, 0x03, 0xbe, 0x84, 0x9d, 0x75, 0x38, 0xa4, 0xb5, 0x21, 0x2d, 0x2a, 0x5c,
|
|
0x89, 0xf7, 0x61, 0xa8, 0x99, 0x91, 0x76, 0x32, 0x98, 0x46, 0xb3, 0x71, 0xd1, 0x8b, 0xf3, 0x17,
|
|
0x04, 0xb1, 0xf7, 0x36, 0xf8, 0x1a, 0x86, 0xfe, 0xb8, 0xf8, 0x90, 0xfc, 0xde, 0x1b, 0xf9, 0xdc,
|
|
0x42, 0x92, 0xfe, 0x33, 0x75, 0xc9, 0x77, 0xb0, 0xb5, 0x3a, 0x8c, 0xc5, 0x47, 0x7f, 0xe1, 0xdf,
|
|
0x7e, 0x2d, 0x39, 0xde, 0x84, 0xe8, 0xc5, 0xf2, 0x6a, 0xef, 0xb5, 0x4b, 0xd1, 0x5b, 0x97, 0xa2,
|
|
0xf7, 0x2e, 0x45, 0xf7, 0x11, 0xd5, 0xa2, 0x8c, 0xfd, 0x15, 0x5d, 0x7c, 0x04, 0x00, 0x00, 0xff,
|
|
0xff, 0xc2, 0xa5, 0xc9, 0x91, 0x0d, 0x02, 0x00, 0x00,
|
|
}
|