Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterRpcServer(s grpc.ServiceRegistrar, srv RpcServer)
- type CreateUserRequest
- func (*CreateUserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateUserRequest) GetPassword() string
- func (x *CreateUserRequest) GetRoleIds() []string
- func (x *CreateUserRequest) GetUsername() string
- func (r *CreateUserRequest) MakePasswordHash()
- func (*CreateUserRequest) ProtoMessage()
- func (x *CreateUserRequest) ProtoReflect() protoreflect.Message
- func (x *CreateUserRequest) Reset()
- func (x *CreateUserRequest) String() string
- type DescribeUserRequest
- func (*DescribeUserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DescribeUserRequest) GetName() string
- func (*DescribeUserRequest) ProtoMessage()
- func (x *DescribeUserRequest) ProtoReflect() protoreflect.Message
- func (x *DescribeUserRequest) Reset()
- func (x *DescribeUserRequest) String() string
- type RpcClient
- type RpcServer
- type Service
- type UnimplementedRpcServer
- type UnsafeRpcServer
- type User
- func (i *User) CheckPassword(password string) error
- func (*User) Descriptor() ([]byte, []int)deprecated
- func (x *User) GetMeta() *resource.Meta
- func (x *User) GetRoles() *role.RoleSet
- func (x *User) GetSpec() *CreateUserRequest
- func (*User) ProtoMessage()
- func (x *User) ProtoReflect() protoreflect.Message
- func (x *User) Reset()
- func (x *User) String() string
Constants ¶
const ( Rpc_CreateUser_FullMethodName = "/go11.devcloud_mini.user.Rpc/CreateUser" Rpc_DescribeUser_FullMethodName = "/go11.devcloud_mini.user.Rpc/DescribeUser" )
const (
AppName = "user"
)
Variables ¶
var File_mcenter_apps_user_pb_model_proto protoreflect.FileDescriptor
var File_mcenter_apps_user_pb_rpc_proto protoreflect.FileDescriptor
var Rpc_ServiceDesc = grpc.ServiceDesc{ ServiceName: "go11.devcloud_mini.user.Rpc", HandlerType: (*RpcServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateUser", Handler: _Rpc_CreateUser_Handler, }, { MethodName: "DescribeUser", Handler: _Rpc_DescribeUser_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "mcenter/apps/user/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 CreateUserRequest ¶
type CreateUserRequest struct { // 用户名 // @gotags: json:"username" bson:"username" validate:"required" Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username" bson:"username" validate:"required"` // 密码 // @gotags: json:"password" bson:"password" validate:"required" Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password" bson:"password" validate:"required"` // 用户的角色 // @gotags: json:"role_ids" bson:"role_ids" RoleIds []string `protobuf:"bytes,3,rep,name=role_ids,json=roleIds,proto3" json:"role_ids" bson:"role_ids"` // contains filtered or unexported fields }
func NewCreateUserRequest ¶
func NewCreateUserRequest() *CreateUserRequest
func (*CreateUserRequest) Descriptor
deprecated
func (*CreateUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateUserRequest.ProtoReflect.Descriptor instead.
func (*CreateUserRequest) GetPassword ¶
func (x *CreateUserRequest) GetPassword() string
func (*CreateUserRequest) GetRoleIds ¶
func (x *CreateUserRequest) GetRoleIds() []string
func (*CreateUserRequest) GetUsername ¶
func (x *CreateUserRequest) GetUsername() string
func (*CreateUserRequest) MakePasswordHash ¶
func (r *CreateUserRequest) MakePasswordHash()
func (*CreateUserRequest) ProtoMessage ¶
func (*CreateUserRequest) ProtoMessage()
func (*CreateUserRequest) ProtoReflect ¶
func (x *CreateUserRequest) ProtoReflect() protoreflect.Message
func (*CreateUserRequest) Reset ¶
func (x *CreateUserRequest) Reset()
func (*CreateUserRequest) String ¶
func (x *CreateUserRequest) String() string
type DescribeUserRequest ¶
type DescribeUserRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func NewDescribeUserRequest ¶
func NewDescribeUserRequest(name string) *DescribeUserRequest
func (*DescribeUserRequest) Descriptor
deprecated
func (*DescribeUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use DescribeUserRequest.ProtoReflect.Descriptor instead.
func (*DescribeUserRequest) GetName ¶
func (x *DescribeUserRequest) GetName() string
func (*DescribeUserRequest) ProtoMessage ¶
func (*DescribeUserRequest) ProtoMessage()
func (*DescribeUserRequest) ProtoReflect ¶
func (x *DescribeUserRequest) ProtoReflect() protoreflect.Message
func (*DescribeUserRequest) Reset ¶
func (x *DescribeUserRequest) Reset()
func (*DescribeUserRequest) String ¶
func (x *DescribeUserRequest) String() string
type RpcClient ¶
type RpcClient interface { // 创建用户 CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*User, error) // 查询用户 DescribeUser(ctx context.Context, in *DescribeUserRequest, opts ...grpc.CallOption) (*User, 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 { // 创建用户 CreateUser(context.Context, *CreateUserRequest) (*User, error) // 查询用户 DescribeUser(context.Context, *DescribeUserRequest) (*User, error) // contains filtered or unexported methods }
RpcServer is the server API for Rpc service. All implementations must embed UnimplementedRpcServer for forward compatibility
type UnimplementedRpcServer ¶
type UnimplementedRpcServer struct { }
UnimplementedRpcServer must be embedded to have forward compatible implementations.
func (UnimplementedRpcServer) CreateUser ¶
func (UnimplementedRpcServer) CreateUser(context.Context, *CreateUserRequest) (*User, error)
func (UnimplementedRpcServer) DescribeUser ¶
func (UnimplementedRpcServer) DescribeUser(context.Context, *DescribeUserRequest) (*User, 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.
type User ¶
type User struct { // 元数据信息 // @gotags: json:"meta" bson:",inline" Meta *resource.Meta `protobuf:"bytes,1,opt,name=meta,proto3" json:"meta" bson:",inline"` // 用户需要传递的请求参数 // @gotags: json:"spec" bson:",inline" Spec *CreateUserRequest `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec" bson:",inline"` // 用户管理的角色 // @gotags: json:"roles" bson:"roles" Roles *role.RoleSet `protobuf:"bytes,3,opt,name=roles,proto3" json:"roles" bson:"roles"` // contains filtered or unexported fields }
func NewUser ¶
func NewUser(in *CreateUserRequest) *User
func (*User) CheckPassword ¶
func (*User) Descriptor
deprecated
func (*User) GetSpec ¶
func (x *User) GetSpec() *CreateUserRequest
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message