Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterUserHTTPServer(s *http.Server, srv UserHTTPServer)
- func RegisterUserServer(s grpc.ServiceRegistrar, srv UserServer)
- type GetUserByPhoneRequest
- func (*GetUserByPhoneRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetUserByPhoneRequest) GetPhone() string
- func (*GetUserByPhoneRequest) ProtoMessage()
- func (x *GetUserByPhoneRequest) ProtoReflect() protoreflect.Message
- func (x *GetUserByPhoneRequest) Reset()
- func (x *GetUserByPhoneRequest) String() string
- type LoginRequest
- func (*LoginRequest) Descriptor() ([]byte, []int)deprecated
- func (x *LoginRequest) GetPassword() string
- func (x *LoginRequest) GetUsername() string
- func (*LoginRequest) ProtoMessage()
- func (x *LoginRequest) ProtoReflect() protoreflect.Message
- func (x *LoginRequest) Reset()
- func (x *LoginRequest) String() string
- type RegisterRequest
- func (*RegisterRequest) Descriptor() ([]byte, []int)deprecated
- func (x *RegisterRequest) GetPassword() string
- func (x *RegisterRequest) GetPhone() string
- func (x *RegisterRequest) GetUsername() string
- func (*RegisterRequest) ProtoMessage()
- func (x *RegisterRequest) ProtoReflect() protoreflect.Message
- func (x *RegisterRequest) Reset()
- func (x *RegisterRequest) String() string
- type UnimplementedUserServer
- func (UnimplementedUserServer) GetUserByPhone(context.Context, *GetUserByPhoneRequest) (*UserReply, error)
- func (UnimplementedUserServer) Login(context.Context, *LoginRequest) (*UserReply, error)
- func (UnimplementedUserServer) Register(context.Context, *RegisterRequest) (*UserReply, error)
- func (UnimplementedUserServer) UpdateUser(context.Context, *UpdateUserRequest) (*UserReply, error)
- type UnsafeUserServer
- type UpdateUserRequest
- func (*UpdateUserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateUserRequest) GetId() int64
- func (x *UpdateUserRequest) GetPassword() string
- func (x *UpdateUserRequest) GetPhone() string
- func (x *UpdateUserRequest) GetUsername() string
- func (*UpdateUserRequest) ProtoMessage()
- func (x *UpdateUserRequest) ProtoReflect() protoreflect.Message
- func (x *UpdateUserRequest) Reset()
- func (x *UpdateUserRequest) String() string
- type UserClient
- type UserErrorReason
- func (UserErrorReason) Descriptor() protoreflect.EnumDescriptor
- func (x UserErrorReason) Enum() *UserErrorReason
- func (UserErrorReason) EnumDescriptor() ([]byte, []int)deprecated
- func (x UserErrorReason) Number() protoreflect.EnumNumber
- func (x UserErrorReason) String() string
- func (UserErrorReason) Type() protoreflect.EnumType
- type UserHTTPClient
- type UserHTTPClientImpl
- func (c *UserHTTPClientImpl) GetUserByPhone(ctx context.Context, in *GetUserByPhoneRequest, opts ...http.CallOption) (*UserReply, error)
- func (c *UserHTTPClientImpl) Login(ctx context.Context, in *LoginRequest, opts ...http.CallOption) (*UserReply, error)
- func (c *UserHTTPClientImpl) Register(ctx context.Context, in *RegisterRequest, opts ...http.CallOption) (*UserReply, error)
- func (c *UserHTTPClientImpl) UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...http.CallOption) (*UserReply, error)
- type UserHTTPServer
- type UserInfo
- func (*UserInfo) Descriptor() ([]byte, []int)deprecated
- func (x *UserInfo) GetCreatedAt() *timestamppb.Timestamp
- func (x *UserInfo) GetId() int64
- func (x *UserInfo) GetPassword() string
- func (x *UserInfo) GetPhone() string
- func (x *UserInfo) GetUpdatedAt() *timestamppb.Timestamp
- func (x *UserInfo) GetUsername() string
- func (*UserInfo) ProtoMessage()
- func (x *UserInfo) ProtoReflect() protoreflect.Message
- func (x *UserInfo) Reset()
- func (x *UserInfo) String() string
- type UserReply
- type UserServer
Constants ¶
const OperationUserGetUserByPhone = "/user.v1.User/GetUserByPhone"
const OperationUserLogin = "/user.v1.User/Login"
const OperationUserRegister = "/user.v1.User/Register"
const OperationUserUpdateUser = "/user.v1.User/UpdateUser"
Variables ¶
var ( UserErrorReason_name = map[int32]string{ 0: "GREETER_UNSPECIFIED", 1: "USER_NOT_FOUND", } UserErrorReason_value = map[string]int32{ "GREETER_UNSPECIFIED": 0, "USER_NOT_FOUND": 1, } )
Enum value maps for UserErrorReason.
var File_user_v1_user_error_reason_proto protoreflect.FileDescriptor
var File_user_v1_user_proto protoreflect.FileDescriptor
var User_ServiceDesc = grpc.ServiceDesc{ ServiceName: "user.v1.User", HandlerType: (*UserServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Register", Handler: _User_Register_Handler, }, { MethodName: "Login", Handler: _User_Login_Handler, }, { MethodName: "GetUserByPhone", Handler: _User_GetUserByPhone_Handler, }, { MethodName: "UpdateUser", Handler: _User_UpdateUser_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "user/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 RegisterUserHTTPServer ¶
func RegisterUserHTTPServer(s *http.Server, srv UserHTTPServer)
func RegisterUserServer ¶
func RegisterUserServer(s grpc.ServiceRegistrar, srv UserServer)
Types ¶
type GetUserByPhoneRequest ¶
type GetUserByPhoneRequest struct { Phone string `protobuf:"bytes,1,opt,name=phone,proto3" json:"phone,omitempty"` // contains filtered or unexported fields }
func (*GetUserByPhoneRequest) Descriptor
deprecated
func (*GetUserByPhoneRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetUserByPhoneRequest.ProtoReflect.Descriptor instead.
func (*GetUserByPhoneRequest) GetPhone ¶
func (x *GetUserByPhoneRequest) GetPhone() string
func (*GetUserByPhoneRequest) ProtoMessage ¶
func (*GetUserByPhoneRequest) ProtoMessage()
func (*GetUserByPhoneRequest) ProtoReflect ¶
func (x *GetUserByPhoneRequest) ProtoReflect() protoreflect.Message
func (*GetUserByPhoneRequest) Reset ¶
func (x *GetUserByPhoneRequest) Reset()
func (*GetUserByPhoneRequest) String ¶
func (x *GetUserByPhoneRequest) String() string
type LoginRequest ¶
type LoginRequest struct { Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` // contains filtered or unexported fields }
func (*LoginRequest) Descriptor
deprecated
func (*LoginRequest) Descriptor() ([]byte, []int)
Deprecated: Use LoginRequest.ProtoReflect.Descriptor instead.
func (*LoginRequest) GetPassword ¶
func (x *LoginRequest) GetPassword() string
func (*LoginRequest) GetUsername ¶
func (x *LoginRequest) GetUsername() string
func (*LoginRequest) ProtoMessage ¶
func (*LoginRequest) ProtoMessage()
func (*LoginRequest) ProtoReflect ¶
func (x *LoginRequest) ProtoReflect() protoreflect.Message
func (*LoginRequest) Reset ¶
func (x *LoginRequest) Reset()
func (*LoginRequest) String ¶
func (x *LoginRequest) String() string
type RegisterRequest ¶
type RegisterRequest struct { Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` Phone string `protobuf:"bytes,2,opt,name=phone,proto3" json:"phone,omitempty"` Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"` // contains filtered or unexported fields }
func (*RegisterRequest) Descriptor
deprecated
func (*RegisterRequest) Descriptor() ([]byte, []int)
Deprecated: Use RegisterRequest.ProtoReflect.Descriptor instead.
func (*RegisterRequest) GetPassword ¶
func (x *RegisterRequest) GetPassword() string
func (*RegisterRequest) GetPhone ¶
func (x *RegisterRequest) GetPhone() string
func (*RegisterRequest) GetUsername ¶
func (x *RegisterRequest) GetUsername() string
func (*RegisterRequest) ProtoMessage ¶
func (*RegisterRequest) ProtoMessage()
func (*RegisterRequest) ProtoReflect ¶
func (x *RegisterRequest) ProtoReflect() protoreflect.Message
func (*RegisterRequest) Reset ¶
func (x *RegisterRequest) Reset()
func (*RegisterRequest) String ¶
func (x *RegisterRequest) String() string
type UnimplementedUserServer ¶
type UnimplementedUserServer struct { }
UnimplementedUserServer must be embedded to have forward compatible implementations.
func (UnimplementedUserServer) GetUserByPhone ¶
func (UnimplementedUserServer) GetUserByPhone(context.Context, *GetUserByPhoneRequest) (*UserReply, error)
func (UnimplementedUserServer) Login ¶
func (UnimplementedUserServer) Login(context.Context, *LoginRequest) (*UserReply, error)
func (UnimplementedUserServer) Register ¶
func (UnimplementedUserServer) Register(context.Context, *RegisterRequest) (*UserReply, error)
func (UnimplementedUserServer) UpdateUser ¶
func (UnimplementedUserServer) UpdateUser(context.Context, *UpdateUserRequest) (*UserReply, 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 UpdateUserRequest ¶
type UpdateUserRequest struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` Phone string `protobuf:"bytes,3,opt,name=phone,proto3" json:"phone,omitempty"` Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"` // contains filtered or unexported fields }
func (*UpdateUserRequest) Descriptor
deprecated
func (*UpdateUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdateUserRequest.ProtoReflect.Descriptor instead.
func (*UpdateUserRequest) GetId ¶
func (x *UpdateUserRequest) GetId() int64
func (*UpdateUserRequest) GetPassword ¶
func (x *UpdateUserRequest) GetPassword() string
func (*UpdateUserRequest) GetPhone ¶
func (x *UpdateUserRequest) GetPhone() string
func (*UpdateUserRequest) GetUsername ¶
func (x *UpdateUserRequest) GetUsername() string
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
type UserClient ¶
type UserClient interface { Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*UserReply, error) Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*UserReply, error) GetUserByPhone(ctx context.Context, in *GetUserByPhoneRequest, opts ...grpc.CallOption) (*UserReply, error) UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*UserReply, 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 UserErrorReason ¶
type UserErrorReason int32
const ( UserErrorReason_GREETER_UNSPECIFIED UserErrorReason = 0 UserErrorReason_USER_NOT_FOUND UserErrorReason = 1 )
func (UserErrorReason) Descriptor ¶
func (UserErrorReason) Descriptor() protoreflect.EnumDescriptor
func (UserErrorReason) Enum ¶
func (x UserErrorReason) Enum() *UserErrorReason
func (UserErrorReason) EnumDescriptor
deprecated
func (UserErrorReason) EnumDescriptor() ([]byte, []int)
Deprecated: Use UserErrorReason.Descriptor instead.
func (UserErrorReason) Number ¶
func (x UserErrorReason) Number() protoreflect.EnumNumber
func (UserErrorReason) String ¶
func (x UserErrorReason) String() string
func (UserErrorReason) Type ¶
func (UserErrorReason) Type() protoreflect.EnumType
type UserHTTPClient ¶
type UserHTTPClient interface { GetUserByPhone(ctx context.Context, req *GetUserByPhoneRequest, opts ...http.CallOption) (rsp *UserReply, err error) Login(ctx context.Context, req *LoginRequest, opts ...http.CallOption) (rsp *UserReply, err error) Register(ctx context.Context, req *RegisterRequest, opts ...http.CallOption) (rsp *UserReply, err error) UpdateUser(ctx context.Context, req *UpdateUserRequest, opts ...http.CallOption) (rsp *UserReply, err error) }
func NewUserHTTPClient ¶
func NewUserHTTPClient(client *http.Client) UserHTTPClient
type UserHTTPClientImpl ¶
type UserHTTPClientImpl struct {
// contains filtered or unexported fields
}
func (*UserHTTPClientImpl) GetUserByPhone ¶
func (c *UserHTTPClientImpl) GetUserByPhone(ctx context.Context, in *GetUserByPhoneRequest, opts ...http.CallOption) (*UserReply, error)
func (*UserHTTPClientImpl) Login ¶
func (c *UserHTTPClientImpl) Login(ctx context.Context, in *LoginRequest, opts ...http.CallOption) (*UserReply, error)
func (*UserHTTPClientImpl) Register ¶
func (c *UserHTTPClientImpl) Register(ctx context.Context, in *RegisterRequest, opts ...http.CallOption) (*UserReply, error)
func (*UserHTTPClientImpl) UpdateUser ¶
func (c *UserHTTPClientImpl) UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...http.CallOption) (*UserReply, error)
type UserHTTPServer ¶
type UserHTTPServer interface { GetUserByPhone(context.Context, *GetUserByPhoneRequest) (*UserReply, error) Login(context.Context, *LoginRequest) (*UserReply, error) Register(context.Context, *RegisterRequest) (*UserReply, error) UpdateUser(context.Context, *UpdateUserRequest) (*UserReply, error) }
type UserInfo ¶
type UserInfo struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` Phone string `protobuf:"bytes,3,opt,name=phone,proto3" json:"phone,omitempty"` Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"` CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=createdAt,proto3" json:"createdAt,omitempty"` UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=updatedAt,proto3" json:"updatedAt,omitempty"` // contains filtered or unexported fields }
func (*UserInfo) Descriptor
deprecated
func (*UserInfo) GetCreatedAt ¶
func (x *UserInfo) GetCreatedAt() *timestamppb.Timestamp
func (*UserInfo) GetPassword ¶
func (*UserInfo) GetUpdatedAt ¶
func (x *UserInfo) GetUpdatedAt() *timestamppb.Timestamp
func (*UserInfo) GetUsername ¶
func (*UserInfo) ProtoMessage ¶
func (*UserInfo) ProtoMessage()
func (*UserInfo) ProtoReflect ¶
func (x *UserInfo) ProtoReflect() protoreflect.Message
type UserReply ¶
type UserReply struct { User *UserInfo `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` // contains filtered or unexported fields }
func (*UserReply) Descriptor
deprecated
func (*UserReply) ProtoMessage ¶
func (*UserReply) ProtoMessage()
func (*UserReply) ProtoReflect ¶
func (x *UserReply) ProtoReflect() protoreflect.Message
type UserServer ¶
type UserServer interface { Register(context.Context, *RegisterRequest) (*UserReply, error) Login(context.Context, *LoginRequest) (*UserReply, error) GetUserByPhone(context.Context, *GetUserByPhoneRequest) (*UserReply, error) UpdateUser(context.Context, *UpdateUserRequest) (*UserReply, error) // contains filtered or unexported methods }
UserServer is the server API for User service. All implementations must embed UnimplementedUserServer for forward compatibility