Documentation ¶
Index ¶
- Variables
- func RegisterUserServer(s grpc.ServiceRegistrar, srv UserServer)
- type EditReply
- type EditRequest
- type GetReply
- type GetRequest
- type RegisterLoginRequest
- func (*RegisterLoginRequest) Descriptor() ([]byte, []int)deprecated
- func (x *RegisterLoginRequest) GetPassword() string
- func (x *RegisterLoginRequest) GetUsername() string
- func (*RegisterLoginRequest) ProtoMessage()
- func (x *RegisterLoginRequest) ProtoReflect() protoreflect.Message
- func (x *RegisterLoginRequest) Reset()
- func (x *RegisterLoginRequest) String() string
- type Server
- func (s Server) Edit(ctx context.Context, req *EditRequest) (*EditReply, error)
- func (s Server) Get(ctx context.Context, req *GetRequest) (*GetReply, error)
- func (s Server) Login(ctx context.Context, req *RegisterLoginRequest) (*UserReply, error)
- func (s Server) Register(ctx context.Context, req *RegisterLoginRequest) (*UserReply, error)
- type UnimplementedUserServer
- func (UnimplementedUserServer) Edit(context.Context, *EditRequest) (*EditReply, error)
- func (UnimplementedUserServer) Get(context.Context, *GetRequest) (*GetReply, error)
- func (UnimplementedUserServer) Login(context.Context, *RegisterLoginRequest) (*UserReply, error)
- func (UnimplementedUserServer) Register(context.Context, *RegisterLoginRequest) (*UserReply, error)
- type UnsafeUserServer
- type UserClient
- type UserInfo
- func (*UserInfo) Descriptor() ([]byte, []int)deprecated
- func (x *UserInfo) GetGender() string
- func (x *UserInfo) GetId() uint64
- func (x *UserInfo) GetName() string
- func (x *UserInfo) GetStudentNum() string
- func (*UserInfo) ProtoMessage()
- func (x *UserInfo) ProtoReflect() protoreflect.Message
- func (x *UserInfo) Reset()
- func (x *UserInfo) String() string
- type UserReply
- func (*UserReply) Descriptor() ([]byte, []int)deprecated
- func (x *UserReply) GetErr() *common.CommonResponse
- func (x *UserReply) GetUserId() uint64
- func (*UserReply) ProtoMessage()
- func (x *UserReply) ProtoReflect() protoreflect.Message
- func (x *UserReply) Reset()
- func (x *UserReply) String() string
- type UserServer
Constants ¶
This section is empty.
Variables ¶
var File_user_proto protoreflect.FileDescriptor
var User_ServiceDesc = grpc.ServiceDesc{ ServiceName: "user.User", HandlerType: (*UserServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Register", Handler: _User_Register_Handler, }, { MethodName: "Login", Handler: _User_Login_Handler, }, { MethodName: "Get", Handler: _User_Get_Handler, }, { MethodName: "Edit", Handler: _User_Edit_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "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 RegisterUserServer ¶
func RegisterUserServer(s grpc.ServiceRegistrar, srv UserServer)
Types ¶
type EditReply ¶
type EditReply struct { Err *common.CommonResponse `protobuf:"bytes,1,opt,name=err,proto3" json:"err,omitempty"` // contains filtered or unexported fields }
func (*EditReply) Descriptor
deprecated
func (*EditReply) GetErr ¶
func (x *EditReply) GetErr() *common.CommonResponse
func (*EditReply) ProtoMessage ¶
func (*EditReply) ProtoMessage()
func (*EditReply) ProtoReflect ¶
func (x *EditReply) ProtoReflect() protoreflect.Message
type EditRequest ¶
type EditRequest struct { User *UserInfo `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` // contains filtered or unexported fields }
func (*EditRequest) Descriptor
deprecated
func (*EditRequest) Descriptor() ([]byte, []int)
Deprecated: Use EditRequest.ProtoReflect.Descriptor instead.
func (*EditRequest) GetUser ¶
func (x *EditRequest) GetUser() *UserInfo
func (*EditRequest) ProtoMessage ¶
func (*EditRequest) ProtoMessage()
func (*EditRequest) ProtoReflect ¶
func (x *EditRequest) ProtoReflect() protoreflect.Message
func (*EditRequest) Reset ¶
func (x *EditRequest) Reset()
func (*EditRequest) String ¶
func (x *EditRequest) String() string
type GetReply ¶
type GetReply struct { Err *common.CommonResponse `protobuf:"bytes,1,opt,name=err,proto3" json:"err,omitempty"` User *UserInfo `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"` // contains filtered or unexported fields }
func (*GetReply) Descriptor
deprecated
func (*GetReply) GetErr ¶
func (x *GetReply) GetErr() *common.CommonResponse
func (*GetReply) ProtoMessage ¶
func (*GetReply) ProtoMessage()
func (*GetReply) ProtoReflect ¶
func (x *GetReply) ProtoReflect() protoreflect.Message
type GetRequest ¶
type GetRequest struct { UserId uint64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` // contains filtered or unexported fields }
func (*GetRequest) Descriptor
deprecated
func (*GetRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.
func (*GetRequest) GetUserId ¶
func (x *GetRequest) GetUserId() uint64
func (*GetRequest) ProtoMessage ¶
func (*GetRequest) ProtoMessage()
func (*GetRequest) ProtoReflect ¶
func (x *GetRequest) ProtoReflect() protoreflect.Message
func (*GetRequest) Reset ¶
func (x *GetRequest) Reset()
func (*GetRequest) String ¶
func (x *GetRequest) String() string
type RegisterLoginRequest ¶
type RegisterLoginRequest 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 (*RegisterLoginRequest) Descriptor
deprecated
func (*RegisterLoginRequest) Descriptor() ([]byte, []int)
Deprecated: Use RegisterLoginRequest.ProtoReflect.Descriptor instead.
func (*RegisterLoginRequest) GetPassword ¶
func (x *RegisterLoginRequest) GetPassword() string
func (*RegisterLoginRequest) GetUsername ¶
func (x *RegisterLoginRequest) GetUsername() string
func (*RegisterLoginRequest) ProtoMessage ¶
func (*RegisterLoginRequest) ProtoMessage()
func (*RegisterLoginRequest) ProtoReflect ¶
func (x *RegisterLoginRequest) ProtoReflect() protoreflect.Message
func (*RegisterLoginRequest) Reset ¶
func (x *RegisterLoginRequest) Reset()
func (*RegisterLoginRequest) String ¶
func (x *RegisterLoginRequest) String() string
type Server ¶
type Server struct { Config *viper.Viper UnimplementedUserServer }
type UnimplementedUserServer ¶
type UnimplementedUserServer struct { }
UnimplementedUserServer must be embedded to have forward compatible implementations.
func (UnimplementedUserServer) Edit ¶
func (UnimplementedUserServer) Edit(context.Context, *EditRequest) (*EditReply, error)
func (UnimplementedUserServer) Get ¶
func (UnimplementedUserServer) Get(context.Context, *GetRequest) (*GetReply, error)
func (UnimplementedUserServer) Login ¶
func (UnimplementedUserServer) Login(context.Context, *RegisterLoginRequest) (*UserReply, error)
func (UnimplementedUserServer) Register ¶
func (UnimplementedUserServer) Register(context.Context, *RegisterLoginRequest) (*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 UserClient ¶
type UserClient interface { Register(ctx context.Context, in *RegisterLoginRequest, opts ...grpc.CallOption) (*UserReply, error) Login(ctx context.Context, in *RegisterLoginRequest, opts ...grpc.CallOption) (*UserReply, error) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetReply, error) Edit(ctx context.Context, in *EditRequest, opts ...grpc.CallOption) (*EditReply, 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 { Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` StudentNum string `protobuf:"bytes,2,opt,name=studentNum,proto3" json:"studentNum,omitempty"` Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` Gender string `protobuf:"bytes,4,opt,name=gender,proto3" json:"gender,omitempty"` // contains filtered or unexported fields }
func (*UserInfo) Descriptor
deprecated
func (*UserInfo) GetStudentNum ¶
func (*UserInfo) ProtoMessage ¶
func (*UserInfo) ProtoMessage()
func (*UserInfo) ProtoReflect ¶
func (x *UserInfo) ProtoReflect() protoreflect.Message
type UserReply ¶
type UserReply struct { Err *common.CommonResponse `protobuf:"bytes,1,opt,name=err,proto3" json:"err,omitempty"` UserId uint64 `protobuf:"varint,2,opt,name=userId,proto3" json:"userId,omitempty"` // contains filtered or unexported fields }
func (*UserReply) Descriptor
deprecated
func (*UserReply) GetErr ¶
func (x *UserReply) GetErr() *common.CommonResponse
func (*UserReply) ProtoMessage ¶
func (*UserReply) ProtoMessage()
func (*UserReply) ProtoReflect ¶
func (x *UserReply) ProtoReflect() protoreflect.Message
type UserServer ¶
type UserServer interface { Register(context.Context, *RegisterLoginRequest) (*UserReply, error) Login(context.Context, *RegisterLoginRequest) (*UserReply, error) Get(context.Context, *GetRequest) (*GetReply, error) Edit(context.Context, *EditRequest) (*EditReply, error) // contains filtered or unexported methods }
UserServer is the server API for User service. All implementations must embed UnimplementedUserServer for forward compatibility