Documentation ¶
Index ¶
- Variables
- func ErrorContentMissing(format string, args ...interface{}) *errors.Error
- func ErrorUserHasExist(format string, args ...interface{}) *errors.Error
- func ErrorUserNotFound(format string, args ...interface{}) *errors.Error
- func IsContentMissing(err error) bool
- func IsUserHasExist(err error) bool
- func IsUserNotFound(err error) bool
- func RegisterUserServer(s grpc.ServiceRegistrar, srv UserServer)
- type ErrorReason
- func (ErrorReason) Descriptor() protoreflect.EnumDescriptor
- func (x ErrorReason) Enum() *ErrorReason
- func (ErrorReason) EnumDescriptor() ([]byte, []int)deprecated
- func (x ErrorReason) Number() protoreflect.EnumNumber
- func (x ErrorReason) String() string
- func (ErrorReason) Type() protoreflect.EnumType
- type Menu
- func (*Menu) Descriptor() ([]byte, []int)deprecated
- func (x *Menu) GetChild() *Menu
- func (x *Menu) GetIcon() string
- func (x *Menu) GetMenuId() int64
- func (x *Menu) GetName() string
- func (x *Menu) GetPath() string
- func (x *Menu) GetPermission() string
- func (x *Menu) GetType() string
- func (*Menu) ProtoMessage()
- func (x *Menu) ProtoReflect() protoreflect.Message
- func (x *Menu) Reset()
- func (x *Menu) String() string
- func (m *Menu) Validate() error
- func (m *Menu) ValidateAll() error
- type MenuMultiError
- type MenuValidationError
- type Role
- func (*Role) Descriptor() ([]byte, []int)deprecated
- func (x *Role) GetKey() string
- func (x *Role) GetName() string
- func (x *Role) GetRoleId() int64
- func (*Role) ProtoMessage()
- func (x *Role) ProtoReflect() protoreflect.Message
- func (x *Role) Reset()
- func (x *Role) String() string
- func (m *Role) Validate() error
- func (m *Role) ValidateAll() error
- type RoleMultiError
- type RoleValidationError
- type UnimplementedUserServer
- type UnsafeUserServer
- type UserClient
- type UserInfo
- func (*UserInfo) Descriptor() ([]byte, []int)deprecated
- func (x *UserInfo) GetMenus() []*Menu
- func (x *UserInfo) GetPassword() string
- func (x *UserInfo) GetPhone() string
- func (x *UserInfo) GetRoles() []*Role
- func (x *UserInfo) GetUserId() int64
- func (x *UserInfo) GetUsername() string
- func (*UserInfo) ProtoMessage()
- func (x *UserInfo) ProtoReflect() protoreflect.Message
- func (x *UserInfo) Reset()
- func (x *UserInfo) String() string
- func (m *UserInfo) Validate() error
- func (m *UserInfo) ValidateAll() error
- type UserInfoMultiError
- type UserInfoValidationError
- type UserServer
- type UsernameRequest
- func (*UsernameRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UsernameRequest) GetReq() *UsernameRequest
- func (x *UsernameRequest) GetUsername() string
- func (*UsernameRequest) ProtoMessage()
- func (x *UsernameRequest) ProtoReflect() protoreflect.Message
- func (x *UsernameRequest) Reset()
- func (x *UsernameRequest) String() string
- func (m *UsernameRequest) Validate() error
- func (m *UsernameRequest) ValidateAll() error
- type UsernameRequestMultiError
- type UsernameRequestValidationError
- func (e UsernameRequestValidationError) Cause() error
- func (e UsernameRequestValidationError) Error() string
- func (e UsernameRequestValidationError) ErrorName() string
- func (e UsernameRequestValidationError) Field() string
- func (e UsernameRequestValidationError) Key() bool
- func (e UsernameRequestValidationError) Reason() string
Constants ¶
This section is empty.
Variables ¶
var ( ErrorReason_name = map[int32]string{ 0: "USER_NOT_FOUND", 1: "CONTENT_MISSING", 2: "User_HAS_EXIST", } ErrorReason_value = map[string]int32{ "USER_NOT_FOUND": 0, "CONTENT_MISSING": 1, "User_HAS_EXIST": 2, } )
Enum value maps for ErrorReason.
var File_api_user_error_reason_proto protoreflect.FileDescriptor
var File_api_user_user_proto protoreflect.FileDescriptor
var User_ServiceDesc = grpc.ServiceDesc{ ServiceName: "api.user.User", HandlerType: (*UserServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "InfoByUsername", Handler: _User_InfoByUsername_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "api/user/user.proto", }
User_ServiceDesc is the grpc.ServiceDesc for User service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func ErrorContentMissing ¶
func ErrorUserHasExist ¶
func ErrorUserNotFound ¶
func IsContentMissing ¶
func IsUserHasExist ¶
func IsUserNotFound ¶
func RegisterUserServer ¶
func RegisterUserServer(s grpc.ServiceRegistrar, srv UserServer)
Types ¶
type ErrorReason ¶
type ErrorReason int32
const ( ErrorReason_USER_NOT_FOUND ErrorReason = 0 ErrorReason_CONTENT_MISSING ErrorReason = 1 ErrorReason_User_HAS_EXIST ErrorReason = 2 )
func (ErrorReason) Descriptor ¶
func (ErrorReason) Descriptor() protoreflect.EnumDescriptor
func (ErrorReason) Enum ¶
func (x ErrorReason) Enum() *ErrorReason
func (ErrorReason) EnumDescriptor
deprecated
func (ErrorReason) EnumDescriptor() ([]byte, []int)
Deprecated: Use ErrorReason.Descriptor instead.
func (ErrorReason) Number ¶
func (x ErrorReason) Number() protoreflect.EnumNumber
func (ErrorReason) String ¶
func (x ErrorReason) String() string
func (ErrorReason) Type ¶
func (ErrorReason) Type() protoreflect.EnumType
type Menu ¶
type Menu struct { MenuId int64 `protobuf:"varint,1,opt,name=menu_id,json=menuId,proto3" json:"menu_id,omitempty"` Permission string `protobuf:"bytes,2,opt,name=permission,proto3" json:"permission,omitempty"` Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` Path string `protobuf:"bytes,4,opt,name=path,proto3" json:"path,omitempty"` Type string `protobuf:"bytes,5,opt,name=type,proto3" json:"type,omitempty"` Icon string `protobuf:"bytes,6,opt,name=icon,proto3" json:"icon,omitempty"` Child *Menu `protobuf:"bytes,7,opt,name=child,proto3" json:"child,omitempty"` // contains filtered or unexported fields }
func (*Menu) Descriptor
deprecated
func (*Menu) GetPermission ¶
func (*Menu) ProtoMessage ¶
func (*Menu) ProtoMessage()
func (*Menu) ProtoReflect ¶
func (x *Menu) ProtoReflect() protoreflect.Message
func (*Menu) Validate ¶
Validate checks the field values on Menu with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*Menu) ValidateAll ¶
ValidateAll checks the field values on Menu with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in MenuMultiError, or nil if none found.
type MenuMultiError ¶
type MenuMultiError []error
MenuMultiError is an error wrapping multiple validation errors returned by Menu.ValidateAll() if the designated constraints aren't met.
func (MenuMultiError) AllErrors ¶
func (m MenuMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (MenuMultiError) Error ¶
func (m MenuMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type MenuValidationError ¶
type MenuValidationError struct {
// contains filtered or unexported fields
}
MenuValidationError is the validation error returned by Menu.Validate if the designated constraints aren't met.
func (MenuValidationError) Cause ¶
func (e MenuValidationError) Cause() error
Cause function returns cause value.
func (MenuValidationError) Error ¶
func (e MenuValidationError) Error() string
Error satisfies the builtin error interface
func (MenuValidationError) ErrorName ¶
func (e MenuValidationError) ErrorName() string
ErrorName returns error name.
func (MenuValidationError) Field ¶
func (e MenuValidationError) Field() string
Field function returns field value.
func (MenuValidationError) Key ¶
func (e MenuValidationError) Key() bool
Key function returns key value.
func (MenuValidationError) Reason ¶
func (e MenuValidationError) Reason() string
Reason function returns reason value.
type Role ¶
type Role struct { RoleId int64 `protobuf:"varint,1,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*Role) Descriptor
deprecated
func (*Role) ProtoMessage ¶
func (*Role) ProtoMessage()
func (*Role) ProtoReflect ¶
func (x *Role) ProtoReflect() protoreflect.Message
func (*Role) Validate ¶
Validate checks the field values on Role with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*Role) ValidateAll ¶
ValidateAll checks the field values on Role with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in RoleMultiError, or nil if none found.
type RoleMultiError ¶
type RoleMultiError []error
RoleMultiError is an error wrapping multiple validation errors returned by Role.ValidateAll() if the designated constraints aren't met.
func (RoleMultiError) AllErrors ¶
func (m RoleMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (RoleMultiError) Error ¶
func (m RoleMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type RoleValidationError ¶
type RoleValidationError struct {
// contains filtered or unexported fields
}
RoleValidationError is the validation error returned by Role.Validate if the designated constraints aren't met.
func (RoleValidationError) Cause ¶
func (e RoleValidationError) Cause() error
Cause function returns cause value.
func (RoleValidationError) Error ¶
func (e RoleValidationError) Error() string
Error satisfies the builtin error interface
func (RoleValidationError) ErrorName ¶
func (e RoleValidationError) ErrorName() string
ErrorName returns error name.
func (RoleValidationError) Field ¶
func (e RoleValidationError) Field() string
Field function returns field value.
func (RoleValidationError) Key ¶
func (e RoleValidationError) Key() bool
Key function returns key value.
func (RoleValidationError) Reason ¶
func (e RoleValidationError) Reason() string
Reason function returns reason value.
type UnimplementedUserServer ¶
type UnimplementedUserServer struct { }
UnimplementedUserServer must be embedded to have forward compatible implementations.
func (UnimplementedUserServer) InfoByUsername ¶
func (UnimplementedUserServer) InfoByUsername(context.Context, *UsernameRequest) (*UserInfo, error)
type UnsafeUserServer ¶
type UnsafeUserServer interface {
// contains filtered or unexported methods
}
UnsafeUserServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to UserServer will result in compilation errors.
type UserClient ¶
type UserClient interface {
InfoByUsername(ctx context.Context, in *UsernameRequest, opts ...grpc.CallOption) (*UserInfo, error)
}
UserClient is the client API for User 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 NewUserClient ¶
func NewUserClient(cc grpc.ClientConnInterface) UserClient
type UserInfo ¶
type UserInfo struct { UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"` Phone string `protobuf:"bytes,4,opt,name=phone,proto3" json:"phone,omitempty"` Roles []*Role `protobuf:"bytes,5,rep,name=roles,proto3" json:"roles,omitempty"` Menus []*Menu `protobuf:"bytes,6,rep,name=menus,proto3" json:"menus,omitempty"` // contains filtered or unexported fields }
func (*UserInfo) Descriptor
deprecated
func (*UserInfo) GetPassword ¶
func (*UserInfo) GetUsername ¶
func (*UserInfo) ProtoMessage ¶
func (*UserInfo) ProtoMessage()
func (*UserInfo) ProtoReflect ¶
func (x *UserInfo) ProtoReflect() protoreflect.Message
func (*UserInfo) Validate ¶
Validate checks the field values on UserInfo with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*UserInfo) ValidateAll ¶
ValidateAll checks the field values on UserInfo with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in UserInfoMultiError, or nil if none found.
type UserInfoMultiError ¶
type UserInfoMultiError []error
UserInfoMultiError is an error wrapping multiple validation errors returned by UserInfo.ValidateAll() if the designated constraints aren't met.
func (UserInfoMultiError) AllErrors ¶
func (m UserInfoMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (UserInfoMultiError) Error ¶
func (m UserInfoMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type UserInfoValidationError ¶
type UserInfoValidationError struct {
// contains filtered or unexported fields
}
UserInfoValidationError is the validation error returned by UserInfo.Validate if the designated constraints aren't met.
func (UserInfoValidationError) Cause ¶
func (e UserInfoValidationError) Cause() error
Cause function returns cause value.
func (UserInfoValidationError) Error ¶
func (e UserInfoValidationError) Error() string
Error satisfies the builtin error interface
func (UserInfoValidationError) ErrorName ¶
func (e UserInfoValidationError) ErrorName() string
ErrorName returns error name.
func (UserInfoValidationError) Field ¶
func (e UserInfoValidationError) Field() string
Field function returns field value.
func (UserInfoValidationError) Key ¶
func (e UserInfoValidationError) Key() bool
Key function returns key value.
func (UserInfoValidationError) Reason ¶
func (e UserInfoValidationError) Reason() string
Reason function returns reason value.
type UserServer ¶
type UserServer interface { InfoByUsername(context.Context, *UsernameRequest) (*UserInfo, error) // contains filtered or unexported methods }
UserServer is the server API for User service. All implementations must embed UnimplementedUserServer for forward compatibility
type UsernameRequest ¶
type UsernameRequest struct { Req *UsernameRequest `protobuf:"bytes,11,opt,name=req,proto3" json:"req,omitempty"` Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` // contains filtered or unexported fields }
func (*UsernameRequest) Descriptor
deprecated
func (*UsernameRequest) Descriptor() ([]byte, []int)
Deprecated: Use UsernameRequest.ProtoReflect.Descriptor instead.
func (*UsernameRequest) GetReq ¶
func (x *UsernameRequest) GetReq() *UsernameRequest
func (*UsernameRequest) GetUsername ¶
func (x *UsernameRequest) GetUsername() string
func (*UsernameRequest) ProtoMessage ¶
func (*UsernameRequest) ProtoMessage()
func (*UsernameRequest) ProtoReflect ¶
func (x *UsernameRequest) ProtoReflect() protoreflect.Message
func (*UsernameRequest) Reset ¶
func (x *UsernameRequest) Reset()
func (*UsernameRequest) String ¶
func (x *UsernameRequest) String() string
func (*UsernameRequest) Validate ¶
func (m *UsernameRequest) Validate() error
Validate checks the field values on UsernameRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*UsernameRequest) ValidateAll ¶
func (m *UsernameRequest) ValidateAll() error
ValidateAll checks the field values on UsernameRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in UsernameRequestMultiError, or nil if none found.
type UsernameRequestMultiError ¶
type UsernameRequestMultiError []error
UsernameRequestMultiError is an error wrapping multiple validation errors returned by UsernameRequest.ValidateAll() if the designated constraints aren't met.
func (UsernameRequestMultiError) AllErrors ¶
func (m UsernameRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (UsernameRequestMultiError) Error ¶
func (m UsernameRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type UsernameRequestValidationError ¶
type UsernameRequestValidationError struct {
// contains filtered or unexported fields
}
UsernameRequestValidationError is the validation error returned by UsernameRequest.Validate if the designated constraints aren't met.
func (UsernameRequestValidationError) Cause ¶
func (e UsernameRequestValidationError) Cause() error
Cause function returns cause value.
func (UsernameRequestValidationError) Error ¶
func (e UsernameRequestValidationError) Error() string
Error satisfies the builtin error interface
func (UsernameRequestValidationError) ErrorName ¶
func (e UsernameRequestValidationError) ErrorName() string
ErrorName returns error name.
func (UsernameRequestValidationError) Field ¶
func (e UsernameRequestValidationError) Field() string
Field function returns field value.
func (UsernameRequestValidationError) Key ¶
func (e UsernameRequestValidationError) Key() bool
Key function returns key value.
func (UsernameRequestValidationError) Reason ¶
func (e UsernameRequestValidationError) Reason() string
Reason function returns reason value.