Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterRPCServer(s grpc.ServiceRegistrar, srv RPCServer)
- type CreateRoleRequest
- func (req *CreateRoleRequest) AddFeature(f *Feature)
- func (*CreateRoleRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateRoleRequest) GetFeatures() []*Feature
- func (x *CreateRoleRequest) GetName() string
- func (*CreateRoleRequest) ProtoMessage()
- func (x *CreateRoleRequest) ProtoReflect() protoreflect.Message
- func (x *CreateRoleRequest) Reset()
- func (x *CreateRoleRequest) String() string
- type Feature
- func (*Feature) Descriptor() ([]byte, []int)deprecated
- func (x *Feature) GetHttPath() string
- func (x *Feature) GetHttpMethod() string
- func (x *Feature) GetServiceId() string
- func (f *Feature) IsEqual(serviceId, httpMethod, httpPath string) bool
- func (*Feature) ProtoMessage()
- func (x *Feature) ProtoReflect() protoreflect.Message
- func (x *Feature) Reset()
- func (x *Feature) String() string
- type QueryRoleRequest
- func (req *QueryRoleRequest) AddRoleId(ids ...string)
- func (*QueryRoleRequest) Descriptor() ([]byte, []int)deprecated
- func (x *QueryRoleRequest) GetPage() *request.PageRequest
- func (x *QueryRoleRequest) GetRoleIds() []string
- func (*QueryRoleRequest) ProtoMessage()
- func (x *QueryRoleRequest) ProtoReflect() protoreflect.Message
- func (x *QueryRoleRequest) Reset()
- func (x *QueryRoleRequest) String() string
- type RPCClient
- type RPCServer
- type Role
- func (*Role) Descriptor() ([]byte, []int)deprecated
- func (x *Role) GetMeta() *meta.Meta
- func (x *Role) GetSpec() *CreateRoleRequest
- func (r *Role) HasFeatrue(serviceId, httpMethod, httpPath string) bool
- func (*Role) ProtoMessage()
- func (x *Role) ProtoReflect() protoreflect.Message
- func (x *Role) Reset()
- func (x *Role) String() string
- type RoleSet
- func (s *RoleSet) Add(item *Role)
- func (*RoleSet) Descriptor() ([]byte, []int)deprecated
- func (x *RoleSet) GetItems() []*Role
- func (x *RoleSet) GetTotal() int64
- func (*RoleSet) ProtoMessage()
- func (x *RoleSet) ProtoReflect() protoreflect.Message
- func (x *RoleSet) Reset()
- func (x *RoleSet) String() string
- type Service
- type UnimplementedRPCServer
- type UnsafeRPCServer
Constants ¶
const (
AppName = "roles"
)
Variables ¶
var File_apps_role_pb_role_proto protoreflect.FileDescriptor
var File_apps_role_pb_rpc_proto protoreflect.FileDescriptor
var RPC_ServiceDesc = grpc.ServiceDesc{ ServiceName: "go9.devcloud.role.RPC", HandlerType: (*RPCServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "QueryRole", Handler: _RPC_QueryRole_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "apps/role/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 CreateRoleRequest ¶
type CreateRoleRequest struct { // 角色名称 // @gotags: bson:"name" json:"name" Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name" bson:"name"` // 角色功能列表 // @gotags: bson:"features" json:"features" Features []*Feature `protobuf:"bytes,2,rep,name=features,proto3" json:"features" bson:"features"` // contains filtered or unexported fields }
包含服务的功能
func NewCreateRoleRequest ¶
func NewCreateRoleRequest() *CreateRoleRequest
func (*CreateRoleRequest) AddFeature ¶
func (req *CreateRoleRequest) AddFeature(f *Feature)
func (*CreateRoleRequest) Descriptor
deprecated
func (*CreateRoleRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateRoleRequest.ProtoReflect.Descriptor instead.
func (*CreateRoleRequest) GetFeatures ¶
func (x *CreateRoleRequest) GetFeatures() []*Feature
func (*CreateRoleRequest) GetName ¶
func (x *CreateRoleRequest) GetName() string
func (*CreateRoleRequest) ProtoMessage ¶
func (*CreateRoleRequest) ProtoMessage()
func (*CreateRoleRequest) ProtoReflect ¶
func (x *CreateRoleRequest) ProtoReflect() protoreflect.Message
func (*CreateRoleRequest) Reset ¶
func (x *CreateRoleRequest) Reset()
func (*CreateRoleRequest) String ¶
func (x *CreateRoleRequest) String() string
type Feature ¶
type Feature struct { ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` HttpMethod string `protobuf:"bytes,2,opt,name=http_method,json=httpMethod,proto3" json:"http_method,omitempty"` HttPath string `protobuf:"bytes,3,opt,name=htt_path,json=httPath,proto3" json:"htt_path,omitempty"` // contains filtered or unexported fields }
一个功能
func (*Feature) Descriptor
deprecated
func (*Feature) GetHttPath ¶
func (*Feature) GetHttpMethod ¶
func (*Feature) GetServiceId ¶
func (*Feature) ProtoMessage ¶
func (*Feature) ProtoMessage()
func (*Feature) ProtoReflect ¶
func (x *Feature) ProtoReflect() protoreflect.Message
type QueryRoleRequest ¶
type QueryRoleRequest struct { // 分页参数 Page *request.PageRequest `protobuf:"bytes,1,opt,name=page,proto3" json:"page,omitempty"` // role id的列表 RoleIds []string `protobuf:"bytes,2,rep,name=role_ids,json=roleIds,proto3" json:"role_ids,omitempty"` // contains filtered or unexported fields }
func NewQueryRoleRequest ¶
func NewQueryRoleRequest() *QueryRoleRequest
func (*QueryRoleRequest) AddRoleId ¶
func (req *QueryRoleRequest) AddRoleId(ids ...string)
func (*QueryRoleRequest) Descriptor
deprecated
func (*QueryRoleRequest) Descriptor() ([]byte, []int)
Deprecated: Use QueryRoleRequest.ProtoReflect.Descriptor instead.
func (*QueryRoleRequest) GetPage ¶
func (x *QueryRoleRequest) GetPage() *request.PageRequest
func (*QueryRoleRequest) GetRoleIds ¶
func (x *QueryRoleRequest) GetRoleIds() []string
func (*QueryRoleRequest) ProtoMessage ¶
func (*QueryRoleRequest) ProtoMessage()
func (*QueryRoleRequest) ProtoReflect ¶
func (x *QueryRoleRequest) ProtoReflect() protoreflect.Message
func (*QueryRoleRequest) Reset ¶
func (x *QueryRoleRequest) Reset()
func (*QueryRoleRequest) String ¶
func (x *QueryRoleRequest) String() string
type RPCClient ¶
type RPCClient interface { // 查询角色列表 QueryRole(ctx context.Context, in *QueryRoleRequest, opts ...grpc.CallOption) (*RoleSet, 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 { // 查询角色列表 QueryRole(context.Context, *QueryRoleRequest) (*RoleSet, error) // contains filtered or unexported methods }
RPCServer is the server API for RPC service. All implementations must embed UnimplementedRPCServer for forward compatibility
type Role ¶
type Role struct { // 对象元数据 // @gotags: bson:",inline" json:"meta" Meta *meta.Meta `protobuf:"bytes,1,opt,name=meta,proto3" json:"meta" bson:",inline"` // 创建信息 // @gotags: bson:",inline" json:"spec" Spec *CreateRoleRequest `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec" bson:",inline"` // contains filtered or unexported fields }
func New ¶
func New(req *CreateRoleRequest) *Role
func NewDefaultRole ¶
func NewDefaultRole() *Role
func (*Role) Descriptor
deprecated
func (*Role) GetSpec ¶
func (x *Role) GetSpec() *CreateRoleRequest
func (*Role) HasFeatrue ¶
func (*Role) ProtoMessage ¶
func (*Role) ProtoMessage()
func (*Role) ProtoReflect ¶
func (x *Role) ProtoReflect() protoreflect.Message
type RoleSet ¶
type RoleSet struct { // 用户总数量 // @gotags: json:"total" Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total"` // 分页的用户列表 // @gotags: json:"items" Items []*Role `protobuf:"bytes,2,rep,name=items,proto3" json:"items"` // contains filtered or unexported fields }
func NewRoleSet ¶
func NewRoleSet() *RoleSet
func (*RoleSet) Descriptor
deprecated
func (*RoleSet) ProtoMessage ¶
func (*RoleSet) ProtoMessage()
func (*RoleSet) ProtoReflect ¶
func (x *RoleSet) ProtoReflect() protoreflect.Message
type UnimplementedRPCServer ¶
type UnimplementedRPCServer struct { }
UnimplementedRPCServer must be embedded to have forward compatible implementations.
func (UnimplementedRPCServer) QueryRole ¶
func (UnimplementedRPCServer) QueryRole(context.Context, *QueryRoleRequest) (*RoleSet, error)
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.