user

package
v0.0.0-...-dd3bfa9 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package user is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	UserService_EmailLogin_FullMethodName           = "/user.UserService/EmailLogin"
	UserService_EmailRegister_FullMethodName        = "/user.UserService/EmailRegister"
	UserService_GetEmailRegisterCode_FullMethodName = "/user.UserService/GetEmailRegisterCode"
	UserService_GetUser_FullMethodName              = "/user.UserService/GetUser"
	UserService_GetUserByToken_FullMethodName       = "/user.UserService/GetUserByToken"
)

Variables

View Source
var File_user_user_proto protoreflect.FileDescriptor
View Source
var UserService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "user.UserService",
	HandlerType: (*UserServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "EmailLogin",
			Handler:    _UserService_EmailLogin_Handler,
		},
		{
			MethodName: "EmailRegister",
			Handler:    _UserService_EmailRegister_Handler,
		},
		{
			MethodName: "GetEmailRegisterCode",
			Handler:    _UserService_GetEmailRegisterCode_Handler,
		},
		{
			MethodName: "GetUser",
			Handler:    _UserService_GetUser_Handler,
		},
		{
			MethodName: "GetUserByToken",
			Handler:    _UserService_GetUserByToken_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "user/user.proto",
}

UserService_ServiceDesc is the grpc.ServiceDesc for UserService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterUserServiceHandler

func RegisterUserServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterUserServiceHandler registers the http handlers for service UserService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterUserServiceHandlerClient

func RegisterUserServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UserServiceClient) error

RegisterUserServiceHandlerClient registers the http handlers for service UserService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "UserServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "UserServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "UserServiceClient" to call the correct interceptors.

func RegisterUserServiceHandlerFromEndpoint

func RegisterUserServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterUserServiceHandlerFromEndpoint is same as RegisterUserServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterUserServiceHandlerServer

func RegisterUserServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UserServiceServer) error

RegisterUserServiceHandlerServer registers the http handlers for service UserService to "mux". UnaryRPC :call UserServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterUserServiceHandlerFromEndpoint instead.

func RegisterUserServiceServer

func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer)

Types

type EmailLoginRequest

type EmailLoginRequest struct {
	Email    string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"`
	Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
	// contains filtered or unexported fields
}

func (*EmailLoginRequest) Descriptor deprecated

func (*EmailLoginRequest) Descriptor() ([]byte, []int)

Deprecated: Use EmailLoginRequest.ProtoReflect.Descriptor instead.

func (*EmailLoginRequest) GetEmail

func (x *EmailLoginRequest) GetEmail() string

func (*EmailLoginRequest) GetPassword

func (x *EmailLoginRequest) GetPassword() string

func (*EmailLoginRequest) ProtoMessage

func (*EmailLoginRequest) ProtoMessage()

func (*EmailLoginRequest) ProtoReflect

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

func (*EmailLoginRequest) Reset

func (x *EmailLoginRequest) Reset()

func (*EmailLoginRequest) String

func (x *EmailLoginRequest) String() string

type EmailLoginResponse

type EmailLoginResponse struct {
	Status *base.Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"`
	User   *User        `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"`
	Token  string       `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"`
	// contains filtered or unexported fields
}

func (*EmailLoginResponse) Descriptor deprecated

func (*EmailLoginResponse) Descriptor() ([]byte, []int)

Deprecated: Use EmailLoginResponse.ProtoReflect.Descriptor instead.

func (*EmailLoginResponse) GetStatus

func (x *EmailLoginResponse) GetStatus() *base.Status

func (*EmailLoginResponse) GetToken

func (x *EmailLoginResponse) GetToken() string

func (*EmailLoginResponse) GetUser

func (x *EmailLoginResponse) GetUser() *User

func (*EmailLoginResponse) ProtoMessage

func (*EmailLoginResponse) ProtoMessage()

func (*EmailLoginResponse) ProtoReflect

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

func (*EmailLoginResponse) Reset

func (x *EmailLoginResponse) Reset()

func (*EmailLoginResponse) String

func (x *EmailLoginResponse) String() string

type EmailRegisterRequest

type EmailRegisterRequest struct {
	Email    string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"`
	Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
	Code     string `protobuf:"bytes,3,opt,name=code,proto3" json:"code,omitempty"`
	// contains filtered or unexported fields
}

func (*EmailRegisterRequest) Descriptor deprecated

func (*EmailRegisterRequest) Descriptor() ([]byte, []int)

Deprecated: Use EmailRegisterRequest.ProtoReflect.Descriptor instead.

func (*EmailRegisterRequest) GetCode

func (x *EmailRegisterRequest) GetCode() string

