You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1712 lines
44 KiB
1712 lines
44 KiB
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
|
// source: api/v1/permission.proto
|
|
|
|
package v1
|
|
|
|
import (
|
|
context "context"
|
|
fmt "fmt"
|
|
_ "github.com/gogo/protobuf/gogoproto"
|
|
proto "github.com/gogo/protobuf/proto"
|
|
github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
|
|
_ "google.golang.org/genproto/googleapis/api/annotations"
|
|
grpc "google.golang.org/grpc"
|
|
codes "google.golang.org/grpc/codes"
|
|
status "google.golang.org/grpc/status"
|
|
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
|
_ "google.golang.org/protobuf/types/known/timestamppb"
|
|
io "io"
|
|
math "math"
|
|
math_bits "math/bits"
|
|
time "time"
|
|
)
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ = proto.Marshal
|
|
var _ = fmt.Errorf
|
|
var _ = math.Inf
|
|
var _ = time.Kitchen
|
|
|
|
// 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.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
|
|
|
// 权限
|
|
type Permission struct {
|
|
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
|
Method string `protobuf:"bytes,2,opt,name=method,proto3" json:"method,omitempty"`
|
|
Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"`
|
|
Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"`
|
|
Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"`
|
|
CreatedAt *time.Time `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at,omitempty"`
|
|
UpdatedAt *time.Time `protobuf:"bytes,7,opt,name=updated_at,json=updatedAt,proto3,stdtime" json:"updated_at,omitempty"`
|
|
}
|
|
|
|
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_6f5311b1c95edab2, []int{0}
|
|
}
|
|
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
|
|
|
|
func (m *Permission) GetId() int64 {
|
|
if m != nil {
|
|
return m.Id
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (m *Permission) GetMethod() string {
|
|
if m != nil {
|
|
return m.Method
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Permission) GetPath() string {
|
|
if m != nil {
|
|
return m.Path
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Permission) GetTitle() string {
|
|
if m != nil {
|
|
return m.Title
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Permission) GetDescription() string {
|
|
if m != nil {
|
|
return m.Description
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Permission) GetCreatedAt() *time.Time {
|
|
if m != nil {
|
|
return m.CreatedAt
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Permission) GetUpdatedAt() *time.Time {
|
|
if m != nil {
|
|
return m.UpdatedAt
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// 权限请求
|
|
type GetPermissionRequest struct {
|
|
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
|
}
|
|
|
|
func (m *GetPermissionRequest) Reset() { *m = GetPermissionRequest{} }
|
|
func (m *GetPermissionRequest) String() string { return proto.CompactTextString(m) }
|
|
func (*GetPermissionRequest) ProtoMessage() {}
|
|
func (*GetPermissionRequest) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_6f5311b1c95edab2, []int{1}
|
|
}
|
|
func (m *GetPermissionRequest) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *GetPermissionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_GetPermissionRequest.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 *GetPermissionRequest) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_GetPermissionRequest.Merge(m, src)
|
|
}
|
|
func (m *GetPermissionRequest) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *GetPermissionRequest) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_GetPermissionRequest.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_GetPermissionRequest proto.InternalMessageInfo
|
|
|
|
func (m *GetPermissionRequest) GetId() int64 {
|
|
if m != nil {
|
|
return m.Id
|
|
}
|
|
return 0
|
|
}
|
|
|
|
// 权限响应
|
|
type GetPermissionReply struct {
|
|
Permission *Permission `protobuf:"bytes,1,opt,name=permission,proto3" json:"permission,omitempty"`
|
|
}
|
|
|
|
func (m *GetPermissionReply) Reset() { *m = GetPermissionReply{} }
|
|
func (m *GetPermissionReply) String() string { return proto.CompactTextString(m) }
|
|
func (*GetPermissionReply) ProtoMessage() {}
|
|
func (*GetPermissionReply) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_6f5311b1c95edab2, []int{2}
|
|
}
|
|
func (m *GetPermissionReply) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *GetPermissionReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_GetPermissionReply.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 *GetPermissionReply) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_GetPermissionReply.Merge(m, src)
|
|
}
|
|
func (m *GetPermissionReply) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *GetPermissionReply) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_GetPermissionReply.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_GetPermissionReply proto.InternalMessageInfo
|
|
|
|
func (m *GetPermissionReply) GetPermission() *Permission {
|
|
if m != nil {
|
|
return m.Permission
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// 权限列表请求
|
|
type ListPermissionRequest struct {
|
|
Page int64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`
|
|
Size_ int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"`
|
|
Wd string `protobuf:"bytes,3,opt,name=wd,proto3" json:"wd,omitempty"`
|
|
Method []string `protobuf:"bytes,4,rep,name=method,proto3" json:"method,omitempty"`
|
|
Path string `protobuf:"bytes,5,opt,name=path,proto3" json:"path,omitempty"`
|
|
}
|
|
|
|
func (m *ListPermissionRequest) Reset() { *m = ListPermissionRequest{} }
|
|
func (m *ListPermissionRequest) String() string { return proto.CompactTextString(m) }
|
|
func (*ListPermissionRequest) ProtoMessage() {}
|
|
func (*ListPermissionRequest) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_6f5311b1c95edab2, []int{3}
|
|
}
|
|
func (m *ListPermissionRequest) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *ListPermissionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_ListPermissionRequest.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 *ListPermissionRequest) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_ListPermissionRequest.Merge(m, src)
|
|
}
|
|
func (m *ListPermissionRequest) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *ListPermissionRequest) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_ListPermissionRequest.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_ListPermissionRequest proto.InternalMessageInfo
|
|
|
|
func (m *ListPermissionRequest) GetPage() int64 {
|
|
if m != nil {
|
|
return m.Page
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (m *ListPermissionRequest) GetSize_() int64 {
|
|
if m != nil {
|
|
return m.Size_
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (m *ListPermissionRequest) GetWd() string {
|
|
if m != nil {
|
|
return m.Wd
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *ListPermissionRequest) GetMethod() []string {
|
|
if m != nil {
|
|
return m.Method
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *ListPermissionRequest) GetPath() string {
|
|
if m != nil {
|
|
return m.Path
|
|
}
|
|
return ""
|
|
}
|
|
|
|
// 权限列表响应
|
|
type ListPermissionReply struct {
|
|
Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
|
|
Permission []*Permission `protobuf:"bytes,2,rep,name=permission,proto3" json:"permission,omitempty"`
|
|
}
|
|
|
|
func (m *ListPermissionReply) Reset() { *m = ListPermissionReply{} }
|
|
func (m *ListPermissionReply) String() string { return proto.CompactTextString(m) }
|
|
func (*ListPermissionReply) ProtoMessage() {}
|
|
func (*ListPermissionReply) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_6f5311b1c95edab2, []int{4}
|
|
}
|
|
func (m *ListPermissionReply) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *ListPermissionReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_ListPermissionReply.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 *ListPermissionReply) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_ListPermissionReply.Merge(m, src)
|
|
}
|
|
func (m *ListPermissionReply) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *ListPermissionReply) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_ListPermissionReply.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_ListPermissionReply proto.InternalMessageInfo
|
|
|
|
func (m *ListPermissionReply) GetTotal() int64 {
|
|
if m != nil {
|
|
return m.Total
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (m *ListPermissionReply) GetPermission() []*Permission {
|
|
if m != nil {
|
|
return m.Permission
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterType((*Permission)(nil), "api.v1.Permission")
|
|
proto.RegisterType((*GetPermissionRequest)(nil), "api.v1.GetPermissionRequest")
|
|
proto.RegisterType((*GetPermissionReply)(nil), "api.v1.GetPermissionReply")
|
|
proto.RegisterType((*ListPermissionRequest)(nil), "api.v1.ListPermissionRequest")
|
|
proto.RegisterType((*ListPermissionReply)(nil), "api.v1.ListPermissionReply")
|
|
}
|
|
|
|
func init() { proto.RegisterFile("api/v1/permission.proto", fileDescriptor_6f5311b1c95edab2) }
|
|
|
|
var fileDescriptor_6f5311b1c95edab2 = []byte{
|
|
// 534 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xcd, 0x6e, 0xd3, 0x40,
|
|
0x10, 0xce, 0x3a, 0x3f, 0xa8, 0x13, 0xb5, 0x82, 0x25, 0x34, 0xc6, 0x6d, 0x1d, 0xcb, 0x07, 0x14,
|
|
0x71, 0xb0, 0x95, 0x20, 0x2e, 0x70, 0x40, 0xa9, 0x84, 0x00, 0x89, 0x43, 0x14, 0xc1, 0x05, 0xa9,
|
|
0xaa, 0xdc, 0x78, 0x71, 0x57, 0xb2, 0xb3, 0x8b, 0xbd, 0x49, 0x15, 0xb8, 0xf5, 0x09, 0x2a, 0xf1,
|
|
0x3a, 0x3c, 0x00, 0xc7, 0x4a, 0x5c, 0xb8, 0x81, 0x12, 0x1e, 0x04, 0x79, 0xbd, 0x26, 0xae, 0x63,
|
|
0x04, 0xb7, 0xd9, 0x99, 0xd9, 0xef, 0x9b, 0xf9, 0xbe, 0xb5, 0xa1, 0xeb, 0x71, 0xea, 0x2e, 0x06,
|
|
0x2e, 0x27, 0x71, 0x44, 0x93, 0x84, 0xb2, 0x99, 0xc3, 0x63, 0x26, 0x18, 0x6e, 0x79, 0x9c, 0x3a,
|
|
0x8b, 0x81, 0xd1, 0x0b, 0x18, 0x0b, 0x42, 0xe2, 0xca, 0xec, 0xd9, 0xfc, 0xbd, 0x2b, 0x68, 0x44,
|
|
0x12, 0xe1, 0x45, 0x3c, 0x6b, 0x34, 0x3a, 0x01, 0x0b, 0x98, 0x0c, 0xdd, 0x34, 0x52, 0xd9, 0x43,
|
|
0x75, 0x2d, 0x85, 0xf7, 0x66, 0x33, 0x26, 0x3c, 0x41, 0xd9, 0x2c, 0x51, 0xd5, 0x83, 0x32, 0x28,
|
|
0x89, 0xb8, 0x58, 0x66, 0x45, 0xfb, 0x52, 0x03, 0x18, 0xff, 0x19, 0x07, 0xef, 0x81, 0x46, 0x7d,
|
|
0x1d, 0x59, 0xa8, 0x5f, 0x9f, 0x68, 0xd4, 0xc7, 0xfb, 0xd0, 0x8a, 0x88, 0x38, 0x67, 0xbe, 0xae,
|
|
0x59, 0xa8, 0xbf, 0x33, 0x51, 0x27, 0x8c, 0xa1, 0xc1, 0x3d, 0x71, 0xae, 0xd7, 0x65, 0x56, 0xc6,
|
|
0xb8, 0x03, 0x4d, 0x41, 0x45, 0x48, 0xf4, 0x86, 0x4c, 0x66, 0x07, 0x6c, 0x41, 0xdb, 0x27, 0xc9,
|
|
0x34, 0xa6, 0x3c, 0x9d, 0x49, 0x6f, 0xca, 0x5a, 0x31, 0x85, 0x9f, 0x01, 0x4c, 0x63, 0xe2, 0x09,
|
|
0xe2, 0x9f, 0x7a, 0x42, 0x6f, 0x59, 0xa8, 0xdf, 0x1e, 0x1a, 0x4e, 0x36, 0xb4, 0x93, 0x0f, 0xed,
|
|
0xbc, 0xc9, 0x95, 0x38, 0x6e, 0x5c, 0xfd, 0xe8, 0xa1, 0xc9, 0x8e, 0xba, 0x33, 0x12, 0x29, 0xc0,
|
|
0x9c, 0xfb, 0x39, 0xc0, 0xad, 0xff, 0x05, 0x50, 0x77, 0x46, 0xc2, 0x7e, 0x00, 0x9d, 0x17, 0x44,
|
|
0x6c, 0x64, 0x98, 0x90, 0x0f, 0x73, 0x92, 0x88, 0xb2, 0x1a, 0xf6, 0x4b, 0xc0, 0xa5, 0x3e, 0x1e,
|
|
0x2e, 0xf1, 0x10, 0x60, 0x63, 0xa8, 0xec, 0x6e, 0x0f, 0xb1, 0x93, 0x39, 0xea, 0x14, 0x9a, 0x0b,
|
|
0x5d, 0xf6, 0x27, 0xb8, 0xf7, 0x9a, 0x26, 0x15, 0x94, 0x52, 0xd8, 0x80, 0x28, 0x52, 0x19, 0xa7,
|
|
0xb9, 0x84, 0x7e, 0x24, 0xd2, 0x82, 0xfa, 0x44, 0xc6, 0xe9, 0x68, 0x17, 0xbe, 0x92, 0x5f, 0xbb,
|
|
0x28, 0x1a, 0xd5, 0xb0, 0xea, 0x15, 0x46, 0x35, 0x37, 0x46, 0xd9, 0xa7, 0x70, 0xb7, 0x4c, 0x9e,
|
|
0xee, 0x91, 0xfa, 0xc7, 0x84, 0x17, 0x2a, 0xee, 0xec, 0x50, 0xda, 0x4e, 0xb3, 0xea, 0xff, 0xde,
|
|
0x6e, 0xf8, 0x45, 0x83, 0xdd, 0x4d, 0x69, 0x34, 0x7e, 0x85, 0x4f, 0xe0, 0xf6, 0x5b, 0x29, 0x77,
|
|
0xe1, 0xad, 0x55, 0xa0, 0x18, 0xfb, 0x5b, 0xb6, 0x3d, 0x4f, 0x1f, 0xab, 0x7d, 0x74, 0xf9, 0xed,
|
|
0xd7, 0x67, 0xad, 0x6b, 0x60, 0x77, 0xeb, 0x13, 0x7a, 0x82, 0x1e, 0xe2, 0x13, 0xd8, 0xbd, 0x61,
|
|
0x0c, 0x3e, 0xcc, 0xb1, 0xab, 0x7c, 0x35, 0x2a, 0x98, 0x6d, 0x43, 0x32, 0x74, 0x70, 0x05, 0x03,
|
|
0x8e, 0x60, 0xef, 0xa6, 0x60, 0xf8, 0x28, 0x47, 0xa8, 0x74, 0xd1, 0x38, 0xf8, 0x5b, 0x99, 0x87,
|
|
0x4b, 0xbb, 0x27, 0x99, 0xee, 0xe3, 0xee, 0x36, 0x93, 0x1b, 0xd2, 0x44, 0x1c, 0x3f, 0xfe, 0xba,
|
|
0x32, 0xd1, 0xf5, 0xca, 0x44, 0x3f, 0x57, 0x26, 0xba, 0x5a, 0x9b, 0xb5, 0xeb, 0xb5, 0x59, 0xfb,
|
|
0xbe, 0x36, 0x6b, 0xa0, 0xfe, 0x13, 0x63, 0xf4, 0xee, 0x4e, 0xc4, 0x62, 0xe2, 0xb3, 0xa9, 0xc2,
|
|
0x78, 0xba, 0x18, 0x9c, 0xb5, 0xa4, 0x66, 0x8f, 0x7e, 0x07, 0x00, 0x00, 0xff, 0xff, 0x20, 0x3d,
|
|
0xbf, 0x9e, 0x66, 0x04, 0x00, 0x00,
|
|
}
|
|
|
|
// 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
|
|
|
|
// PermissionAPIClient is the client API for PermissionAPI service.
|
|
//
|
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
|
type PermissionAPIClient interface {
|
|
// 更新权限信息。这里只能操作title和description
|
|
UpdatePermission(ctx context.Context, in *Permission, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
|
// 查询权限信息
|
|
GetPermission(ctx context.Context, in *GetPermissionRequest, opts ...grpc.CallOption) (*Permission, error)
|
|
// 查询权限列表
|
|
ListPermission(ctx context.Context, in *ListPermissionRequest, opts ...grpc.CallOption) (*ListPermissionReply, error)
|
|
}
|
|
|
|
type permissionAPIClient struct {
|
|
cc *grpc.ClientConn
|
|
}
|
|
|
|
func NewPermissionAPIClient(cc *grpc.ClientConn) PermissionAPIClient {
|
|
return &permissionAPIClient{cc}
|
|
}
|
|
|
|
func (c *permissionAPIClient) UpdatePermission(ctx context.Context, in *Permission, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
|
out := new(emptypb.Empty)
|
|
err := c.cc.Invoke(ctx, "/api.v1.PermissionAPI/UpdatePermission", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *permissionAPIClient) GetPermission(ctx context.Context, in *GetPermissionRequest, opts ...grpc.CallOption) (*Permission, error) {
|
|
out := new(Permission)
|
|
err := c.cc.Invoke(ctx, "/api.v1.PermissionAPI/GetPermission", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *permissionAPIClient) ListPermission(ctx context.Context, in *ListPermissionRequest, opts ...grpc.CallOption) (*ListPermissionReply, error) {
|
|
out := new(ListPermissionReply)
|
|
err := c.cc.Invoke(ctx, "/api.v1.PermissionAPI/ListPermission", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// PermissionAPIServer is the server API for PermissionAPI service.
|
|
type PermissionAPIServer interface {
|
|
// 更新权限信息。这里只能操作title和description
|
|
UpdatePermission(context.Context, *Permission) (*emptypb.Empty, error)
|
|
// 查询权限信息
|
|
GetPermission(context.Context, *GetPermissionRequest) (*Permission, error)
|
|
// 查询权限列表
|
|
ListPermission(context.Context, *ListPermissionRequest) (*ListPermissionReply, error)
|
|
}
|
|
|
|
// UnimplementedPermissionAPIServer can be embedded to have forward compatible implementations.
|
|
type UnimplementedPermissionAPIServer struct {
|
|
}
|
|
|
|
func (*UnimplementedPermissionAPIServer) UpdatePermission(ctx context.Context, req *Permission) (*emptypb.Empty, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method UpdatePermission not implemented")
|
|
}
|
|
func (*UnimplementedPermissionAPIServer) GetPermission(ctx context.Context, req *GetPermissionRequest) (*Permission, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetPermission not implemented")
|
|
}
|
|
func (*UnimplementedPermissionAPIServer) ListPermission(ctx context.Context, req *ListPermissionRequest) (*ListPermissionReply, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method ListPermission not implemented")
|
|
}
|
|
|
|
func RegisterPermissionAPIServer(s *grpc.Server, srv PermissionAPIServer) {
|
|
s.RegisterService(&_PermissionAPI_serviceDesc, srv)
|
|
}
|
|
|
|
func _PermissionAPI_UpdatePermission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(Permission)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(PermissionAPIServer).UpdatePermission(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/api.v1.PermissionAPI/UpdatePermission",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(PermissionAPIServer).UpdatePermission(ctx, req.(*Permission))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _PermissionAPI_GetPermission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(GetPermissionRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(PermissionAPIServer).GetPermission(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/api.v1.PermissionAPI/GetPermission",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(PermissionAPIServer).GetPermission(ctx, req.(*GetPermissionRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _PermissionAPI_ListPermission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ListPermissionRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(PermissionAPIServer).ListPermission(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/api.v1.PermissionAPI/ListPermission",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(PermissionAPIServer).ListPermission(ctx, req.(*ListPermissionRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
var _PermissionAPI_serviceDesc = grpc.ServiceDesc{
|
|
ServiceName: "api.v1.PermissionAPI",
|
|
HandlerType: (*PermissionAPIServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "UpdatePermission",
|
|
Handler: _PermissionAPI_UpdatePermission_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetPermission",
|
|
Handler: _PermissionAPI_GetPermission_Handler,
|
|
},
|
|
{
|
|
MethodName: "ListPermission",
|
|
Handler: _PermissionAPI_ListPermission_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "api/v1/permission.proto",
|
|
}
|
|
|
|
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.UpdatedAt != nil {
|
|
n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.UpdatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.UpdatedAt):])
|
|
if err1 != nil {
|
|
return 0, err1
|
|
}
|
|
i -= n1
|
|
i = encodeVarintPermission(dAtA, i, uint64(n1))
|
|
i--
|
|
dAtA[i] = 0x3a
|
|
}
|
|
if m.CreatedAt != nil {
|
|
n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.CreatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.CreatedAt):])
|
|
if err2 != nil {
|
|
return 0, err2
|
|
}
|
|
i -= n2
|
|
i = encodeVarintPermission(dAtA, i, uint64(n2))
|
|
i--
|
|
dAtA[i] = 0x32
|
|
}
|
|
if len(m.Description) > 0 {
|
|
i -= len(m.Description)
|
|
copy(dAtA[i:], m.Description)
|
|
i = encodeVarintPermission(dAtA, i, uint64(len(m.Description)))
|
|
i--
|
|
dAtA[i] = 0x2a
|
|
}
|
|
if len(m.Title) > 0 {
|
|
i -= len(m.Title)
|
|
copy(dAtA[i:], m.Title)
|
|
i = encodeVarintPermission(dAtA, i, uint64(len(m.Title)))
|
|
i--
|
|
dAtA[i] = 0x22
|
|
}
|
|
if len(m.Path) > 0 {
|
|
i -= len(m.Path)
|
|
copy(dAtA[i:], m.Path)
|
|
i = encodeVarintPermission(dAtA, i, uint64(len(m.Path)))
|
|
i--
|
|
dAtA[i] = 0x1a
|
|
}
|
|
if len(m.Method) > 0 {
|
|
i -= len(m.Method)
|
|
copy(dAtA[i:], m.Method)
|
|
i = encodeVarintPermission(dAtA, i, uint64(len(m.Method)))
|
|
i--
|
|
dAtA[i] = 0x12
|
|
}
|
|
if m.Id != 0 {
|
|
i = encodeVarintPermission(dAtA, i, uint64(m.Id))
|
|
i--
|
|
dAtA[i] = 0x8
|
|
}
|
|
return len(dAtA) - i, nil
|
|
}
|
|
|
|
func (m *GetPermissionRequest) 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 *GetPermissionRequest) MarshalTo(dAtA []byte) (int, error) {
|
|
size := m.Size()
|
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
}
|
|
|
|
func (m *GetPermissionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
i := len(dAtA)
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if m.Id != 0 {
|
|
i = encodeVarintPermission(dAtA, i, uint64(m.Id))
|
|
i--
|
|
dAtA[i] = 0x8
|
|
}
|
|
return len(dAtA) - i, nil
|
|
}
|
|
|
|
func (m *GetPermissionReply) 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 *GetPermissionReply) MarshalTo(dAtA []byte) (int, error) {
|
|
size := m.Size()
|
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
}
|
|
|
|
func (m *GetPermissionReply) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
i := len(dAtA)
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if m.Permission != nil {
|
|
{
|
|
size, err := m.Permission.MarshalToSizedBuffer(dAtA[:i])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i -= size
|
|
i = encodeVarintPermission(dAtA, i, uint64(size))
|
|
}
|
|
i--
|
|
dAtA[i] = 0xa
|
|
}
|
|
return len(dAtA) - i, nil
|
|
}
|
|
|
|
func (m *ListPermissionRequest) 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 *ListPermissionRequest) MarshalTo(dAtA []byte) (int, error) {
|
|
size := m.Size()
|
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
}
|
|
|
|
func (m *ListPermissionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
i := len(dAtA)
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if len(m.Path) > 0 {
|
|
i -= len(m.Path)
|
|
copy(dAtA[i:], m.Path)
|
|
i = encodeVarintPermission(dAtA, i, uint64(len(m.Path)))
|
|
i--
|
|
dAtA[i] = 0x2a
|
|
}
|
|
if len(m.Method) > 0 {
|
|
for iNdEx := len(m.Method) - 1; iNdEx >= 0; iNdEx-- {
|
|
i -= len(m.Method[iNdEx])
|
|
copy(dAtA[i:], m.Method[iNdEx])
|
|
i = encodeVarintPermission(dAtA, i, uint64(len(m.Method[iNdEx])))
|
|
i--
|
|
dAtA[i] = 0x22
|
|
}
|
|
}
|
|
if len(m.Wd) > 0 {
|
|
i -= len(m.Wd)
|
|
copy(dAtA[i:], m.Wd)
|
|
i = encodeVarintPermission(dAtA, i, uint64(len(m.Wd)))
|
|
i--
|
|
dAtA[i] = 0x1a
|
|
}
|
|
if m.Size_ != 0 {
|
|
i = encodeVarintPermission(dAtA, i, uint64(m.Size_))
|
|
i--
|
|
dAtA[i] = 0x10
|
|
}
|
|
if m.Page != 0 {
|
|
i = encodeVarintPermission(dAtA, i, uint64(m.Page))
|
|
i--
|
|
dAtA[i] = 0x8
|
|
}
|
|
return len(dAtA) - i, nil
|
|
}
|
|
|
|
func (m *ListPermissionReply) 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 *ListPermissionReply) MarshalTo(dAtA []byte) (int, error) {
|
|
size := m.Size()
|
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
}
|
|
|
|
func (m *ListPermissionReply) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
i := len(dAtA)
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if len(m.Permission) > 0 {
|
|
for iNdEx := len(m.Permission) - 1; iNdEx >= 0; iNdEx-- {
|
|
{
|
|
size, err := m.Permission[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i -= size
|
|
i = encodeVarintPermission(dAtA, i, uint64(size))
|
|
}
|
|
i--
|
|
dAtA[i] = 0x12
|
|
}
|
|
}
|
|
if m.Total != 0 {
|
|
i = encodeVarintPermission(dAtA, i, uint64(m.Total))
|
|
i--
|
|
dAtA[i] = 0x8
|
|
}
|
|
return len(dAtA) - i, nil
|
|
}
|
|
|
|
func encodeVarintPermission(dAtA []byte, offset int, v uint64) int {
|
|
offset -= sovPermission(v)
|
|
base := offset
|
|
for v >= 1<<7 {
|
|
dAtA[offset] = uint8(v&0x7f | 0x80)
|
|
v >>= 7
|
|
offset++
|
|
}
|
|
dAtA[offset] = uint8(v)
|
|
return base
|
|
}
|
|
func (m *Permission) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
if m.Id != 0 {
|
|
n += 1 + sovPermission(uint64(m.Id))
|
|
}
|
|
l = len(m.Method)
|
|
if l > 0 {
|
|
n += 1 + l + sovPermission(uint64(l))
|
|
}
|
|
l = len(m.Path)
|
|
if l > 0 {
|
|
n += 1 + l + sovPermission(uint64(l))
|
|
}
|
|
l = len(m.Title)
|
|
if l > 0 {
|
|
n += 1 + l + sovPermission(uint64(l))
|
|
}
|
|
l = len(m.Description)
|
|
if l > 0 {
|
|
n += 1 + l + sovPermission(uint64(l))
|
|
}
|
|
if m.CreatedAt != nil {
|
|
l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.CreatedAt)
|
|
n += 1 + l + sovPermission(uint64(l))
|
|
}
|
|
if m.UpdatedAt != nil {
|
|
l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.UpdatedAt)
|
|
n += 1 + l + sovPermission(uint64(l))
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *GetPermissionRequest) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
if m.Id != 0 {
|
|
n += 1 + sovPermission(uint64(m.Id))
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *GetPermissionReply) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
if m.Permission != nil {
|
|
l = m.Permission.Size()
|
|
n += 1 + l + sovPermission(uint64(l))
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *ListPermissionRequest) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
if m.Page != 0 {
|
|
n += 1 + sovPermission(uint64(m.Page))
|
|
}
|
|
if m.Size_ != 0 {
|
|
n += 1 + sovPermission(uint64(m.Size_))
|
|
}
|
|
l = len(m.Wd)
|
|
if l > 0 {
|
|
n += 1 + l + sovPermission(uint64(l))
|
|
}
|
|
if len(m.Method) > 0 {
|
|
for _, s := range m.Method {
|
|
l = len(s)
|
|
n += 1 + l + sovPermission(uint64(l))
|
|
}
|
|
}
|
|
l = len(m.Path)
|
|
if l > 0 {
|
|
n += 1 + l + sovPermission(uint64(l))
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *ListPermissionReply) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
if m.Total != 0 {
|
|
n += 1 + sovPermission(uint64(m.Total))
|
|
}
|
|
if len(m.Permission) > 0 {
|
|
for _, e := range m.Permission {
|
|
l = e.Size()
|
|
n += 1 + l + sovPermission(uint64(l))
|
|
}
|
|
}
|
|
return n
|
|
}
|
|
|
|
func sovPermission(x uint64) (n int) {
|
|
return (math_bits.Len64(x|1) + 6) / 7
|
|
}
|
|
func sozPermission(x uint64) (n int) {
|
|
return sovPermission(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
|
}
|
|
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 ErrIntOverflowPermission
|
|
}
|
|
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 Id", wireType)
|
|
}
|
|
m.Id = 0
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowPermission
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
m.Id |= int64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
case 2:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Method", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowPermission
|
|
}
|
|
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 ErrInvalidLengthPermission
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthPermission
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Method = string(dAtA[iNdEx:postIndex])
|
|
iNdEx = postIndex
|
|
case 3:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowPermission
|
|
}
|
|
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 ErrInvalidLengthPermission
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthPermission
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Path = string(dAtA[iNdEx:postIndex])
|
|
iNdEx = postIndex
|
|
case 4:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowPermission
|
|
}
|
|
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 ErrInvalidLengthPermission
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthPermission
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Title = string(dAtA[iNdEx:postIndex])
|
|
iNdEx = postIndex
|
|
case 5:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowPermission
|
|
}
|
|
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 ErrInvalidLengthPermission
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthPermission
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Description = string(dAtA[iNdEx:postIndex])
|
|
iNdEx = postIndex
|
|
case 6:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowPermission
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthPermission
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthPermission
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
if m.CreatedAt == nil {
|
|
m.CreatedAt = new(time.Time)
|
|
}
|
|
if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.CreatedAt, dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
case 7:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field UpdatedAt", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowPermission
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthPermission
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthPermission
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
if m.UpdatedAt == nil {
|
|
m.UpdatedAt = new(time.Time)
|
|
}
|
|
if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.UpdatedAt, dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipPermission(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
return ErrInvalidLengthPermission
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *GetPermissionRequest) 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 ErrIntOverflowPermission
|
|
}
|
|
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: GetPermissionRequest: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: GetPermissionRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 0 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
|
|
}
|
|
m.Id = 0
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowPermission
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
m.Id |= int64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipPermission(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
return ErrInvalidLengthPermission
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *GetPermissionReply) 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 ErrIntOverflowPermission
|
|
}
|
|
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: GetPermissionReply: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: GetPermissionReply: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Permission", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowPermission
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthPermission
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthPermission
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
if m.Permission == nil {
|
|
m.Permission = &Permission{}
|
|
}
|
|
if err := m.Permission.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipPermission(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
return ErrInvalidLengthPermission
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *ListPermissionRequest) 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 ErrIntOverflowPermission
|
|
}
|
|
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: ListPermissionRequest: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: ListPermissionRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 0 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Page", wireType)
|
|
}
|
|
m.Page = 0
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowPermission
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
m.Page |= int64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
case 2:
|
|
if wireType != 0 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Size_", wireType)
|
|
}
|
|
m.Size_ = 0
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowPermission
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
m.Size_ |= int64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
case 3:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Wd", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowPermission
|
|
}
|
|
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 ErrInvalidLengthPermission
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthPermission
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Wd = string(dAtA[iNdEx:postIndex])
|
|
iNdEx = postIndex
|
|
case 4:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Method", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowPermission
|
|
}
|
|
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 ErrInvalidLengthPermission
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthPermission
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Method = append(m.Method, string(dAtA[iNdEx:postIndex]))
|
|
iNdEx = postIndex
|
|
case 5:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowPermission
|
|
}
|
|
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 ErrInvalidLengthPermission
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthPermission
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Path = string(dAtA[iNdEx:postIndex])
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipPermission(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
return ErrInvalidLengthPermission
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *ListPermissionReply) 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 ErrIntOverflowPermission
|
|
}
|
|
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: ListPermissionReply: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: ListPermissionReply: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 0 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType)
|
|
}
|
|
m.Total = 0
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowPermission
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
m.Total |= int64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
case 2:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Permission", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowPermission
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthPermission
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthPermission
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Permission = append(m.Permission, &Permission{})
|
|
if err := m.Permission[len(m.Permission)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipPermission(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
return ErrInvalidLengthPermission
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func skipPermission(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, ErrIntOverflowPermission
|
|
}
|
|
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, ErrIntOverflowPermission
|
|
}
|
|
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, ErrIntOverflowPermission
|
|
}
|
|
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, ErrInvalidLengthPermission
|
|
}
|
|
iNdEx += length
|
|
case 3:
|
|
depth++
|
|
case 4:
|
|
if depth == 0 {
|
|
return 0, ErrUnexpectedEndOfGroupPermission
|
|
}
|
|
depth--
|
|
case 5:
|
|
iNdEx += 4
|
|
default:
|
|
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
|
}
|
|
if iNdEx < 0 {
|
|
return 0, ErrInvalidLengthPermission
|
|
}
|
|
if depth == 0 {
|
|
return iNdEx, nil
|
|
}
|
|
}
|
|
return 0, io.ErrUnexpectedEOF
|
|
}
|
|
|
|
var (
|
|
ErrInvalidLengthPermission = fmt.Errorf("proto: negative length found during unmarshaling")
|
|
ErrIntOverflowPermission = fmt.Errorf("proto: integer overflow")
|
|
ErrUnexpectedEndOfGroupPermission = fmt.Errorf("proto: unexpected end of group")
|
|
)
|