Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)
- type CreateUserRequest
- func (*CreateUserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateUserRequest) GetDomain() string
- func (x *CreateUserRequest) GetPassword() string
- func (x *CreateUserRequest) GetUserName() string
- func (u *CreateUserRequest) HashPassword()
- func (*CreateUserRequest) ProtoMessage()
- func (x *CreateUserRequest) ProtoReflect() protoreflect.Message
- func (x *CreateUserRequest) Reset()
- func (x *CreateUserRequest) String() string
- func (u *CreateUserRequest) Validate() error
- type DeleteUserRequest
- type DescribeBy
- type DescribeUserRequest
- func (*DescribeUserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DescribeUserRequest) GetDescribeType() DescribeBy
- func (x *DescribeUserRequest) GetDomain() string
- func (x *DescribeUserRequest) GetId() string
- func (x *DescribeUserRequest) GetUserName() string
- func (*DescribeUserRequest) ProtoMessage()
- func (x *DescribeUserRequest) ProtoReflect() protoreflect.Message
- func (x *DescribeUserRequest) Reset()
- func (x *DescribeUserRequest) String() string
- type QueryUserRequest
- func (*QueryUserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *QueryUserRequest) GetDomain() string
- func (x *QueryUserRequest) GetKeywords() string
- func (x *QueryUserRequest) GetPage() *request.PageRequest
- func (*QueryUserRequest) ProtoMessage()
- func (x *QueryUserRequest) ProtoReflect() protoreflect.Message
- func (x *QueryUserRequest) Reset()
- func (x *QueryUserRequest) String() string
- type ServiceClient
- type ServiceServer
- type UnimplementedServiceServer
- func (UnimplementedServiceServer) CreateUser(context.Context, *CreateUserRequest) (*User, error)
- func (UnimplementedServiceServer) DeleteUser(context.Context, *DeleteUserRequest) (*User, error)
- func (UnimplementedServiceServer) DescribeUser(context.Context, *DescribeUserRequest) (*User, error)
- func (UnimplementedServiceServer) QueryUser(context.Context, *QueryUserRequest) (*UserSet, error)
- func (UnimplementedServiceServer) UpdateUser(context.Context, *UpdateUserRequest) (*User, error)
- type UnsafeServiceServer
- type UpdateUserRequest
- func (*UpdateUserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateUserRequest) GetData() *CreateUserRequest
- func (x *UpdateUserRequest) GetId() string
- func (x *UpdateUserRequest) GetUpdateAt() int64
- func (x *UpdateUserRequest) GetUpdateMode() request1.UpdateMode
- func (*UpdateUserRequest) ProtoMessage()
- func (x *UpdateUserRequest) ProtoReflect() protoreflect.Message
- func (x *UpdateUserRequest) Reset()
- func (x *UpdateUserRequest) String() string
- func (u *UpdateUserRequest) ToUser() *User
- type User
- func (u *User) CheckHash(password string) bool
- func (*User) Descriptor() ([]byte, []int)deprecated
- func (x *User) GetCreateAt() int64
- func (x *User) GetData() *CreateUserRequest
- func (x *User) GetId() string
- func (x *User) GetUpdateAt() int64
- func (*User) ProtoMessage()
- func (x *User) ProtoReflect() protoreflect.Message
- func (x *User) Reset()
- func (x *User) String() string
- type UserSet
- func (u *UserSet) Add(s *User)
- func (*UserSet) Descriptor() ([]byte, []int)deprecated
- func (x *UserSet) GetItems() []*User
- func (x *UserSet) GetTotal() int64
- func (u *UserSet) Length() int64
- func (*UserSet) ProtoMessage()
- func (x *UserSet) ProtoReflect() protoreflect.Message
- func (x *UserSet) Reset()
- func (x *UserSet) String() string
Constants ¶
const ( AppName = "user" DefaultDomain = "default" )
Variables ¶
var ( DescribeBy_name = map[int32]string{ 0: "ID", 1: "USER_NAME", } DescribeBy_value = map[string]int32{ "ID": 0, "USER_NAME": 1, } )
Enum value maps for DescribeBy.
var File_apps_user_pb_user_proto protoreflect.FileDescriptor
var Service_ServiceDesc = grpc.ServiceDesc{ ServiceName: "keyauth.user.Service", HandlerType: (*ServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateUser", Handler: _Service_CreateUser_Handler, }, { MethodName: "QueryUser", Handler: _Service_QueryUser_Handler, }, { MethodName: "DescribeUser", Handler: _Service_DescribeUser_Handler, }, { MethodName: "UpdateUser", Handler: _Service_UpdateUser_Handler, }, { MethodName: "DeleteUser", Handler: _Service_DeleteUser_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "apps/user/pb/user.proto", }
Service_ServiceDesc is the grpc.ServiceDesc for Service service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterServiceServer ¶
func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)
Types ¶
type CreateUserRequest ¶
type CreateUserRequest struct { // 创建人 // @gotags: json:"create_by" bson:"create_by" // 名称 // @gotags: json:"username" bson:"username" validate:"required" UserName string `protobuf:"bytes,2,opt,name=user_name,json=userName,proto3" json:"username" bson:"username" validate:"required"` // 作者 // @gotags: json:"password" bson:"password" validate:"required" Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password" bson:"password" validate:"required"` // @gotags: json:"domain" bson:"domain" Domain string `protobuf:"bytes,4,opt,name=domain,proto3" json:"domain" bson:"domain"` // 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) GetDomain ¶
func (x *CreateUserRequest) GetDomain() string
func (*CreateUserRequest) GetPassword ¶
func (x *CreateUserRequest) GetPassword() string
func (*CreateUserRequest) GetUserName ¶
func (x *CreateUserRequest) GetUserName() string
func (*CreateUserRequest) HashPassword ¶
func (u *CreateUserRequest) HashPassword()
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
func (*CreateUserRequest) Validate ¶
func (u *CreateUserRequest) Validate() error
type DeleteUserRequest ¶
type DeleteUserRequest struct { // user id // @gotags: json:"id" Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id"` // contains filtered or unexported fields }
func NewDeleteUserRequestWithID ¶
func NewDeleteUserRequestWithID(id string) *DeleteUserRequest
func (*DeleteUserRequest) Descriptor
deprecated
func (*DeleteUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteUserRequest.ProtoReflect.Descriptor instead.
func (*DeleteUserRequest) GetId ¶
func (x *DeleteUserRequest) GetId() string
func (*DeleteUserRequest) ProtoMessage ¶
func (*DeleteUserRequest) ProtoMessage()
func (*DeleteUserRequest) ProtoReflect ¶
func (x *DeleteUserRequest) ProtoReflect() protoreflect.Message
func (*DeleteUserRequest) Reset ¶
func (x *DeleteUserRequest) Reset()
func (*DeleteUserRequest) String ¶
func (x *DeleteUserRequest) String() string
type DescribeBy ¶
type DescribeBy int32
const ( DescribeBy_ID DescribeBy = 0 DescribeBy_USER_NAME DescribeBy = 1 )
func (DescribeBy) Descriptor ¶
func (DescribeBy) Descriptor() protoreflect.EnumDescriptor
func (DescribeBy) Enum ¶
func (x DescribeBy) Enum() *DescribeBy
func (DescribeBy) EnumDescriptor
deprecated
func (DescribeBy) EnumDescriptor() ([]byte, []int)
Deprecated: Use DescribeBy.Descriptor instead.
func (DescribeBy) Number ¶
func (x DescribeBy) Number() protoreflect.EnumNumber
func (DescribeBy) String ¶
func (x DescribeBy) String() string
func (DescribeBy) Type ¶
func (DescribeBy) Type() protoreflect.EnumType
type DescribeUserRequest ¶
type DescribeUserRequest struct { // user id // @gotags: json:"id" Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id"` // @gotags: json:"user_name" UserName string `protobuf:"bytes,2,opt,name=user_name,json=userName,proto3" json:"user_name"` // @gotags: json:"domain" Domain string `protobuf:"bytes,3,opt,name=domain,proto3" json:"domain"` // @gotags: json:"describe_type" DescribeType DescribeBy `protobuf:"varint,4,opt,name=describe_type,json=describeType,proto3,enum=keyauth.user.DescribeBy" json:"describe_type"` // contains filtered or unexported fields }
func NewDescribeByID ¶
func NewDescribeByID(id string) *DescribeUserRequest
func NewDescribeByName ¶
func NewDescribeByName(username, domain string) *DescribeUserRequest
func NewDescribeUserRequest ¶
func NewDescribeUserRequest(id string) *DescribeUserRequest
func (*DescribeUserRequest) Descriptor
deprecated
func (*DescribeUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use DescribeUserRequest.ProtoReflect.Descriptor instead.
func (*DescribeUserRequest) GetDescribeType ¶
func (x *DescribeUserRequest) GetDescribeType() DescribeBy
func (*DescribeUserRequest) GetDomain ¶
func (x *DescribeUserRequest) GetDomain() string
func (*DescribeUserRequest) GetId ¶
func (x *DescribeUserRequest) GetId() string
func (*DescribeUserRequest) GetUserName ¶
func (x *DescribeUserRequest) GetUserName() 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 QueryUserRequest ¶
type QueryUserRequest struct { // 分页参数 // @gotags: json:"page" Page *request.PageRequest `protobuf:"bytes,1,opt,name=page,proto3" json:"page"` // 关键字参数 // @gotags: json:"keywords" Keywords string `protobuf:"bytes,2,opt,name=keywords,proto3" json:"keywords"` // @gotags: json:"domain" Domain string `protobuf:"bytes,3,opt,name=domain,proto3" json:"domain"` // contains filtered or unexported fields }
func NewQueryUserRequestFromHTTP ¶
func NewQueryUserRequestFromHTTP(r *http.Request) *QueryUserRequest
func (*QueryUserRequest) Descriptor
deprecated
func (*QueryUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use QueryUserRequest.ProtoReflect.Descriptor instead.
func (*QueryUserRequest) GetDomain ¶
func (x *QueryUserRequest) GetDomain() string
func (*QueryUserRequest) GetKeywords ¶
func (x *QueryUserRequest) GetKeywords() string
func (*QueryUserRequest) GetPage ¶
func (x *QueryUserRequest) GetPage() *request.PageRequest
func (*QueryUserRequest) ProtoMessage ¶
func (*QueryUserRequest) ProtoMessage()
func (*QueryUserRequest) ProtoReflect ¶
func (x *QueryUserRequest) ProtoReflect() protoreflect.Message
func (*QueryUserRequest) Reset ¶
func (x *QueryUserRequest) Reset()
func (*QueryUserRequest) String ¶
func (x *QueryUserRequest) String() string
type ServiceClient ¶
type ServiceClient interface { CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*User, error) QueryUser(ctx context.Context, in *QueryUserRequest, opts ...grpc.CallOption) (*UserSet, error) DescribeUser(ctx context.Context, in *DescribeUserRequest, opts ...grpc.CallOption) (*User, error) UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*User, error) DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*User, error) }
ServiceClient is the client API for Service 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 NewServiceClient ¶
func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient
type ServiceServer ¶
type ServiceServer interface { CreateUser(context.Context, *CreateUserRequest) (*User, error) QueryUser(context.Context, *QueryUserRequest) (*UserSet, error) DescribeUser(context.Context, *DescribeUserRequest) (*User, error) UpdateUser(context.Context, *UpdateUserRequest) (*User, error) DeleteUser(context.Context, *DeleteUserRequest) (*User, error) // contains filtered or unexported methods }
ServiceServer is the server API for Service service. All implementations must embed UnimplementedServiceServer for forward compatibility
type UnimplementedServiceServer ¶
type UnimplementedServiceServer struct { }
UnimplementedServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedServiceServer) CreateUser ¶
func (UnimplementedServiceServer) CreateUser(context.Context, *CreateUserRequest) (*User, error)
func (UnimplementedServiceServer) DeleteUser ¶
func (UnimplementedServiceServer) DeleteUser(context.Context, *DeleteUserRequest) (*User, error)
func (UnimplementedServiceServer) DescribeUser ¶
func (UnimplementedServiceServer) DescribeUser(context.Context, *DescribeUserRequest) (*User, error)
func (UnimplementedServiceServer) QueryUser ¶
func (UnimplementedServiceServer) QueryUser(context.Context, *QueryUserRequest) (*UserSet, error)
func (UnimplementedServiceServer) UpdateUser ¶
func (UnimplementedServiceServer) UpdateUser(context.Context, *UpdateUserRequest) (*User, error)
type UnsafeServiceServer ¶
type UnsafeServiceServer interface {
// contains filtered or unexported methods
}
UnsafeServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ServiceServer will result in compilation errors.
type UpdateUserRequest ¶
type UpdateUserRequest struct { // user id // @gotags: json:"id" Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id"` // 更新模式 // @gotags: json:"update_mode" UpdateMode request1.UpdateMode `protobuf:"varint,2,opt,name=update_mode,json=updateMode,proto3,enum=infraboard.mcube.request.UpdateMode" json:"update_mode"` // 更新时间 // @gotags: json:"update_at" UpdateAt int64 `protobuf:"varint,4,opt,name=update_at,json=updateAt,proto3" json:"update_at"` // 更新的书本信息 // @gotags: json:"data" Data *CreateUserRequest `protobuf:"bytes,5,opt,name=data,proto3" json:"data"` // contains filtered or unexported fields }
func NewPatchUserRequest ¶
func NewPatchUserRequest(id string) *UpdateUserRequest
func NewPutUserRequest ¶
func NewPutUserRequest(id string) *UpdateUserRequest
func (*UpdateUserRequest) Descriptor
deprecated
func (*UpdateUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdateUserRequest.ProtoReflect.Descriptor instead.
func (*UpdateUserRequest) GetData ¶
func (x *UpdateUserRequest) GetData() *CreateUserRequest
func (*UpdateUserRequest) GetId ¶
func (x *UpdateUserRequest) GetId() string
func (*UpdateUserRequest) GetUpdateAt ¶
func (x *UpdateUserRequest) GetUpdateAt() int64
func (*UpdateUserRequest) GetUpdateMode ¶
func (x *UpdateUserRequest) GetUpdateMode() request1.UpdateMode
func (*UpdateUserRequest) ProtoMessage ¶
func (*UpdateUserRequest) ProtoMessage()
func (*UpdateUserRequest) ProtoReflect ¶
func (x *UpdateUserRequest) ProtoReflect() protoreflect.Message
func (*UpdateUserRequest) Reset ¶
func (x *UpdateUserRequest) Reset()
func (*UpdateUserRequest) String ¶
func (x *UpdateUserRequest) String() string
func (*UpdateUserRequest) ToUser ¶
func (u *UpdateUserRequest) ToUser() *User
type User ¶
type User struct { // 唯一ID // @gotags: json:"id" bson:"_id" Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` // 录入时间 // @gotags: json:"create_at" bson:"create_at" CreateAt int64 `protobuf:"varint,2,opt,name=create_at,json=createAt,proto3" json:"create_at" bson:"create_at"` // 更新时间 // @gotags: json:"update_at" bson:"update_at" UpdateAt int64 `protobuf:"varint,3,opt,name=update_at,json=updateAt,proto3" json:"update_at" bson:"update_at"` // 更新人 // 书本信息 // @gotags: json:"data" bson:"data" Data *CreateUserRequest `protobuf:"bytes,5,opt,name=data,proto3" json:"data" bson:"data"` // contains filtered or unexported fields }
User todo
func NewDefaultUser ¶
func NewDefaultUser(req *CreateUserRequest) *User
func (*User) Descriptor
deprecated
func (*User) GetCreateAt ¶
func (*User) GetData ¶
func (x *User) GetData() *CreateUserRequest
func (*User) GetUpdateAt ¶
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message
type UserSet ¶
type UserSet struct { // 分页时,返回总数量 // @gotags: json:"total" Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total"` // 一页的数据 // @gotags: json:"items" Items []*User `protobuf:"bytes,2,rep,name=items,proto3" json:"items"` // contains filtered or unexported fields }
UserSet todo
func NewUserSet ¶
func NewUserSet() *UserSet
func (*UserSet) Descriptor
deprecated
func (*UserSet) ProtoMessage ¶
func (*UserSet) ProtoMessage()
func (*UserSet) ProtoReflect ¶
func (x *UserSet) ProtoReflect() protoreflect.Message