permission

package
v0.0.0-...-f4657ca Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppName = "permission"
)

模块名称

View Source
const (
	RPC_CheckPermission_FullMethodName = "/codehorse.mcenter.permission.RPC/CheckPermission"
)

Variables

View Source
var File_apps_permission_pb_permission_proto protoreflect.FileDescriptor
View Source
var File_apps_permission_pb_rpc_proto protoreflect.FileDescriptor
View Source
var RPC_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "codehorse.mcenter.permission.RPC",
	HandlerType: (*RPCServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CheckPermission",
			Handler:    _RPC_CheckPermission_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "apps/permission/pb/rpc.proto",
}

RPC_ServiceDesc is the grpc.ServiceDesc for RPC service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterRPCServer

func RegisterRPCServer(s grpc.ServiceRegistrar, srv RPCServer)

Types

type CheckPermissionRequest

type CheckPermissionRequest struct {

	// @gotags: bson:"user_id" json:"user_id"
	UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id" bson:"user_id"`
	// @gotags: bson:"namespace" json:"namespace"
	Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace" bson:"namespace"`
	// @gotags: bson:"service_id" json:"service_id"
	ServiceId string `protobuf:"bytes,3,opt,name=service_id,json=serviceId,proto3" json:"service_id" bson:"service_id"`
	// @gotags: bson:"http_method" json:"http_method"
	HttpMethod string `protobuf:"bytes,4,opt,name=http_method,json=httpMethod,proto3" json:"http_method" bson:"http_method"`
	// @gotags: bson:"http_path" json:"http_path"
	HttpPath string `protobuf:"bytes,5,opt,name=http_path,json=httpPath,proto3" json:"http_path" bson:"http_path"`
	// contains filtered or unexported fields
}

CheckPermissionRequest结构体

func NewCheckPermissionRequest

func NewCheckPermissionRequest() *CheckPermissionRequest

CheckPermissionRequest构造函数

func (*CheckPermissionRequest) Descriptor deprecated

func (*CheckPermissionRequest) Descriptor() ([]byte, []int)

Deprecated: Use CheckPermissionRequest.ProtoReflect.Descriptor instead.

func (*CheckPermissionRequest) GetHttpMethod

func (x *CheckPermissionRequest) GetHttpMethod() string

func (*CheckPermissionRequest) GetHttpPath

func (x *CheckPermissionRequest) GetHttpPath() string

func (*CheckPermissionRequest) GetNamespace

func (x *CheckPermissionRequest) GetNamespace() string

func (*CheckPermissionRequest) GetServiceId

func (x *CheckPermissionRequest) GetServiceId() string

func (*CheckPermissionRequest) GetUserId

func (x *CheckPermissionRequest) GetUserId() string

func (*CheckPermissionRequest) ProtoMessage

func (*CheckPermissionRequest) ProtoMessage()

func (*CheckPermissionRequest) ProtoReflect

func (x *CheckPermissionRequest) ProtoReflect() protoreflect.Message

func (*CheckPermissionRequest) Reset

func (x *CheckPermissionRequest) Reset()

func (*CheckPermissionRequest) String

func (x *CheckPermissionRequest) String() string

type CheckPermissionResponse

type CheckPermissionResponse struct {

	// @gotags: bson:"has_permission" json:"has_permission"
	HasPermission bool `protobuf:"varint,1,opt,name=has_permission,json=hasPermission,proto3" json:"has_permission" bson:"has_permission"`
	// @gotags: bson:"role" json:"role"
	Role *role.Role `protobuf:"bytes,2,opt,name=role,proto3" json:"role" bson:"role"`
	// contains filtered or unexported fields
}

CheckPermissionResponse结构体

func NewCheckPermissionResponse

func NewCheckPermissionResponse() *CheckPermissionResponse

CheckPermissionResponse构造函数

func (*CheckPermissionResponse) Descriptor deprecated

func (*CheckPermissionResponse) Descriptor() ([]byte, []int)

Deprecated: Use CheckPermissionResponse.ProtoReflect.Descriptor instead.

func (*CheckPermissionResponse) GetHasPermission

func (x *CheckPermissionResponse) GetHasPermission() bool

func (*CheckPermissionResponse) GetRole

func (x *CheckPermissionResponse) GetRole() *role.Role

func (*CheckPermissionResponse) ProtoMessage

func (*CheckPermissionResponse) ProtoMessage()

func (*CheckPermissionResponse) ProtoReflect

func (x *CheckPermissionResponse) ProtoReflect() protoreflect.Message

func (*CheckPermissionResponse) Reset

func (x *CheckPermissionResponse) Reset()

func (*CheckPermissionResponse) String

func (x *CheckPermissionResponse) String() string

type RPCClient

type RPCClient interface {
	// 用户访问鉴权
	CheckPermission(ctx context.Context, in *CheckPermissionRequest, opts ...grpc.CallOption) (*CheckPermissionResponse, error)
}

RPCClient is the client API for RPC service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewRPCClient

func NewRPCClient(cc grpc.ClientConnInterface) RPCClient

type RPCServer

type RPCServer interface {
	// 用户访问鉴权
	CheckPermission(context.Context, *CheckPermissionRequest) (*CheckPermissionResponse, error)
	// contains filtered or unexported methods
}

RPCServer is the server API for RPC service. All implementations must embed UnimplementedRPCServer for forward compatibility

type Service

type Service interface {
	// 嵌套Permission Grpc接口
	RPCServer
}

Permission业务接口

type UnimplementedRPCServer

type UnimplementedRPCServer struct {
}

UnimplementedRPCServer must be embedded to have forward compatible implementations.

func (UnimplementedRPCServer) CheckPermission

type UnsafeRPCServer

type UnsafeRPCServer interface {
	// contains filtered or unexported methods
}

UnsafeRPCServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to RPCServer will result in compilation errors.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL