v1

package
v0.0.0-...-c4f823d Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const OperationUserGetUserByPhone = "/user.v1.User/GetUserByPhone"
View Source
const OperationUserLogin = "/user.v1.User/Login"
View Source
const OperationUserRegister = "/user.v1.User/Register"
View Source
const OperationUserUpdateUser = "/user.v1.User/UpdateUser"

Variables

View Source
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.

View Source
var File_user_v1_user_error_reason_proto protoreflect.FileDescriptor
View Source
var File_user_v1_user_proto protoreflect.FileDescriptor
View Source
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) Login

func (UnimplementedUserServer) Register

func (UnimplementedUserServer) UpdateUser

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) Enum

func (x UserErrorReason) Enum() *UserErrorReason

func (UserErrorReason) EnumDescriptor deprecated

func (UserErrorReason) EnumDescriptor() ([]byte, []int)

Deprecated: Use UserErrorReason.Descriptor instead.

func (UserErrorReason) Number

func (UserErrorReason) String

func (x UserErrorReason) String() string

func (UserErrorReason) Type

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

Deprecated: Use UserInfo.ProtoReflect.Descriptor instead.

func (*UserInfo) GetCreatedAt

func (x *UserInfo) GetCreatedAt() *timestamppb.Timestamp

func (*UserInfo) GetId

func (x *UserInfo) GetId() int64

func (*UserInfo) GetPassword

func (x *UserInfo) GetPassword() string

func (*UserInfo) GetPhone

func (x *UserInfo) GetPhone() string

func (*UserInfo) GetUpdatedAt

func (x *UserInfo) GetUpdatedAt() *timestamppb.Timestamp

func (*UserInfo) GetUsername

func (x *UserInfo) GetUsername() 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 {
	User *UserInfo `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
	// contains filtered or unexported fields
}

func (*UserReply) Descriptor deprecated

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

Deprecated: Use UserReply.ProtoReflect.Descriptor instead.

func (*UserReply) GetUser

func (x *UserReply) GetUser() *UserInfo

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, *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

Jump to

Keyboard shortcuts

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