Documentation ¶
Index ¶
- Variables
- func ErrorContentMissing(format string, args ...interface{}) *errors.Error
- func ErrorUserNotFound(format string, args ...interface{}) *errors.Error
- func IsContentMissing(err error) bool
- func IsUserNotFound(err error) bool
- func RegisterUserServer(s grpc.ServiceRegistrar, srv UserServer)
- type CreateUserInfo
- func (*CreateUserInfo) Descriptor() ([]byte, []int)deprecated
- func (x *CreateUserInfo) GetMobile() string
- func (x *CreateUserInfo) GetNickName() string
- func (x *CreateUserInfo) GetPassword() string
- func (*CreateUserInfo) ProtoMessage()
- func (x *CreateUserInfo) ProtoReflect() protoreflect.Message
- func (x *CreateUserInfo) Reset()
- func (x *CreateUserInfo) String() string
- func (m *CreateUserInfo) Validate() error
- type CreateUserInfoValidationError
- func (e CreateUserInfoValidationError) Cause() error
- func (e CreateUserInfoValidationError) Error() string
- func (e CreateUserInfoValidationError) ErrorName() string
- func (e CreateUserInfoValidationError) Field() string
- func (e CreateUserInfoValidationError) Key() bool
- func (e CreateUserInfoValidationError) Reason() string
- type PageInfo
- func (*PageInfo) Descriptor() ([]byte, []int)deprecated
- func (x *PageInfo) GetPageNum() uint32
- func (x *PageInfo) GetPageSize() uint32
- func (*PageInfo) ProtoMessage()
- func (x *PageInfo) ProtoReflect() protoreflect.Message
- func (x *PageInfo) Reset()
- func (x *PageInfo) String() string
- func (m *PageInfo) Validate() error
- type PageInfoValidationError
- type UnimplementedUserServer
- type UnsafeUserServer
- type UserClient
- type UserInfoResponse
- func (*UserInfoResponse) Descriptor() ([]byte, []int)deprecated
- func (x *UserInfoResponse) GetBirthday() string
- func (x *UserInfoResponse) GetGender() int32
- func (x *UserInfoResponse) GetId() int32
- func (x *UserInfoResponse) GetMobile() string
- func (x *UserInfoResponse) GetNickName() string
- func (x *UserInfoResponse) GetRole() int32
- func (*UserInfoResponse) ProtoMessage()
- func (x *UserInfoResponse) ProtoReflect() protoreflect.Message
- func (x *UserInfoResponse) Reset()
- func (x *UserInfoResponse) String() string
- func (m *UserInfoResponse) Validate() error
- type UserInfoResponseValidationError
- func (e UserInfoResponseValidationError) Cause() error
- func (e UserInfoResponseValidationError) Error() string
- func (e UserInfoResponseValidationError) ErrorName() string
- func (e UserInfoResponseValidationError) Field() string
- func (e UserInfoResponseValidationError) Key() bool
- func (e UserInfoResponseValidationError) Reason() string
- type UserResponseList
- func (*UserResponseList) Descriptor() ([]byte, []int)deprecated
- func (x *UserResponseList) GetData() []*UserInfoResponse
- func (x *UserResponseList) GetTotal() int32
- func (*UserResponseList) ProtoMessage()
- func (x *UserResponseList) ProtoReflect() protoreflect.Message
- func (x *UserResponseList) Reset()
- func (x *UserResponseList) String() string
- func (m *UserResponseList) Validate() error
- type UserResponseListValidationError
- func (e UserResponseListValidationError) Cause() error
- func (e UserResponseListValidationError) Error() string
- func (e UserResponseListValidationError) ErrorName() string
- func (e UserResponseListValidationError) Field() string
- func (e UserResponseListValidationError) Key() bool
- func (e UserResponseListValidationError) Reason() string
- type UserServer
- type UserServiceErrorReason
- func (UserServiceErrorReason) Descriptor() protoreflect.EnumDescriptor
- func (x UserServiceErrorReason) Enum() *UserServiceErrorReason
- func (UserServiceErrorReason) EnumDescriptor() ([]byte, []int)deprecated
- func (x UserServiceErrorReason) Number() protoreflect.EnumNumber
- func (x UserServiceErrorReason) String() string
- func (UserServiceErrorReason) Type() protoreflect.EnumType
Constants ¶
This section is empty.
Variables ¶
var ( UserServiceErrorReason_name = map[int32]string{ 0: "USER_NOT_FOUND", 1: "CONTENT_MISSING", } UserServiceErrorReason_value = map[string]int32{ "USER_NOT_FOUND": 0, "CONTENT_MISSING": 1, } )
Enum value maps for UserServiceErrorReason.
var File_api_user_service_v1_user_error_proto protoreflect.FileDescriptor
var File_api_user_service_v1_user_proto protoreflect.FileDescriptor
var User_ServiceDesc = grpc.ServiceDesc{ ServiceName: "user.service.v1.User", HandlerType: (*UserServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetUserList", Handler: _User_GetUserList_Handler, }, { MethodName: "CreateUser", Handler: _User_CreateUser_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "api/user/service/v1/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 ErrorUserNotFound ¶
func IsContentMissing ¶
func IsUserNotFound ¶
func RegisterUserServer ¶
func RegisterUserServer(s grpc.ServiceRegistrar, srv UserServer)
Types ¶
type CreateUserInfo ¶
type CreateUserInfo struct { NickName string `protobuf:"bytes,1,opt,name=nick_name,json=nickName,proto3" json:"nick_name,omitempty"` Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` Mobile string `protobuf:"bytes,3,opt,name=mobile,proto3" json:"mobile,omitempty"` // contains filtered or unexported fields }
func (*CreateUserInfo) Descriptor
deprecated
func (*CreateUserInfo) Descriptor() ([]byte, []int)
Deprecated: Use CreateUserInfo.ProtoReflect.Descriptor instead.
func (*CreateUserInfo) GetMobile ¶
func (x *CreateUserInfo) GetMobile() string
func (*CreateUserInfo) GetNickName ¶
func (x *CreateUserInfo) GetNickName() string
func (*CreateUserInfo) GetPassword ¶
func (x *CreateUserInfo) GetPassword() string
func (*CreateUserInfo) ProtoMessage ¶
func (*CreateUserInfo) ProtoMessage()
func (*CreateUserInfo) ProtoReflect ¶
func (x *CreateUserInfo) ProtoReflect() protoreflect.Message
func (*CreateUserInfo) Reset ¶
func (x *CreateUserInfo) Reset()
func (*CreateUserInfo) String ¶
func (x *CreateUserInfo) String() string
func (*CreateUserInfo) Validate ¶
func (m *CreateUserInfo) Validate() error
Validate checks the field values on CreateUserInfo with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type CreateUserInfoValidationError ¶
type CreateUserInfoValidationError struct {
// contains filtered or unexported fields
}
CreateUserInfoValidationError is the validation error returned by CreateUserInfo.Validate if the designated constraints aren't met.
func (CreateUserInfoValidationError) Cause ¶
func (e CreateUserInfoValidationError) Cause() error
Cause function returns cause value.
func (CreateUserInfoValidationError) Error ¶
func (e CreateUserInfoValidationError) Error() string
Error satisfies the builtin error interface
func (CreateUserInfoValidationError) ErrorName ¶
func (e CreateUserInfoValidationError) ErrorName() string
ErrorName returns error name.
func (CreateUserInfoValidationError) Field ¶
func (e CreateUserInfoValidationError) Field() string
Field function returns field value.
func (CreateUserInfoValidationError) Key ¶
func (e CreateUserInfoValidationError) Key() bool
Key function returns key value.
func (CreateUserInfoValidationError) Reason ¶
func (e CreateUserInfoValidationError) Reason() string
Reason function returns reason value.
type PageInfo ¶
type PageInfo struct { PageNum uint32 `protobuf:"varint,1,opt,name=page_num,json=pageNum,proto3" json:"page_num,omitempty"` PageSize uint32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` // contains filtered or unexported fields }
func (*PageInfo) Descriptor
deprecated
func (*PageInfo) GetPageNum ¶
func (*PageInfo) GetPageSize ¶
func (*PageInfo) ProtoMessage ¶
func (*PageInfo) ProtoMessage()
func (*PageInfo) ProtoReflect ¶
func (x *PageInfo) ProtoReflect() protoreflect.Message
type PageInfoValidationError ¶
type PageInfoValidationError struct {
// contains filtered or unexported fields
}
PageInfoValidationError is the validation error returned by PageInfo.Validate if the designated constraints aren't met.
func (PageInfoValidationError) Cause ¶
func (e PageInfoValidationError) Cause() error
Cause function returns cause value.
func (PageInfoValidationError) Error ¶
func (e PageInfoValidationError) Error() string
Error satisfies the builtin error interface
func (PageInfoValidationError) ErrorName ¶
func (e PageInfoValidationError) ErrorName() string
ErrorName returns error name.
func (PageInfoValidationError) Field ¶
func (e PageInfoValidationError) Field() string
Field function returns field value.
func (PageInfoValidationError) Key ¶
func (e PageInfoValidationError) Key() bool
Key function returns key value.
func (PageInfoValidationError) Reason ¶
func (e PageInfoValidationError) Reason() string
Reason function returns reason value.
type UnimplementedUserServer ¶
type UnimplementedUserServer struct { }
UnimplementedUserServer must be embedded to have forward compatible implementations.
func (UnimplementedUserServer) CreateUser ¶
func (UnimplementedUserServer) CreateUser(context.Context, *CreateUserInfo) (*UserInfoResponse, error)
func (UnimplementedUserServer) GetUserList ¶
func (UnimplementedUserServer) GetUserList(context.Context, *PageInfo) (*UserResponseList, 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 { GetUserList(ctx context.Context, in *PageInfo, opts ...grpc.CallOption) (*UserResponseList, error) CreateUser(ctx context.Context, in *CreateUserInfo, opts ...grpc.CallOption) (*UserInfoResponse, 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 UserInfoResponse ¶
type UserInfoResponse struct { Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Mobile string `protobuf:"bytes,2,opt,name=mobile,proto3" json:"mobile,omitempty"` NickName string `protobuf:"bytes,3,opt,name=nick_name,json=nickName,proto3" json:"nick_name,omitempty"` Birthday string `protobuf:"bytes,4,opt,name=birthday,proto3" json:"birthday,omitempty"` Gender int32 `protobuf:"varint,5,opt,name=gender,proto3" json:"gender,omitempty"` Role int32 `protobuf:"varint,6,opt,name=role,proto3" json:"role,omitempty"` // contains filtered or unexported fields }
func (*UserInfoResponse) Descriptor
deprecated
func (*UserInfoResponse) Descriptor() ([]byte, []int)
Deprecated: Use UserInfoResponse.ProtoReflect.Descriptor instead.
func (*UserInfoResponse) GetBirthday ¶
func (x *UserInfoResponse) GetBirthday() string
func (*UserInfoResponse) GetGender ¶
func (x *UserInfoResponse) GetGender() int32
func (*UserInfoResponse) GetId ¶
func (x *UserInfoResponse) GetId() int32
func (*UserInfoResponse) GetMobile ¶
func (x *UserInfoResponse) GetMobile() string
func (*UserInfoResponse) GetNickName ¶
func (x *UserInfoResponse) GetNickName() string
func (*UserInfoResponse) GetRole ¶
func (x *UserInfoResponse) GetRole() int32
func (*UserInfoResponse) ProtoMessage ¶
func (*UserInfoResponse) ProtoMessage()
func (*UserInfoResponse) ProtoReflect ¶
func (x *UserInfoResponse) ProtoReflect() protoreflect.Message
func (*UserInfoResponse) Reset ¶
func (x *UserInfoResponse) Reset()
func (*UserInfoResponse) String ¶
func (x *UserInfoResponse) String() string
func (*UserInfoResponse) Validate ¶
func (m *UserInfoResponse) Validate() error
Validate checks the field values on UserInfoResponse with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type UserInfoResponseValidationError ¶
type UserInfoResponseValidationError struct {
// contains filtered or unexported fields
}
UserInfoResponseValidationError is the validation error returned by UserInfoResponse.Validate if the designated constraints aren't met.
func (UserInfoResponseValidationError) Cause ¶
func (e UserInfoResponseValidationError) Cause() error
Cause function returns cause value.
func (UserInfoResponseValidationError) Error ¶
func (e UserInfoResponseValidationError) Error() string
Error satisfies the builtin error interface
func (UserInfoResponseValidationError) ErrorName ¶
func (e UserInfoResponseValidationError) ErrorName() string
ErrorName returns error name.
func (UserInfoResponseValidationError) Field ¶
func (e UserInfoResponseValidationError) Field() string
Field function returns field value.
func (UserInfoResponseValidationError) Key ¶
func (e UserInfoResponseValidationError) Key() bool
Key function returns key value.
func (UserInfoResponseValidationError) Reason ¶
func (e UserInfoResponseValidationError) Reason() string
Reason function returns reason value.
type UserResponseList ¶
type UserResponseList struct { Total int32 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` Data []*UserInfoResponse `protobuf:"bytes,2,rep,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*UserResponseList) Descriptor
deprecated
func (*UserResponseList) Descriptor() ([]byte, []int)
Deprecated: Use UserResponseList.ProtoReflect.Descriptor instead.
func (*UserResponseList) GetData ¶
func (x *UserResponseList) GetData() []*UserInfoResponse
func (*UserResponseList) GetTotal ¶
func (x *UserResponseList) GetTotal() int32
func (*UserResponseList) ProtoMessage ¶
func (*UserResponseList) ProtoMessage()
func (*UserResponseList) ProtoReflect ¶
func (x *UserResponseList) ProtoReflect() protoreflect.Message
func (*UserResponseList) Reset ¶
func (x *UserResponseList) Reset()
func (*UserResponseList) String ¶
func (x *UserResponseList) String() string
func (*UserResponseList) Validate ¶
func (m *UserResponseList) Validate() error
Validate checks the field values on UserResponseList with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type UserResponseListValidationError ¶
type UserResponseListValidationError struct {
// contains filtered or unexported fields
}
UserResponseListValidationError is the validation error returned by UserResponseList.Validate if the designated constraints aren't met.
func (UserResponseListValidationError) Cause ¶
func (e UserResponseListValidationError) Cause() error
Cause function returns cause value.
func (UserResponseListValidationError) Error ¶
func (e UserResponseListValidationError) Error() string
Error satisfies the builtin error interface
func (UserResponseListValidationError) ErrorName ¶
func (e UserResponseListValidationError) ErrorName() string
ErrorName returns error name.
func (UserResponseListValidationError) Field ¶
func (e UserResponseListValidationError) Field() string
Field function returns field value.
func (UserResponseListValidationError) Key ¶
func (e UserResponseListValidationError) Key() bool
Key function returns key value.
func (UserResponseListValidationError) Reason ¶
func (e UserResponseListValidationError) Reason() string
Reason function returns reason value.
type UserServer ¶
type UserServer interface { GetUserList(context.Context, *PageInfo) (*UserResponseList, error) CreateUser(context.Context, *CreateUserInfo) (*UserInfoResponse, error) // contains filtered or unexported methods }
UserServer is the server API for User service. All implementations must embed UnimplementedUserServer for forward compatibility
type UserServiceErrorReason ¶
type UserServiceErrorReason int32
const ( UserServiceErrorReason_USER_NOT_FOUND UserServiceErrorReason = 0 UserServiceErrorReason_CONTENT_MISSING UserServiceErrorReason = 1 )
func (UserServiceErrorReason) Descriptor ¶
func (UserServiceErrorReason) Descriptor() protoreflect.EnumDescriptor
func (UserServiceErrorReason) Enum ¶
func (x UserServiceErrorReason) Enum() *UserServiceErrorReason
func (UserServiceErrorReason) EnumDescriptor
deprecated
func (UserServiceErrorReason) EnumDescriptor() ([]byte, []int)
Deprecated: Use UserServiceErrorReason.Descriptor instead.
func (UserServiceErrorReason) Number ¶
func (x UserServiceErrorReason) Number() protoreflect.EnumNumber
func (UserServiceErrorReason) String ¶
func (x UserServiceErrorReason) String() string
func (UserServiceErrorReason) Type ¶
func (UserServiceErrorReason) Type() protoreflect.EnumType