Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterUserServer(s grpc.ServiceRegistrar, srv UserServer)
- type FindByIdRequest
- type FindByIdResponse
- func (*FindByIdResponse) Descriptor() ([]byte, []int)deprecated
- func (x *FindByIdResponse) GetAvatar() string
- func (x *FindByIdResponse) GetMobile() string
- func (x *FindByIdResponse) GetUserId() int64
- func (x *FindByIdResponse) GetUsername() string
- func (*FindByIdResponse) ProtoMessage()
- func (x *FindByIdResponse) ProtoReflect() protoreflect.Message
- func (x *FindByIdResponse) Reset()
- func (x *FindByIdResponse) String() string
- type FindByMobileRequest
- func (*FindByMobileRequest) Descriptor() ([]byte, []int)deprecated
- func (x *FindByMobileRequest) GetMobile() string
- func (*FindByMobileRequest) ProtoMessage()
- func (x *FindByMobileRequest) ProtoReflect() protoreflect.Message
- func (x *FindByMobileRequest) Reset()
- func (x *FindByMobileRequest) String() string
- type FindByMobileResponse
- func (*FindByMobileResponse) Descriptor() ([]byte, []int)deprecated
- func (x *FindByMobileResponse) GetAvatar() string
- func (x *FindByMobileResponse) GetMobile() string
- func (x *FindByMobileResponse) GetUserId() int64
- func (x *FindByMobileResponse) GetUsername() string
- func (*FindByMobileResponse) ProtoMessage()
- func (x *FindByMobileResponse) ProtoReflect() protoreflect.Message
- func (x *FindByMobileResponse) Reset()
- func (x *FindByMobileResponse) String() string
- type RegisterRequest
- func (*RegisterRequest) Descriptor() ([]byte, []int)deprecated
- func (x *RegisterRequest) GetAvatar() string
- func (x *RegisterRequest) GetMobile() string
- func (x *RegisterRequest) GetPassword() 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 RegisterResponse
- type SendSmsRequest
- func (*SendSmsRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SendSmsRequest) GetMobile() string
- func (x *SendSmsRequest) GetUserId() int64
- func (*SendSmsRequest) ProtoMessage()
- func (x *SendSmsRequest) ProtoReflect() protoreflect.Message
- func (x *SendSmsRequest) Reset()
- func (x *SendSmsRequest) String() string
- type SendSmsResponse
- type UnimplementedUserServer
- func (UnimplementedUserServer) FindById(context.Context, *FindByIdRequest) (*FindByIdResponse, error)
- func (UnimplementedUserServer) FindByMobile(context.Context, *FindByMobileRequest) (*FindByMobileResponse, error)
- func (UnimplementedUserServer) Register(context.Context, *RegisterRequest) (*RegisterResponse, error)
- func (UnimplementedUserServer) SendSms(context.Context, *SendSmsRequest) (*SendSmsResponse, error)
- type UnsafeUserServer
- type UserClient
- type UserServer
Constants ¶
const ( User_Register_FullMethodName = "/service.User/Register" User_FindById_FullMethodName = "/service.User/FindById" User_FindByMobile_FullMethodName = "/service.User/FindByMobile" User_SendSms_FullMethodName = "/service.User/SendSms" )
Variables ¶
var File_demo_proto protoreflect.FileDescriptor
var User_ServiceDesc = grpc.ServiceDesc{ ServiceName: "service.User", HandlerType: (*UserServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Register", Handler: _User_Register_Handler, }, { MethodName: "FindById", Handler: _User_FindById_Handler, }, { MethodName: "FindByMobile", Handler: _User_FindByMobile_Handler, }, { MethodName: "SendSms", Handler: _User_SendSms_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "demo.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 RegisterUserServer ¶
func RegisterUserServer(s grpc.ServiceRegistrar, srv UserServer)
Types ¶
type FindByIdRequest ¶
type FindByIdRequest struct { UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` // contains filtered or unexported fields }
func (*FindByIdRequest) Descriptor
deprecated
func (*FindByIdRequest) Descriptor() ([]byte, []int)
Deprecated: Use FindByIdRequest.ProtoReflect.Descriptor instead.
func (*FindByIdRequest) GetUserId ¶
func (x *FindByIdRequest) GetUserId() int64
func (*FindByIdRequest) ProtoMessage ¶
func (*FindByIdRequest) ProtoMessage()
func (*FindByIdRequest) ProtoReflect ¶
func (x *FindByIdRequest) ProtoReflect() protoreflect.Message
func (*FindByIdRequest) Reset ¶
func (x *FindByIdRequest) Reset()
func (*FindByIdRequest) String ¶
func (x *FindByIdRequest) String() string
type FindByIdResponse ¶
type FindByIdResponse struct { UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` Mobile string `protobuf:"bytes,3,opt,name=mobile,proto3" json:"mobile,omitempty"` Avatar string `protobuf:"bytes,4,opt,name=avatar,proto3" json:"avatar,omitempty"` // contains filtered or unexported fields }
func (*FindByIdResponse) Descriptor
deprecated
func (*FindByIdResponse) Descriptor() ([]byte, []int)
Deprecated: Use FindByIdResponse.ProtoReflect.Descriptor instead.
func (*FindByIdResponse) GetAvatar ¶
func (x *FindByIdResponse) GetAvatar() string
func (*FindByIdResponse) GetMobile ¶
func (x *FindByIdResponse) GetMobile() string
func (*FindByIdResponse) GetUserId ¶
func (x *FindByIdResponse) GetUserId() int64
func (*FindByIdResponse) GetUsername ¶
func (x *FindByIdResponse) GetUsername() string
func (*FindByIdResponse) ProtoMessage ¶
func (*FindByIdResponse) ProtoMessage()
func (*FindByIdResponse) ProtoReflect ¶
func (x *FindByIdResponse) ProtoReflect() protoreflect.Message
func (*FindByIdResponse) Reset ¶
func (x *FindByIdResponse) Reset()
func (*FindByIdResponse) String ¶
func (x *FindByIdResponse) String() string
type FindByMobileRequest ¶
type FindByMobileRequest struct { Mobile string `protobuf:"bytes,1,opt,name=mobile,proto3" json:"mobile,omitempty"` // contains filtered or unexported fields }
func (*FindByMobileRequest) Descriptor
deprecated
func (*FindByMobileRequest) Descriptor() ([]byte, []int)
Deprecated: Use FindByMobileRequest.ProtoReflect.Descriptor instead.
func (*FindByMobileRequest) GetMobile ¶
func (x *FindByMobileRequest) GetMobile() string
func (*FindByMobileRequest) ProtoMessage ¶
func (*FindByMobileRequest) ProtoMessage()
func (*FindByMobileRequest) ProtoReflect ¶
func (x *FindByMobileRequest) ProtoReflect() protoreflect.Message
func (*FindByMobileRequest) Reset ¶
func (x *FindByMobileRequest) Reset()
func (*FindByMobileRequest) String ¶
func (x *FindByMobileRequest) String() string
type FindByMobileResponse ¶
type FindByMobileResponse struct { UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` Mobile string `protobuf:"bytes,3,opt,name=mobile,proto3" json:"mobile,omitempty"` Avatar string `protobuf:"bytes,4,opt,name=avatar,proto3" json:"avatar,omitempty"` // contains filtered or unexported fields }
func (*FindByMobileResponse) Descriptor
deprecated
func (*FindByMobileResponse) Descriptor() ([]byte, []int)
Deprecated: Use FindByMobileResponse.ProtoReflect.Descriptor instead.
func (*FindByMobileResponse) GetAvatar ¶
func (x *FindByMobileResponse) GetAvatar() string
func (*FindByMobileResponse) GetMobile ¶
func (x *FindByMobileResponse) GetMobile() string
func (*FindByMobileResponse) GetUserId ¶
func (x *FindByMobileResponse) GetUserId() int64
func (*FindByMobileResponse) GetUsername ¶
func (x *FindByMobileResponse) GetUsername() string
func (*FindByMobileResponse) ProtoMessage ¶
func (*FindByMobileResponse) ProtoMessage()
func (*FindByMobileResponse) ProtoReflect ¶
func (x *FindByMobileResponse) ProtoReflect() protoreflect.Message
func (*FindByMobileResponse) Reset ¶
func (x *FindByMobileResponse) Reset()
func (*FindByMobileResponse) String ¶
func (x *FindByMobileResponse) String() string
type RegisterRequest ¶
type RegisterRequest struct { Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` Mobile string `protobuf:"bytes,2,opt,name=mobile,proto3" json:"mobile,omitempty"` Avatar string `protobuf:"bytes,3,opt,name=avatar,proto3" json:"avatar,omitempty"` Password string `protobuf:"bytes,4,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) GetAvatar ¶
func (x *RegisterRequest) GetAvatar() string
func (*RegisterRequest) GetMobile ¶
func (x *RegisterRequest) GetMobile() string
func (*RegisterRequest) GetPassword ¶
func (x *RegisterRequest) GetPassword() 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 RegisterResponse ¶
type RegisterResponse struct { UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` // contains filtered or unexported fields }
func (*RegisterResponse) Descriptor
deprecated
func (*RegisterResponse) Descriptor() ([]byte, []int)
Deprecated: Use RegisterResponse.ProtoReflect.Descriptor instead.
func (*RegisterResponse) GetUserId ¶
func (x *RegisterResponse) GetUserId() int64
func (*RegisterResponse) ProtoMessage ¶
func (*RegisterResponse) ProtoMessage()
func (*RegisterResponse) ProtoReflect ¶
func (x *RegisterResponse) ProtoReflect() protoreflect.Message
func (*RegisterResponse) Reset ¶
func (x *RegisterResponse) Reset()
func (*RegisterResponse) String ¶
func (x *RegisterResponse) String() string
type SendSmsRequest ¶
type SendSmsRequest struct { UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` Mobile string `protobuf:"bytes,2,opt,name=mobile,proto3" json:"mobile,omitempty"` // contains filtered or unexported fields }
func (*SendSmsRequest) Descriptor
deprecated
func (*SendSmsRequest) Descriptor() ([]byte, []int)
Deprecated: Use SendSmsRequest.ProtoReflect.Descriptor instead.
func (*SendSmsRequest) GetMobile ¶
func (x *SendSmsRequest) GetMobile() string
func (*SendSmsRequest) GetUserId ¶
func (x *SendSmsRequest) GetUserId() int64
func (*SendSmsRequest) ProtoMessage ¶
func (*SendSmsRequest) ProtoMessage()
func (*SendSmsRequest) ProtoReflect ¶
func (x *SendSmsRequest) ProtoReflect() protoreflect.Message
func (*SendSmsRequest) Reset ¶
func (x *SendSmsRequest) Reset()
func (*SendSmsRequest) String ¶
func (x *SendSmsRequest) String() string
type SendSmsResponse ¶
type SendSmsResponse struct {
// contains filtered or unexported fields
}
func (*SendSmsResponse) Descriptor
deprecated
func (*SendSmsResponse) Descriptor() ([]byte, []int)
Deprecated: Use SendSmsResponse.ProtoReflect.Descriptor instead.
func (*SendSmsResponse) ProtoMessage ¶
func (*SendSmsResponse) ProtoMessage()
func (*SendSmsResponse) ProtoReflect ¶
func (x *SendSmsResponse) ProtoReflect() protoreflect.Message
func (*SendSmsResponse) Reset ¶
func (x *SendSmsResponse) Reset()
func (*SendSmsResponse) String ¶
func (x *SendSmsResponse) String() string
type UnimplementedUserServer ¶
type UnimplementedUserServer struct { }
UnimplementedUserServer must be embedded to have forward compatible implementations.
func (UnimplementedUserServer) FindById ¶
func (UnimplementedUserServer) FindById(context.Context, *FindByIdRequest) (*FindByIdResponse, error)
func (UnimplementedUserServer) FindByMobile ¶
func (UnimplementedUserServer) FindByMobile(context.Context, *FindByMobileRequest) (*FindByMobileResponse, error)
func (UnimplementedUserServer) Register ¶
func (UnimplementedUserServer) Register(context.Context, *RegisterRequest) (*RegisterResponse, error)
func (UnimplementedUserServer) SendSms ¶
func (UnimplementedUserServer) SendSms(context.Context, *SendSmsRequest) (*SendSmsResponse, 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 { Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error) FindById(ctx context.Context, in *FindByIdRequest, opts ...grpc.CallOption) (*FindByIdResponse, error) FindByMobile(ctx context.Context, in *FindByMobileRequest, opts ...grpc.CallOption) (*FindByMobileResponse, error) SendSms(ctx context.Context, in *SendSmsRequest, opts ...grpc.CallOption) (*SendSmsResponse, 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 UserServer ¶
type UserServer interface { Register(context.Context, *RegisterRequest) (*RegisterResponse, error) FindById(context.Context, *FindByIdRequest) (*FindByIdResponse, error) FindByMobile(context.Context, *FindByMobileRequest) (*FindByMobileResponse, error) SendSms(context.Context, *SendSmsRequest) (*SendSmsResponse, error) // contains filtered or unexported methods }
UserServer is the server API for User service. All implementations must embed UnimplementedUserServer for forward compatibility