Versions in this module Expand all Collapse all v0 v0.0.7 May 18, 2023 Changes in this version type Permission + AllowAll bool + func (x *Permission) GetAllowAll() bool v0.0.6 May 16, 2023 Changes in this version + const AppName + const RPC_QueryRole_FullMethodName + var File_apps_role_pb_role_proto protoreflect.FileDescriptor + var RPC_ServiceDesc = grpc.ServiceDesc + func RegisterRPCServer(s grpc.ServiceRegistrar, srv RPCServer) + type CreateRoleRequest struct + Description string + Meta map[string]string + Name string + Permissions []*Permission + func NewCreateRoleRequest() *CreateRoleRequest + func (*CreateRoleRequest) Descriptor() ([]byte, []int) + func (*CreateRoleRequest) ProtoMessage() + func (req *CreateRoleRequest) Validate() error + func (x *CreateRoleRequest) GetDescription() string + func (x *CreateRoleRequest) GetMeta() map[string]string + func (x *CreateRoleRequest) GetName() string + func (x *CreateRoleRequest) GetPermissions() []*Permission + func (x *CreateRoleRequest) ProtoReflect() protoreflect.Message + func (x *CreateRoleRequest) Reset() + func (x *CreateRoleRequest) String() string + type Featrue struct + Action string + Resource string + func (*Featrue) Descriptor() ([]byte, []int) + func (*Featrue) ProtoMessage() + func (x *Featrue) GetAction() string + func (x *Featrue) GetResource() string + func (x *Featrue) ProtoReflect() protoreflect.Message + func (x *Featrue) Reset() + func (x *Featrue) String() string + type Permission struct + Featrues []*Featrue + Service string + func (*Permission) Descriptor() ([]byte, []int) + func (*Permission) ProtoMessage() + func (p *Permission) HasPermission(req *PermissionRequest) bool + func (x *Permission) GetFeatrues() []*Featrue + func (x *Permission) GetService() string + func (x *Permission) ProtoReflect() protoreflect.Message + func (x *Permission) Reset() + func (x *Permission) String() string + type PermissionRequest struct + Action string + Resource string + Service string + func NewPermissionRequest(service, resource, action string) *PermissionRequest + func (*PermissionRequest) Descriptor() ([]byte, []int) + func (*PermissionRequest) ProtoMessage() + func (x *PermissionRequest) GetAction() string + func (x *PermissionRequest) GetResource() string + func (x *PermissionRequest) GetService() string + func (x *PermissionRequest) ProtoReflect() protoreflect.Message + func (x *PermissionRequest) Reset() + func (x *PermissionRequest) String() string + type QueryRoleRequest struct + Page *request.PageRequest + RoleNames []string + func NewQueryRoleRequestWithName(names []string) *QueryRoleRequest + func (*QueryRoleRequest) Descriptor() ([]byte, []int) + func (*QueryRoleRequest) ProtoMessage() + func (x *QueryRoleRequest) GetPage() *request.PageRequest + func (x *QueryRoleRequest) GetRoleNames() []string + func (x *QueryRoleRequest) ProtoReflect() protoreflect.Message + func (x *QueryRoleRequest) Reset() + func (x *QueryRoleRequest) String() string + type RPCClient interface + QueryRole func(ctx context.Context, in *QueryRoleRequest, opts ...grpc.CallOption) (*RoleSet, error) + func NewRPCClient(cc grpc.ClientConnInterface) RPCClient + type RPCServer interface + QueryRole func(context.Context, *QueryRoleRequest) (*RoleSet, error) + type Role struct + CreateAt int64 + Id string + Spec *CreateRoleRequest + func NewDefaultRole() *Role + func NewRole(req *CreateRoleRequest) *Role + func (*Role) Descriptor() ([]byte, []int) + func (*Role) ProtoMessage() + func (r *Role) HasPermission(req *PermissionRequest) bool + func (x *Role) GetCreateAt() int64 + func (x *Role) GetId() string + func (x *Role) GetSpec() *CreateRoleRequest + func (x *Role) ProtoReflect() protoreflect.Message + func (x *Role) Reset() + func (x *Role) String() string + type RoleSet struct + Items []*Role + Total int64 + func NewRoleSet() *RoleSet + func (*RoleSet) Descriptor() ([]byte, []int) + func (*RoleSet) ProtoMessage() + func (s *RoleSet) Add(item *Role) + func (s *RoleSet) HasPermission(req *PermissionRequest) (bool, *Role) + func (x *RoleSet) GetItems() []*Role + func (x *RoleSet) GetTotal() int64 + func (x *RoleSet) ProtoReflect() protoreflect.Message + func (x *RoleSet) Reset() + func (x *RoleSet) String() string + type Service interface + CreateRole func(context.Context, *CreateRoleRequest) (*Role, error) + type UnimplementedRPCServer struct + func (UnimplementedRPCServer) QueryRole(context.Context, *QueryRoleRequest) (*RoleSet, error) + type UnsafeRPCServer interface