user

package
v0.0.0-...-bed3fb8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use EditReply.ProtoReflect.Descriptor instead.

func (*EditReply) GetErr

func (x *EditReply) GetErr() *common.CommonResponse

func (*EditReply) ProtoMessage

func (*EditReply) ProtoMessage()

func (*EditReply) ProtoReflect

func (x *EditReply) ProtoReflect() protoreflect.Message

func (*EditReply) Reset

func (x *EditReply) Reset()

func (*EditReply) String

func (x *EditReply) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use GetReply.ProtoReflect.Descriptor instead.

func (*GetReply) GetErr

func (x *GetReply) GetErr() *common.CommonResponse

func (*GetReply) GetUser

func (x *GetReply) GetUser() *UserInfo

func (*GetReply) ProtoMessage

func (*GetReply) ProtoMessage()

func (*GetReply) ProtoReflect

func (x *GetReply) ProtoReflect() protoreflect.Message

func (*GetReply) Reset

func (x *GetReply) Reset()

func (*GetReply) String

func (x *GetReply) String() string

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
}

func (Server) Edit

func (s Server) Edit(ctx context.Context, req *EditRequest) (*EditReply, error)

func (Server) Get

func (s Server) Get(ctx context.Context, req *GetRequest) (*GetReply, error)

func (Server) Login

func (s Server) Login(ctx context.Context, req *RegisterLoginRequest) (*UserReply, error)

func (Server) Register

func (s Server) Register(ctx context.Context, req *RegisterLoginRequest) (*UserReply, error)

type UnimplementedUserServer

type UnimplementedUserServer struct {
}

UnimplementedUserServer must be embedded to have forward compatible implementations.

func (UnimplementedUserServer) Edit

func (UnimplementedUserServer) Get

func (UnimplementedUserServer) Login

func (UnimplementedUserServer) Register

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) Descriptor() ([]byte, []int)

Deprecated: Use UserInfo.ProtoReflect.Descriptor instead.

func (*UserInfo) GetGender

func (x *UserInfo) GetGender() string

func (*UserInfo) GetId

func (x *UserInfo) GetId() uint64

func (*UserInfo) GetName

func (x *UserInfo) GetName() string

func (*UserInfo) GetStudentNum

func (x *UserInfo) GetStudentNum() string

func (*UserInfo) ProtoMessage

func (*UserInfo) ProtoMessage()

func (*UserInfo) ProtoReflect

func (x *UserInfo) ProtoReflect() protoreflect.Message

func (*UserInfo) Reset

func (x *UserInfo) Reset()

func (*UserInfo) String

func (x *UserInfo) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use UserReply.ProtoReflect.Descriptor instead.

func (*UserReply) GetErr

func (x *UserReply) GetErr() *common.CommonResponse

func (*UserReply) GetUserId

func (x *UserReply) GetUserId() uint64

func (*UserReply) ProtoMessage

func (*UserReply) ProtoMessage()

func (*UserReply) ProtoReflect

func (x *UserReply) ProtoReflect() protoreflect.Message

func (*UserReply) Reset

func (x *UserReply) Reset()

func (*UserReply) String

func (x *UserReply) String() string

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL