Documentation ¶
Overview ¶
Package proto is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Package proto is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterCasbinAdapterHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterCasbinAdapterHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CasbinAdapterClient) error
- func RegisterCasbinAdapterHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterCasbinAdapterHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CasbinAdapterServer) error
- func RegisterCasbinAdapterServer(s *grpc.Server, srv CasbinAdapterServer)
- func RegisterPermissionHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterPermissionHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PermissionClient) error
- func RegisterPermissionHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterPermissionHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PermissionServer) error
- func RegisterPermissionServer(s *grpc.Server, srv PermissionServer)
- func RegisterResourceServer(s *grpc.Server, srv ResourceServer)
- func SetResourceAuth(ctx context.Context, resourceID, resourceSecret string) context.Context
- func StreamServerInterceptor(f GrpcContextHandler) grpc.StreamServerInterceptor
- func UnaryServerInterceptor(f GrpcContextHandler) grpc.UnaryServerInterceptor
- type CasbinAdapterClient
- type CasbinAdapterServer
- type GrpcContextHandler
- type ListActionByRolesRequest
- func (*ListActionByRolesRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ListActionByRolesRequest) GetRoles() []string
- func (*ListActionByRolesRequest) ProtoMessage()
- func (x *ListActionByRolesRequest) ProtoReflect() protoreflect.Message
- func (x *ListActionByRolesRequest) Reset()
- func (x *ListActionByRolesRequest) String() string
- type ListActionByRolesResponse
- func (*ListActionByRolesResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListActionByRolesResponse) GetActions() []*ResourceAction
- func (*ListActionByRolesResponse) ProtoMessage()
- func (x *ListActionByRolesResponse) ProtoReflect() protoreflect.Message
- func (x *ListActionByRolesResponse) Reset()
- func (x *ListActionByRolesResponse) String() string
- type ListMenuByRolesRequest
- func (*ListMenuByRolesRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ListMenuByRolesRequest) GetRoles() []string
- func (*ListMenuByRolesRequest) ProtoMessage()
- func (x *ListMenuByRolesRequest) ProtoReflect() protoreflect.Message
- func (x *ListMenuByRolesRequest) Reset()
- func (x *ListMenuByRolesRequest) String() string
- type ListMenuByRolesResponse
- func (*ListMenuByRolesResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListMenuByRolesResponse) GetMenus() []*ResourceMenu
- func (*ListMenuByRolesResponse) ProtoMessage()
- func (x *ListMenuByRolesResponse) ProtoReflect() protoreflect.Message
- func (x *ListMenuByRolesResponse) Reset()
- func (x *ListMenuByRolesResponse) String() string
- type LoadPolicyRequest
- type LoadPolicyResponse
- func (*LoadPolicyResponse) Descriptor() ([]byte, []int)deprecated
- func (x *LoadPolicyResponse) GetPolicys() []string
- func (*LoadPolicyResponse) ProtoMessage()
- func (x *LoadPolicyResponse) ProtoReflect() protoreflect.Message
- func (x *LoadPolicyResponse) Reset()
- func (x *LoadPolicyResponse) String() string
- type PermissionClient
- type PermissionServer
- type ResourceAction
- func (*ResourceAction) Descriptor() ([]byte, []int)deprecated
- func (x *ResourceAction) GetDescription() string
- func (x *ResourceAction) GetGroup() string
- func (x *ResourceAction) GetId() uint64
- func (x *ResourceAction) GetName() string
- func (*ResourceAction) ProtoMessage()
- func (x *ResourceAction) ProtoReflect() protoreflect.Message
- func (x *ResourceAction) Reset()
- func (x *ResourceAction) String() string
- type ResourceClient
- type ResourceMenu
- func (*ResourceMenu) Descriptor() ([]byte, []int)deprecated
- func (x *ResourceMenu) GetIcon() string
- func (x *ResourceMenu) GetId() uint64
- func (x *ResourceMenu) GetLeaf() bool
- func (x *ResourceMenu) GetLevel() int32
- func (x *ResourceMenu) GetName() string
- func (x *ResourceMenu) GetParentId() uint64
- func (x *ResourceMenu) GetSerialNumber() int32
- func (*ResourceMenu) ProtoMessage()
- func (x *ResourceMenu) ProtoReflect() protoreflect.Message
- func (x *ResourceMenu) Reset()
- func (x *ResourceMenu) String() string
- type ResourceServer
- type UnimplementedCasbinAdapterServer
- type UnimplementedPermissionServer
- type UnimplementedResourceServer
- type VerifyHttpRouteRequest
- func (*VerifyHttpRouteRequest) Descriptor() ([]byte, []int)deprecated
- func (x *VerifyHttpRouteRequest) GetMethod() string
- func (x *VerifyHttpRouteRequest) GetOauth2ClientId() string
- func (x *VerifyHttpRouteRequest) GetPath() string
- func (x *VerifyHttpRouteRequest) GetReturnUserInfo() bool
- func (x *VerifyHttpRouteRequest) GetToken() string
- func (*VerifyHttpRouteRequest) ProtoMessage()
- func (x *VerifyHttpRouteRequest) ProtoReflect() protoreflect.Message
- func (x *VerifyHttpRouteRequest) Reset()
- func (x *VerifyHttpRouteRequest) String() string
- type VerifyHttpRouteResponse
- func (*VerifyHttpRouteResponse) Descriptor() ([]byte, []int)deprecated
- func (x *VerifyHttpRouteResponse) GetAllow() bool
- func (x *VerifyHttpRouteResponse) GetUserInfo() *VerifyHttpRouteResponse_UserInfo
- func (*VerifyHttpRouteResponse) ProtoMessage()
- func (x *VerifyHttpRouteResponse) ProtoReflect() protoreflect.Message
- func (x *VerifyHttpRouteResponse) Reset()
- func (x *VerifyHttpRouteResponse) String() string
- type VerifyHttpRouteResponse_UserInfo
- func (*VerifyHttpRouteResponse_UserInfo) Descriptor() ([]byte, []int)deprecated
- func (x *VerifyHttpRouteResponse_UserInfo) GetAvatarUrl() string
- func (x *VerifyHttpRouteResponse_UserInfo) GetGender() uint32
- func (x *VerifyHttpRouteResponse_UserInfo) GetNickName() string
- func (x *VerifyHttpRouteResponse_UserInfo) GetOpenId() string
- func (x *VerifyHttpRouteResponse_UserInfo) GetUsername() string
- func (*VerifyHttpRouteResponse_UserInfo) ProtoMessage()
- func (x *VerifyHttpRouteResponse_UserInfo) ProtoReflect() protoreflect.Message
- func (x *VerifyHttpRouteResponse_UserInfo) Reset()
- func (x *VerifyHttpRouteResponse_UserInfo) String() string
- type VerifyTokenRequest
- func (*VerifyTokenRequest) Descriptor() ([]byte, []int)deprecated
- func (x *VerifyTokenRequest) GetOauth2ClientId() string
- func (x *VerifyTokenRequest) GetReturnUserInfo() bool
- func (x *VerifyTokenRequest) GetToken() string
- func (*VerifyTokenRequest) ProtoMessage()
- func (x *VerifyTokenRequest) ProtoReflect() protoreflect.Message
- func (x *VerifyTokenRequest) Reset()
- func (x *VerifyTokenRequest) String() string
- type VerifyTokenResponse
- func (*VerifyTokenResponse) Descriptor() ([]byte, []int)deprecated
- func (x *VerifyTokenResponse) GetAllow() bool
- func (x *VerifyTokenResponse) GetUserInfo() *VerifyTokenResponse_UserInfo
- func (*VerifyTokenResponse) ProtoMessage()
- func (x *VerifyTokenResponse) ProtoReflect() protoreflect.Message
- func (x *VerifyTokenResponse) Reset()
- func (x *VerifyTokenResponse) String() string
- type VerifyTokenResponse_UserInfo
- func (*VerifyTokenResponse_UserInfo) Descriptor() ([]byte, []int)deprecated
- func (x *VerifyTokenResponse_UserInfo) GetAvatarUrl() string
- func (x *VerifyTokenResponse_UserInfo) GetGender() uint32
- func (x *VerifyTokenResponse_UserInfo) GetNickName() string
- func (x *VerifyTokenResponse_UserInfo) GetOpenId() string
- func (x *VerifyTokenResponse_UserInfo) GetUsername() string
- func (*VerifyTokenResponse_UserInfo) ProtoMessage()
- func (x *VerifyTokenResponse_UserInfo) ProtoReflect() protoreflect.Message
- func (x *VerifyTokenResponse_UserInfo) Reset()
- func (x *VerifyTokenResponse_UserInfo) String() string
Constants ¶
This section is empty.
Variables ¶
var File_pkg_proto_casbin_adapter_proto protoreflect.FileDescriptor
var File_pkg_proto_permission_proto protoreflect.FileDescriptor
var File_pkg_proto_resource_proto protoreflect.FileDescriptor
Functions ¶
func RegisterCasbinAdapterHandler ¶ added in v0.3.0
func RegisterCasbinAdapterHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterCasbinAdapterHandler registers the http handlers for service CasbinAdapter to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterCasbinAdapterHandlerClient ¶ added in v0.3.0
func RegisterCasbinAdapterHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CasbinAdapterClient) error
RegisterCasbinAdapterHandlerClient registers the http handlers for service CasbinAdapter to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "CasbinAdapterClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "CasbinAdapterClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "CasbinAdapterClient" to call the correct interceptors.
func RegisterCasbinAdapterHandlerFromEndpoint ¶ added in v0.3.0
func RegisterCasbinAdapterHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterCasbinAdapterHandlerFromEndpoint is same as RegisterCasbinAdapterHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterCasbinAdapterHandlerServer ¶ added in v0.3.0
func RegisterCasbinAdapterHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CasbinAdapterServer) error
RegisterCasbinAdapterHandlerServer registers the http handlers for service CasbinAdapter to "mux". UnaryRPC :call CasbinAdapterServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterCasbinAdapterHandlerFromEndpoint instead.
func RegisterCasbinAdapterServer ¶ added in v0.3.0
func RegisterCasbinAdapterServer(s *grpc.Server, srv CasbinAdapterServer)
func RegisterPermissionHandler ¶ added in v0.1.2
func RegisterPermissionHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterPermissionHandler registers the http handlers for service Permission to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterPermissionHandlerClient ¶ added in v0.1.2
func RegisterPermissionHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PermissionClient) error
RegisterPermissionHandlerClient registers the http handlers for service Permission to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "PermissionClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "PermissionClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "PermissionClient" to call the correct interceptors.
func RegisterPermissionHandlerFromEndpoint ¶ added in v0.1.2
func RegisterPermissionHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterPermissionHandlerFromEndpoint is same as RegisterPermissionHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterPermissionHandlerServer ¶ added in v0.1.2
func RegisterPermissionHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PermissionServer) error
RegisterPermissionHandlerServer registers the http handlers for service Permission to "mux". UnaryRPC :call PermissionServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterPermissionHandlerFromEndpoint instead.
func RegisterPermissionServer ¶ added in v0.1.2
func RegisterPermissionServer(s *grpc.Server, srv PermissionServer)
func RegisterResourceServer ¶ added in v0.5.1
func RegisterResourceServer(s *grpc.Server, srv ResourceServer)
func SetResourceAuth ¶ added in v0.5.1
SetResourceAuth 设置资源服务器身份验证
func StreamServerInterceptor ¶ added in v0.5.1
func StreamServerInterceptor(f GrpcContextHandler) grpc.StreamServerInterceptor
StreamServerInterceptor ...
func UnaryServerInterceptor ¶ added in v0.5.1
func UnaryServerInterceptor(f GrpcContextHandler) grpc.UnaryServerInterceptor
UnaryServerInterceptor ...
Types ¶
type CasbinAdapterClient ¶ added in v0.3.0
type CasbinAdapterClient interface { // LoadPolicy 加载策略 LoadPolicy(ctx context.Context, in *LoadPolicyRequest, opts ...grpc.CallOption) (*LoadPolicyResponse, error) }
CasbinAdapterClient is the client API for CasbinAdapter service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewCasbinAdapterClient ¶ added in v0.3.0
func NewCasbinAdapterClient(cc grpc.ClientConnInterface) CasbinAdapterClient
type CasbinAdapterServer ¶ added in v0.3.0
type CasbinAdapterServer interface { // LoadPolicy 加载策略 LoadPolicy(context.Context, *LoadPolicyRequest) (*LoadPolicyResponse, error) }
CasbinAdapterServer is the server API for CasbinAdapter service.
type GrpcContextHandler ¶ added in v0.5.1
GrpcContextHandler ...
type ListActionByRolesRequest ¶ added in v0.5.1
type ListActionByRolesRequest struct { Roles []string `protobuf:"bytes,1,rep,name=roles,proto3" json:"roles,omitempty"` // contains filtered or unexported fields }
ListActionByRolesRequest 根据角色获取动作请求参数
func (*ListActionByRolesRequest) Descriptor
deprecated
added in
v0.5.1
func (*ListActionByRolesRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListActionByRolesRequest.ProtoReflect.Descriptor instead.
func (*ListActionByRolesRequest) GetRoles ¶ added in v0.5.1
func (x *ListActionByRolesRequest) GetRoles() []string
func (*ListActionByRolesRequest) ProtoMessage ¶ added in v0.5.1
func (*ListActionByRolesRequest) ProtoMessage()
func (*ListActionByRolesRequest) ProtoReflect ¶ added in v0.5.1
func (x *ListActionByRolesRequest) ProtoReflect() protoreflect.Message
func (*ListActionByRolesRequest) Reset ¶ added in v0.5.1
func (x *ListActionByRolesRequest) Reset()
func (*ListActionByRolesRequest) String ¶ added in v0.5.1
func (x *ListActionByRolesRequest) String() string
type ListActionByRolesResponse ¶ added in v0.5.1
type ListActionByRolesResponse struct { Actions []*ResourceAction `protobuf:"bytes,1,rep,name=actions,proto3" json:"actions,omitempty"` // contains filtered or unexported fields }
ListActionByRolesResponse 根据角色获取动作响应参数
func (*ListActionByRolesResponse) Descriptor
deprecated
added in
v0.5.1
func (*ListActionByRolesResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListActionByRolesResponse.ProtoReflect.Descriptor instead.
func (*ListActionByRolesResponse) GetActions ¶ added in v0.5.1
func (x *ListActionByRolesResponse) GetActions() []*ResourceAction
func (*ListActionByRolesResponse) ProtoMessage ¶ added in v0.5.1
func (*ListActionByRolesResponse) ProtoMessage()
func (*ListActionByRolesResponse) ProtoReflect ¶ added in v0.5.1
func (x *ListActionByRolesResponse) ProtoReflect() protoreflect.Message
func (*ListActionByRolesResponse) Reset ¶ added in v0.5.1
func (x *ListActionByRolesResponse) Reset()
func (*ListActionByRolesResponse) String ¶ added in v0.5.1
func (x *ListActionByRolesResponse) String() string
type ListMenuByRolesRequest ¶ added in v0.5.1
type ListMenuByRolesRequest struct { Roles []string `protobuf:"bytes,1,rep,name=roles,proto3" json:"roles,omitempty"` // contains filtered or unexported fields }
ListMenuByRolesRequest 根据角色获取菜单请求参数
func (*ListMenuByRolesRequest) Descriptor
deprecated
added in
v0.5.1
func (*ListMenuByRolesRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListMenuByRolesRequest.ProtoReflect.Descriptor instead.
func (*ListMenuByRolesRequest) GetRoles ¶ added in v0.5.1
func (x *ListMenuByRolesRequest) GetRoles() []string
func (*ListMenuByRolesRequest) ProtoMessage ¶ added in v0.5.1
func (*ListMenuByRolesRequest) ProtoMessage()
func (*ListMenuByRolesRequest) ProtoReflect ¶ added in v0.5.1
func (x *ListMenuByRolesRequest) ProtoReflect() protoreflect.Message
func (*ListMenuByRolesRequest) Reset ¶ added in v0.5.1
func (x *ListMenuByRolesRequest) Reset()
func (*ListMenuByRolesRequest) String ¶ added in v0.5.1
func (x *ListMenuByRolesRequest) String() string
type ListMenuByRolesResponse ¶ added in v0.5.1
type ListMenuByRolesResponse struct { Menus []*ResourceMenu `protobuf:"bytes,1,rep,name=menus,proto3" json:"menus,omitempty"` // contains filtered or unexported fields }
VerificationTokenResponse 根据角色获取菜单响应参数
func (*ListMenuByRolesResponse) Descriptor
deprecated
added in
v0.5.1
func (*ListMenuByRolesResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListMenuByRolesResponse.ProtoReflect.Descriptor instead.
func (*ListMenuByRolesResponse) GetMenus ¶ added in v0.5.1
func (x *ListMenuByRolesResponse) GetMenus() []*ResourceMenu
func (*ListMenuByRolesResponse) ProtoMessage ¶ added in v0.5.1
func (*ListMenuByRolesResponse) ProtoMessage()
func (*ListMenuByRolesResponse) ProtoReflect ¶ added in v0.5.1
func (x *ListMenuByRolesResponse) ProtoReflect() protoreflect.Message
func (*ListMenuByRolesResponse) Reset ¶ added in v0.5.1
func (x *ListMenuByRolesResponse) Reset()
func (*ListMenuByRolesResponse) String ¶ added in v0.5.1
func (x *ListMenuByRolesResponse) String() string
type LoadPolicyRequest ¶ added in v0.3.0
type LoadPolicyRequest struct {
// contains filtered or unexported fields
}
LoadPolicyRequest 加载策略请求
func (*LoadPolicyRequest) Descriptor
deprecated
added in
v0.3.0
func (*LoadPolicyRequest) Descriptor() ([]byte, []int)
Deprecated: Use LoadPolicyRequest.ProtoReflect.Descriptor instead.
func (*LoadPolicyRequest) ProtoMessage ¶ added in v0.3.0
func (*LoadPolicyRequest) ProtoMessage()
func (*LoadPolicyRequest) ProtoReflect ¶ added in v0.3.0
func (x *LoadPolicyRequest) ProtoReflect() protoreflect.Message
func (*LoadPolicyRequest) Reset ¶ added in v0.3.0
func (x *LoadPolicyRequest) Reset()
func (*LoadPolicyRequest) String ¶ added in v0.3.0
func (x *LoadPolicyRequest) String() string
type LoadPolicyResponse ¶ added in v0.3.0
type LoadPolicyResponse struct { Policys []string `protobuf:"bytes,1,rep,name=policys,proto3" json:"policys,omitempty"` // contains filtered or unexported fields }
LoadPolicyResponse 加载策略响应
func (*LoadPolicyResponse) Descriptor
deprecated
added in
v0.3.0
func (*LoadPolicyResponse) Descriptor() ([]byte, []int)
Deprecated: Use LoadPolicyResponse.ProtoReflect.Descriptor instead.
func (*LoadPolicyResponse) GetPolicys ¶ added in v0.3.0
func (x *LoadPolicyResponse) GetPolicys() []string
func (*LoadPolicyResponse) ProtoMessage ¶ added in v0.3.0
func (*LoadPolicyResponse) ProtoMessage()
func (*LoadPolicyResponse) ProtoReflect ¶ added in v0.3.0
func (x *LoadPolicyResponse) ProtoReflect() protoreflect.Message
func (*LoadPolicyResponse) Reset ¶ added in v0.3.0
func (x *LoadPolicyResponse) Reset()
func (*LoadPolicyResponse) String ¶ added in v0.3.0
func (x *LoadPolicyResponse) String() string
type PermissionClient ¶ added in v0.1.2
type PermissionClient interface { // VerifyToken 验证Token VerifyToken(ctx context.Context, in *VerifyTokenRequest, opts ...grpc.CallOption) (*VerifyTokenResponse, error) // VerifyHttpRoute 验证Http路由权限 VerifyHttpRoute(ctx context.Context, in *VerifyHttpRouteRequest, opts ...grpc.CallOption) (*VerifyHttpRouteResponse, error) }
PermissionClient is the client API for Permission service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewPermissionClient ¶ added in v0.1.2
func NewPermissionClient(cc grpc.ClientConnInterface) PermissionClient
type PermissionServer ¶ added in v0.1.2
type PermissionServer interface { // VerifyToken 验证Token VerifyToken(context.Context, *VerifyTokenRequest) (*VerifyTokenResponse, error) // VerifyHttpRoute 验证Http路由权限 VerifyHttpRoute(context.Context, *VerifyHttpRouteRequest) (*VerifyHttpRouteResponse, error) }
PermissionServer is the server API for Permission service.
type ResourceAction ¶ added in v0.5.1
type ResourceAction struct { Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Group string `protobuf:"bytes,3,opt,name=group,proto3" json:"group,omitempty"` Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` // contains filtered or unexported fields }
func (*ResourceAction) Descriptor
deprecated
added in
v0.5.1
func (*ResourceAction) Descriptor() ([]byte, []int)
Deprecated: Use ResourceAction.ProtoReflect.Descriptor instead.
func (*ResourceAction) GetDescription ¶ added in v0.5.1
func (x *ResourceAction) GetDescription() string
func (*ResourceAction) GetGroup ¶ added in v0.5.1
func (x *ResourceAction) GetGroup() string
func (*ResourceAction) GetId ¶ added in v0.5.1
func (x *ResourceAction) GetId() uint64
func (*ResourceAction) GetName ¶ added in v0.5.1
func (x *ResourceAction) GetName() string
func (*ResourceAction) ProtoMessage ¶ added in v0.5.1
func (*ResourceAction) ProtoMessage()
func (*ResourceAction) ProtoReflect ¶ added in v0.5.1
func (x *ResourceAction) ProtoReflect() protoreflect.Message
func (*ResourceAction) Reset ¶ added in v0.5.1
func (x *ResourceAction) Reset()
func (*ResourceAction) String ¶ added in v0.5.1
func (x *ResourceAction) String() string
type ResourceClient ¶ added in v0.5.1
type ResourceClient interface { // ListActionByRoles 根据角色获取动作 ListActionByRoles(ctx context.Context, in *ListActionByRolesRequest, opts ...grpc.CallOption) (*ListActionByRolesResponse, error) // ListMenuByRoles 根据角色获取菜单 ListMenuByRoles(ctx context.Context, in *ListMenuByRolesRequest, opts ...grpc.CallOption) (*ListMenuByRolesResponse, error) }
ResourceClient is the client API for Resource service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewResourceClient ¶ added in v0.5.1
func NewResourceClient(cc grpc.ClientConnInterface) ResourceClient
type ResourceMenu ¶ added in v0.5.1
type ResourceMenu struct { Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Icon string `protobuf:"bytes,3,opt,name=icon,proto3" json:"icon,omitempty"` Level int32 `protobuf:"varint,4,opt,name=level,proto3" json:"level,omitempty"` SerialNumber int32 `protobuf:"varint,5,opt,name=serial_number,json=serialNumber,proto3" json:"serial_number,omitempty"` Leaf bool `protobuf:"varint,6,opt,name=leaf,proto3" json:"leaf,omitempty"` ParentId uint64 `protobuf:"varint,7,opt,name=parent_id,json=parentId,proto3" json:"parent_id,omitempty"` // contains filtered or unexported fields }
func (*ResourceMenu) Descriptor
deprecated
added in
v0.5.1
func (*ResourceMenu) Descriptor() ([]byte, []int)
Deprecated: Use ResourceMenu.ProtoReflect.Descriptor instead.
func (*ResourceMenu) GetIcon ¶ added in v0.5.1
func (x *ResourceMenu) GetIcon() string
func (*ResourceMenu) GetId ¶ added in v0.5.1
func (x *ResourceMenu) GetId() uint64
func (*ResourceMenu) GetLeaf ¶ added in v0.5.1
func (x *ResourceMenu) GetLeaf() bool
func (*ResourceMenu) GetLevel ¶ added in v0.5.1
func (x *ResourceMenu) GetLevel() int32
func (*ResourceMenu) GetName ¶ added in v0.5.1
func (x *ResourceMenu) GetName() string
func (*ResourceMenu) GetParentId ¶ added in v0.5.1
func (x *ResourceMenu) GetParentId() uint64
func (*ResourceMenu) GetSerialNumber ¶ added in v0.5.1
func (x *ResourceMenu) GetSerialNumber() int32
func (*ResourceMenu) ProtoMessage ¶ added in v0.5.1
func (*ResourceMenu) ProtoMessage()
func (*ResourceMenu) ProtoReflect ¶ added in v0.5.1
func (x *ResourceMenu) ProtoReflect() protoreflect.Message
func (*ResourceMenu) Reset ¶ added in v0.5.1
func (x *ResourceMenu) Reset()
func (*ResourceMenu) String ¶ added in v0.5.1
func (x *ResourceMenu) String() string
type ResourceServer ¶ added in v0.5.1
type ResourceServer interface { // ListActionByRoles 根据角色获取动作 ListActionByRoles(context.Context, *ListActionByRolesRequest) (*ListActionByRolesResponse, error) // ListMenuByRoles 根据角色获取菜单 ListMenuByRoles(context.Context, *ListMenuByRolesRequest) (*ListMenuByRolesResponse, error) }
ResourceServer is the server API for Resource service.
type UnimplementedCasbinAdapterServer ¶ added in v0.3.0
type UnimplementedCasbinAdapterServer struct { }
UnimplementedCasbinAdapterServer can be embedded to have forward compatible implementations.
func (*UnimplementedCasbinAdapterServer) LoadPolicy ¶ added in v0.3.0
func (*UnimplementedCasbinAdapterServer) LoadPolicy(context.Context, *LoadPolicyRequest) (*LoadPolicyResponse, error)
type UnimplementedPermissionServer ¶ added in v0.3.0
type UnimplementedPermissionServer struct { }
UnimplementedPermissionServer can be embedded to have forward compatible implementations.
func (*UnimplementedPermissionServer) VerifyHttpRoute ¶ added in v0.3.0
func (*UnimplementedPermissionServer) VerifyHttpRoute(context.Context, *VerifyHttpRouteRequest) (*VerifyHttpRouteResponse, error)
func (*UnimplementedPermissionServer) VerifyToken ¶ added in v0.3.0
func (*UnimplementedPermissionServer) VerifyToken(context.Context, *VerifyTokenRequest) (*VerifyTokenResponse, error)
type UnimplementedResourceServer ¶ added in v0.5.1
type UnimplementedResourceServer struct { }
UnimplementedResourceServer can be embedded to have forward compatible implementations.
func (*UnimplementedResourceServer) ListActionByRoles ¶ added in v0.5.1
func (*UnimplementedResourceServer) ListActionByRoles(context.Context, *ListActionByRolesRequest) (*ListActionByRolesResponse, error)
func (*UnimplementedResourceServer) ListMenuByRoles ¶ added in v0.5.1
func (*UnimplementedResourceServer) ListMenuByRoles(context.Context, *ListMenuByRolesRequest) (*ListMenuByRolesResponse, error)
type VerifyHttpRouteRequest ¶ added in v0.3.0
type VerifyHttpRouteRequest struct { // oauth2 client id Oauth2ClientId string `protobuf:"bytes,1,opt,name=oauth2_client_id,json=oauth2ClientId,proto3" json:"oauth2_client_id,omitempty"` // token Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` // 路由 Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` // 请求方法 Method string `protobuf:"bytes,4,opt,name=method,proto3" json:"method,omitempty"` // 是否返回用户信息,token验证通过的情况下 ReturnUserInfo bool `protobuf:"varint,5,opt,name=return_user_info,json=returnUserInfo,proto3" json:"return_user_info,omitempty"` // contains filtered or unexported fields }
VerifyHttpRouteRequest 验证HTTP路由权限请求参数
func (*VerifyHttpRouteRequest) Descriptor
deprecated
added in
v0.3.0
func (*VerifyHttpRouteRequest) Descriptor() ([]byte, []int)
Deprecated: Use VerifyHttpRouteRequest.ProtoReflect.Descriptor instead.
func (*VerifyHttpRouteRequest) GetMethod ¶ added in v0.3.0
func (x *VerifyHttpRouteRequest) GetMethod() string
func (*VerifyHttpRouteRequest) GetOauth2ClientId ¶ added in v0.3.0
func (x *VerifyHttpRouteRequest) GetOauth2ClientId() string
func (*VerifyHttpRouteRequest) GetPath ¶ added in v0.3.0
func (x *VerifyHttpRouteRequest) GetPath() string
func (*VerifyHttpRouteRequest) GetReturnUserInfo ¶ added in v0.3.0
func (x *VerifyHttpRouteRequest) GetReturnUserInfo() bool
func (*VerifyHttpRouteRequest) GetToken ¶ added in v0.3.0
func (x *VerifyHttpRouteRequest) GetToken() string
func (*VerifyHttpRouteRequest) ProtoMessage ¶ added in v0.3.0
func (*VerifyHttpRouteRequest) ProtoMessage()
func (*VerifyHttpRouteRequest) ProtoReflect ¶ added in v0.3.0
func (x *VerifyHttpRouteRequest) ProtoReflect() protoreflect.Message
func (*VerifyHttpRouteRequest) Reset ¶ added in v0.3.0
func (x *VerifyHttpRouteRequest) Reset()
func (*VerifyHttpRouteRequest) String ¶ added in v0.3.0
func (x *VerifyHttpRouteRequest) String() string
type VerifyHttpRouteResponse ¶ added in v0.3.0
type VerifyHttpRouteResponse struct { // 是否允许 Allow bool `protobuf:"varint,1,opt,name=allow,proto3" json:"allow,omitempty"` // 用户信息 UserInfo *VerifyHttpRouteResponse_UserInfo `protobuf:"bytes,2,opt,name=user_info,json=userInfo,proto3" json:"user_info,omitempty"` // contains filtered or unexported fields }
VerificationHttpRouterResponse 验证HTTP路由权限响应参数
func (*VerifyHttpRouteResponse) Descriptor
deprecated
added in
v0.3.0
func (*VerifyHttpRouteResponse) Descriptor() ([]byte, []int)
Deprecated: Use VerifyHttpRouteResponse.ProtoReflect.Descriptor instead.
func (*VerifyHttpRouteResponse) GetAllow ¶ added in v0.3.0
func (x *VerifyHttpRouteResponse) GetAllow() bool
func (*VerifyHttpRouteResponse) GetUserInfo ¶ added in v0.3.0
func (x *VerifyHttpRouteResponse) GetUserInfo() *VerifyHttpRouteResponse_UserInfo
func (*VerifyHttpRouteResponse) ProtoMessage ¶ added in v0.3.0
func (*VerifyHttpRouteResponse) ProtoMessage()
func (*VerifyHttpRouteResponse) ProtoReflect ¶ added in v0.3.0
func (x *VerifyHttpRouteResponse) ProtoReflect() protoreflect.Message
func (*VerifyHttpRouteResponse) Reset ¶ added in v0.3.0
func (x *VerifyHttpRouteResponse) Reset()
func (*VerifyHttpRouteResponse) String ¶ added in v0.3.0
func (x *VerifyHttpRouteResponse) String() string
type VerifyHttpRouteResponse_UserInfo ¶ added in v0.3.0
type VerifyHttpRouteResponse_UserInfo struct { OpenId string `protobuf:"bytes,1,opt,name=open_id,json=openId,proto3" json:"open_id,omitempty"` Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` NickName string `protobuf:"bytes,3,opt,name=nick_name,json=nickName,proto3" json:"nick_name,omitempty"` AvatarUrl string `protobuf:"bytes,4,opt,name=avatar_url,json=avatarUrl,proto3" json:"avatar_url,omitempty"` Gender uint32 `protobuf:"varint,5,opt,name=gender,proto3" json:"gender,omitempty"` // contains filtered or unexported fields }
用户信息
func (*VerifyHttpRouteResponse_UserInfo) Descriptor
deprecated
added in
v0.3.0
func (*VerifyHttpRouteResponse_UserInfo) Descriptor() ([]byte, []int)
Deprecated: Use VerifyHttpRouteResponse_UserInfo.ProtoReflect.Descriptor instead.
func (*VerifyHttpRouteResponse_UserInfo) GetAvatarUrl ¶ added in v0.3.0
func (x *VerifyHttpRouteResponse_UserInfo) GetAvatarUrl() string
func (*VerifyHttpRouteResponse_UserInfo) GetGender ¶ added in v0.3.0
func (x *VerifyHttpRouteResponse_UserInfo) GetGender() uint32
func (*VerifyHttpRouteResponse_UserInfo) GetNickName ¶ added in v0.3.0
func (x *VerifyHttpRouteResponse_UserInfo) GetNickName() string
func (*VerifyHttpRouteResponse_UserInfo) GetOpenId ¶ added in v0.3.0
func (x *VerifyHttpRouteResponse_UserInfo) GetOpenId() string
func (*VerifyHttpRouteResponse_UserInfo) GetUsername ¶ added in v0.3.0
func (x *VerifyHttpRouteResponse_UserInfo) GetUsername() string
func (*VerifyHttpRouteResponse_UserInfo) ProtoMessage ¶ added in v0.3.0
func (*VerifyHttpRouteResponse_UserInfo) ProtoMessage()
func (*VerifyHttpRouteResponse_UserInfo) ProtoReflect ¶ added in v0.3.0
func (x *VerifyHttpRouteResponse_UserInfo) ProtoReflect() protoreflect.Message
func (*VerifyHttpRouteResponse_UserInfo) Reset ¶ added in v0.3.0
func (x *VerifyHttpRouteResponse_UserInfo) Reset()
func (*VerifyHttpRouteResponse_UserInfo) String ¶ added in v0.3.0
func (x *VerifyHttpRouteResponse_UserInfo) String() string
type VerifyTokenRequest ¶ added in v0.3.0
type VerifyTokenRequest struct { // oauth2 client id Oauth2ClientId string `protobuf:"bytes,1,opt,name=oauth2_client_id,json=oauth2ClientId,proto3" json:"oauth2_client_id,omitempty"` // token Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` // 是否返回用户信息,token验证通过的情况下 ReturnUserInfo bool `protobuf:"varint,3,opt,name=return_user_info,json=returnUserInfo,proto3" json:"return_user_info,omitempty"` // contains filtered or unexported fields }
VerificationTokenRequest 验证Token请求参数
func (*VerifyTokenRequest) Descriptor
deprecated
added in
v0.3.0
func (*VerifyTokenRequest) Descriptor() ([]byte, []int)
Deprecated: Use VerifyTokenRequest.ProtoReflect.Descriptor instead.
func (*VerifyTokenRequest) GetOauth2ClientId ¶ added in v0.3.0
func (x *VerifyTokenRequest) GetOauth2ClientId() string
func (*VerifyTokenRequest) GetReturnUserInfo ¶ added in v0.3.0
func (x *VerifyTokenRequest) GetReturnUserInfo() bool
func (*VerifyTokenRequest) GetToken ¶ added in v0.3.0
func (x *VerifyTokenRequest) GetToken() string
func (*VerifyTokenRequest) ProtoMessage ¶ added in v0.3.0
func (*VerifyTokenRequest) ProtoMessage()
func (*VerifyTokenRequest) ProtoReflect ¶ added in v0.3.0
func (x *VerifyTokenRequest) ProtoReflect() protoreflect.Message
func (*VerifyTokenRequest) Reset ¶ added in v0.3.0
func (x *VerifyTokenRequest) Reset()
func (*VerifyTokenRequest) String ¶ added in v0.3.0
func (x *VerifyTokenRequest) String() string
type VerifyTokenResponse ¶ added in v0.3.0
type VerifyTokenResponse struct { // 是否允许 Allow bool `protobuf:"varint,1,opt,name=allow,proto3" json:"allow,omitempty"` // 用户信息 UserInfo *VerifyTokenResponse_UserInfo `protobuf:"bytes,2,opt,name=user_info,json=userInfo,proto3" json:"user_info,omitempty"` // contains filtered or unexported fields }
VerificationTokenResponse 验证Token响应参数
func (*VerifyTokenResponse) Descriptor
deprecated
added in
v0.3.0
func (*VerifyTokenResponse) Descriptor() ([]byte, []int)
Deprecated: Use VerifyTokenResponse.ProtoReflect.Descriptor instead.
func (*VerifyTokenResponse) GetAllow ¶ added in v0.3.0
func (x *VerifyTokenResponse) GetAllow() bool
func (*VerifyTokenResponse) GetUserInfo ¶ added in v0.3.0
func (x *VerifyTokenResponse) GetUserInfo() *VerifyTokenResponse_UserInfo
func (*VerifyTokenResponse) ProtoMessage ¶ added in v0.3.0
func (*VerifyTokenResponse) ProtoMessage()
func (*VerifyTokenResponse) ProtoReflect ¶ added in v0.3.0
func (x *VerifyTokenResponse) ProtoReflect() protoreflect.Message
func (*VerifyTokenResponse) Reset ¶ added in v0.3.0
func (x *VerifyTokenResponse) Reset()
func (*VerifyTokenResponse) String ¶ added in v0.3.0
func (x *VerifyTokenResponse) String() string
type VerifyTokenResponse_UserInfo ¶ added in v0.3.0
type VerifyTokenResponse_UserInfo struct { OpenId string `protobuf:"bytes,1,opt,name=open_id,json=openId,proto3" json:"open_id,omitempty"` Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` NickName string `protobuf:"bytes,3,opt,name=nick_name,json=nickName,proto3" json:"nick_name,omitempty"` AvatarUrl string `protobuf:"bytes,4,opt,name=avatar_url,json=avatarUrl,proto3" json:"avatar_url,omitempty"` Gender uint32 `protobuf:"varint,5,opt,name=gender,proto3" json:"gender,omitempty"` // contains filtered or unexported fields }
用户信息
func (*VerifyTokenResponse_UserInfo) Descriptor
deprecated
added in
v0.3.0
func (*VerifyTokenResponse_UserInfo) Descriptor() ([]byte, []int)
Deprecated: Use VerifyTokenResponse_UserInfo.ProtoReflect.Descriptor instead.
func (*VerifyTokenResponse_UserInfo) GetAvatarUrl ¶ added in v0.3.0
func (x *VerifyTokenResponse_UserInfo) GetAvatarUrl() string
func (*VerifyTokenResponse_UserInfo) GetGender ¶ added in v0.3.0
func (x *VerifyTokenResponse_UserInfo) GetGender() uint32
func (*VerifyTokenResponse_UserInfo) GetNickName ¶ added in v0.3.0
func (x *VerifyTokenResponse_UserInfo) GetNickName() string
func (*VerifyTokenResponse_UserInfo) GetOpenId ¶ added in v0.3.0
func (x *VerifyTokenResponse_UserInfo) GetOpenId() string
func (*VerifyTokenResponse_UserInfo) GetUsername ¶ added in v0.3.0
func (x *VerifyTokenResponse_UserInfo) GetUsername() string
func (*VerifyTokenResponse_UserInfo) ProtoMessage ¶ added in v0.3.0
func (*VerifyTokenResponse_UserInfo) ProtoMessage()
func (*VerifyTokenResponse_UserInfo) ProtoReflect ¶ added in v0.3.0
func (x *VerifyTokenResponse_UserInfo) ProtoReflect() protoreflect.Message
func (*VerifyTokenResponse_UserInfo) Reset ¶ added in v0.3.0
func (x *VerifyTokenResponse_UserInfo) Reset()
func (*VerifyTokenResponse_UserInfo) String ¶ added in v0.3.0
func (x *VerifyTokenResponse_UserInfo) String() string