func (*EmailRegisterRequest) GetEmail

func (x *EmailRegisterRequest) GetEmail() string

func (*EmailRegisterRequest) GetPassword

func (x *EmailRegisterRequest) GetPassword() string

func (*EmailRegisterRequest) ProtoMessage

func (*EmailRegisterRequest) ProtoMessage()

func (*EmailRegisterRequest) ProtoReflect

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

func (*EmailRegisterRequest) Reset

func (x *EmailRegisterRequest) Reset()

func (*EmailRegisterRequest) String

func (x *EmailRegisterRequest) String() string

type EmailRegisterResponse

type EmailRegisterResponse struct {
	Status *base.Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"`
	User   *User        `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"`
	Token  string       `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"`
	// contains filtered or unexported fields
}

func (*EmailRegisterResponse) Descriptor deprecated

func (*EmailRegisterResponse) Descriptor() ([]byte, []int)

Deprecated: Use EmailRegisterResponse.ProtoReflect.Descriptor instead.

func (*EmailRegisterResponse) GetStatus

func (x *EmailRegisterResponse) GetStatus() *base.Status

func (*EmailRegisterResponse) GetToken

func (x *EmailRegisterResponse) GetToken() string

func (*EmailRegisterResponse) GetUser

func (x *EmailRegisterResponse) GetUser() *User

func (*EmailRegisterResponse) ProtoMessage

func (*EmailRegisterResponse) ProtoMessage()

func (*EmailRegisterResponse) ProtoReflect

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

func (*EmailRegisterResponse) Reset

func (x *EmailRegisterResponse) Reset()

func (*EmailRegisterResponse) String

func (x *EmailRegisterResponse) String() string

type GetEmailRegisterCodeRequest

type GetEmailRegisterCodeRequest struct {
	Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"`
	// contains filtered or unexported fields
}

func (*GetEmailRegisterCodeRequest) Descriptor deprecated

func (*GetEmailRegisterCodeRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetEmailRegisterCodeRequest.ProtoReflect.Descriptor instead.

func (*GetEmailRegisterCodeRequest) GetEmail

func (x *GetEmailRegisterCodeRequest) GetEmail() string

func (*GetEmailRegisterCodeRequest) ProtoMessage

func (*GetEmailRegisterCodeRequest) ProtoMessage()

func (*GetEmailRegisterCodeRequest) ProtoReflect

func (*GetEmailRegisterCodeRequest) Reset

func (x *GetEmailRegisterCodeRequest) Reset()

func (*GetEmailRegisterCodeRequest) String

func (x *GetEmailRegisterCodeRequest) String() string

type GetEmailRegisterCodeResponse

type GetEmailRegisterCodeResponse struct {
	Status *base.Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"`
	Key    string       `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
	// contains filtered or unexported fields
}

func (*GetEmailRegisterCodeResponse) Descriptor deprecated

func (*GetEmailRegisterCodeResponse) Descriptor() ([]byte, []int)

Deprecated: Use GetEmailRegisterCodeResponse.ProtoReflect.Descriptor instead.

func (*GetEmailRegisterCodeResponse) GetKey

func (*GetEmailRegisterCodeResponse) GetStatus

func (x *GetEmailRegisterCodeResponse) GetStatus() *base.Status

func (*GetEmailRegisterCodeResponse) ProtoMessage

func (*GetEmailRegisterCodeResponse) ProtoMessage()

func (*GetEmailRegisterCodeResponse) ProtoReflect

func (*GetEmailRegisterCodeResponse) Reset

func (x *GetEmailRegisterCodeResponse) Reset()

func (*GetEmailRegisterCodeResponse) String

type GetUserByTokenRequest

type GetUserByTokenRequest struct {
	Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	// contains filtered or unexported fields
}

func (*GetUserByTokenRequest) Descriptor deprecated

func (*GetUserByTokenRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetUserByTokenRequest.ProtoReflect.Descriptor instead.

func (*GetUserByTokenRequest) GetToken

func (x *GetUserByTokenRequest) GetToken() string

func (*GetUserByTokenRequest) ProtoMessage

func (*GetUserByTokenRequest) ProtoMessage()

func (*GetUserByTokenRequest) ProtoReflect

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

func (*GetUserByTokenRequest) Reset

func (x *GetUserByTokenRequest) Reset()

func (*GetUserByTokenRequest) String

func (x *GetUserByTokenRequest) String() string

type GetUserByTokenResponse

type GetUserByTokenResponse struct {
	Status *base.Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"`
	User   *User        `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"`
	// contains filtered or unexported fields
}

func (*GetUserByTokenResponse) Descriptor deprecated

func (*GetUserByTokenResponse) Descriptor() ([]byte, []int)

Deprecated: Use GetUserByTokenResponse.ProtoReflect.Descriptor instead.

func (*GetUserByTokenResponse) GetStatus

func (x *GetUserByTokenResponse) GetStatus() *base.Status

func (*GetUserByTokenResponse) GetUser

func (x *GetUserByTokenResponse) GetUser() *User

func (*GetUserByTokenResponse) ProtoMessage

func (*GetUserByTokenResponse) ProtoMessage()

func (*GetUserByTokenResponse) ProtoReflect

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

func (*GetUserByTokenResponse) Reset

func (x *GetUserByTokenResponse) Reset()

func (*GetUserByTokenResponse) String

func (x *GetUserByTokenResponse) String() string

type GetUserRequest

type GetUserRequest struct {
	UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	// contains filtered or unexported fields
}

func (*GetUserRequest) Descriptor deprecated

func (*GetUserRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetUserRequest.ProtoReflect.Descriptor instead.

func (*GetUserRequest) GetUserId

func (x *GetUserRequest) GetUserId() string

func (*GetUserRequest) ProtoMessage

func (*GetUserRequest) ProtoMessage()

func (*GetUserRequest) ProtoReflect

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

func (*GetUserRequest) Reset

func (x *GetUserRequest) Reset()

func (*GetUserRequest) String

func (x *GetUserRequest) String() string

type GetUserResponse

type GetUserResponse struct {
	Status *base.Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"`
	User   *User        `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"`
	// contains filtered or unexported fields
}

func (*GetUserResponse) Descriptor deprecated

func (*GetUserResponse) Descriptor() ([]byte, []int)

Deprecated: Use GetUserResponse.ProtoReflect.Descriptor instead.

func (*GetUserResponse) GetStatus

func (x *GetUserResponse) GetStatus() *base.Status

func (*GetUserResponse) GetUser

func (x *GetUserResponse) GetUser() *User

func (*GetUserResponse) ProtoMessage

func (*GetUserResponse) ProtoMessage()

func (*GetUserResponse) ProtoReflect

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

func (*GetUserResponse) Reset

func (x *GetUserResponse) Reset()

func (*GetUserResponse) String

func (x *GetUserResponse) String() string

type UnimplementedUserServiceServer

type UnimplementedUserServiceServer struct {
}

UnimplementedUserServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedUserServiceServer) EmailLogin

func (UnimplementedUserServiceServer) EmailRegister

func (UnimplementedUserServiceServer) GetUser

func (UnimplementedUserServiceServer) GetUserByToken

type UnsafeUserServiceServer

type UnsafeUserServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeUserServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to UserServiceServer will result in compilation errors.

type User

type User struct {
	Id   string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*User) Descriptor deprecated

func (*User) Descriptor() ([]byte, []int)

Deprecated: Use User.ProtoReflect.Descriptor instead.

func (*User) GetId

func (x *User) GetId() string

func (*User) GetName

func (x *User) GetName() string

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) ProtoReflect

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

func (*User) Reset

func (x *User) Reset()

func (*User) String

func (x *User) String() string

type UserServiceClient

type UserServiceClient interface {
	EmailLogin(ctx context.Context, in *EmailLoginRequest, opts ...grpc.CallOption) (*EmailLoginResponse, error)
	EmailRegister(ctx context.Context, in *EmailRegisterRequest, opts ...grpc.CallOption) (*EmailRegisterResponse, error)
	GetEmailRegisterCode(ctx context.Context, in *GetEmailRegisterCodeRequest, opts ...grpc.CallOption) (*GetEmailRegisterCodeResponse, error)
	GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*GetUserResponse, error)
	GetUserByToken(ctx context.Context, in *GetUserByTokenRequest, opts ...grpc.CallOption) (*GetUserByTokenResponse, error)
}

UserServiceClient is the client API for UserService 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.

type UserServiceServer

type UserServiceServer interface {
	EmailLogin(context.Context, *EmailLoginRequest) (*EmailLoginResponse, error)
	EmailRegister(context.Context, *EmailRegisterRequest) (*EmailRegisterResponse, error)
	GetEmailRegisterCode(context.Context, *GetEmailRegisterCodeRequest) (*GetEmailRegisterCodeResponse, error)
	GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error)
	GetUserByToken(context.Context, *GetUserByTokenRequest) (*GetUserByTokenResponse, error)
	// contains filtered or unexported methods
}

UserServiceServer is the server API for UserService service. All implementations must embed UnimplementedUserServiceServer for forward compatibility

Jump to

Keyboard shortcuts

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