user

package
v0.0.0-...-5e1236a Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	User_GetUser_FullMethodName        = "/user.User/GetUser"
	User_GetUserByEmail_FullMethodName = "/user.User/GetUserByEmail"
	User_GetUsers_FullMethodName       = "/user.User/GetUsers"
	User_CreateUser_FullMethodName     = "/user.User/CreateUser"
	User_UpdateUser_FullMethodName     = "/user.User/UpdateUser"
	User_ChangeUserRole_FullMethodName = "/user.User/ChangeUserRole"
	User_DeleteUser_FullMethodName     = "/user.User/DeleteUser"
)

Variables

View Source
var (
	UserRole_name = map[int32]string{
		0: "GUEST",
		1: "USER",
		2: "ADMIN",
		3: "SUPERADMIN",
	}
	UserRole_value = map[string]int32{
		"GUEST":      0,
		"USER":       1,
		"ADMIN":      2,
		"SUPERADMIN": 3,
	}
)

Enum value maps for UserRole.

View Source
var User_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "user.User",
	HandlerType: (*UserServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetUser",
			Handler:    _User_GetUser_Handler,
		},
		{
			MethodName: "GetUserByEmail",
			Handler:    _User_GetUserByEmail_Handler,
		},
		{
			MethodName: "GetUsers",
			Handler:    _User_GetUsers_Handler,
		},
		{
			MethodName: "CreateUser",
			Handler:    _User_CreateUser_Handler,
		},
		{
			MethodName: "UpdateUser",
			Handler:    _User_UpdateUser_Handler,
		},
		{
			MethodName: "ChangeUserRole",
			Handler:    _User_ChangeUserRole_Handler,
		},
		{
			MethodName: "DeleteUser",
			Handler:    _User_DeleteUser_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 ChangeUserRoleRequest

type ChangeUserRoleRequest struct {
	UserId string   `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	Role   UserRole `protobuf:"varint,2,opt,name=role,proto3,enum=user.UserRole" json:"role,omitempty"`
	// contains filtered or unexported fields
}

func (*ChangeUserRoleRequest) Descriptor deprecated

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

Deprecated: Use ChangeUserRoleRequest.ProtoReflect.Descriptor instead.

func (*ChangeUserRoleRequest) GetRole

func (x *ChangeUserRoleRequest) GetRole() UserRole

func (*ChangeUserRoleRequest) GetUserId

func (x *ChangeUserRoleRequest) GetUserId() string

func (*ChangeUserRoleRequest) ProtoMessage

func (*ChangeUserRoleRequest) ProtoMessage()

func (*ChangeUserRoleRequest) ProtoReflect

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

func (*ChangeUserRoleRequest) Reset

func (x *ChangeUserRoleRequest) Reset()

func (*ChangeUserRoleRequest) String

func (x *ChangeUserRoleRequest) String() string

type CreateUserRequest

type CreateUserRequest struct {
	UserId    string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	FirstName string `protobuf:"bytes,2,opt,name=first_name,json=firstName,proto3" json:"first_name,omitempty"`
	LastName  string `protobuf:"bytes,3,opt,name=last_name,json=lastName,proto3" json:"last_name,omitempty"`
	Email     string `protobuf:"bytes,4,opt,name=email,proto3" json:"email,omitempty"`
	Password  string `protobuf:"bytes,5,opt,name=password,proto3" json:"password,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateUserRequest) Descriptor deprecated

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

Deprecated: Use CreateUserRequest.ProtoReflect.Descriptor instead.

func (*CreateUserRequest) GetEmail

func (x *CreateUserRequest) GetEmail() string

func (*CreateUserRequest) GetFirstName

func (x *CreateUserRequest) GetFirstName() string

func (*CreateUserRequest) GetLastName

func (x *CreateUserRequest) GetLastName() string

func (*CreateUserRequest) GetPassword

func (x *CreateUserRequest) GetPassword() string

func (*CreateUserRequest) GetUserId

func (x *CreateUserRequest) GetUserId() string

func (*CreateUserRequest) ProtoMessage

func (*CreateUserRequest) ProtoMessage()

func (*CreateUserRequest) ProtoReflect

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

func (*CreateUserRequest) Reset

func (x *CreateUserRequest) Reset()

func (*CreateUserRequest) String

func (x *CreateUserRequest) String() string

type DeleteUserRequest

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

func (*DeleteUserRequest) Descriptor deprecated

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

Deprecated: Use DeleteUserRequest.ProtoReflect.Descriptor instead.

func (*DeleteUserRequest) GetUserId

func (x *DeleteUserRequest) GetUserId() string

func (*DeleteUserRequest) ProtoMessage

func (*DeleteUserRequest) ProtoMessage()

func (*DeleteUserRequest) ProtoReflect

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

func (*DeleteUserRequest) Reset

func (x *DeleteUserRequest) Reset()

func (*DeleteUserRequest) String

func (x *DeleteUserRequest) String() string

type DeleteUserResponse

type DeleteUserResponse struct {
	// contains filtered or unexported fields
}

func (*DeleteUserResponse) Descriptor deprecated

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

Deprecated: Use DeleteUserResponse.ProtoReflect.Descriptor instead.

func (*DeleteUserResponse) ProtoMessage

func (*DeleteUserResponse) ProtoMessage()

func (*DeleteUserResponse) ProtoReflect

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

func (*DeleteUserResponse) Reset

func (x *DeleteUserResponse) Reset()

func (*DeleteUserResponse) String

func (x *DeleteUserResponse) String() string

type GetUserByEmailRequest

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

func (*GetUserByEmailRequest) Descriptor deprecated

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

Deprecated: Use GetUserByEmailRequest.ProtoReflect.Descriptor instead.

func (*GetUserByEmailRequest) GetEmail

func (x *GetUserByEmailRequest) GetEmail() string

func (*GetUserByEmailRequest) ProtoMessage

func (*GetUserByEmailRequest) ProtoMessage()

func (*GetUserByEmailRequest) ProtoReflect

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

func (*GetUserByEmailRequest) Reset

func (x *GetUserByEmailRequest) Reset()

func (*GetUserByEmailRequest) String

func (x *GetUserByEmailRequest) 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 GetUsersRequest

type GetUsersRequest struct {
	// contains filtered or unexported fields
}

func (*GetUsersRequest) Descriptor deprecated

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

Deprecated: Use GetUsersRequest.ProtoReflect.Descriptor instead.

func (*GetUsersRequest) ProtoMessage

func (*GetUsersRequest) ProtoMessage()

func (*GetUsersRequest) ProtoReflect

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

func (*GetUsersRequest) Reset

func (x *GetUsersRequest) Reset()

func (*GetUsersRequest) String

func (x *GetUsersRequest) String() string

type UnimplementedUserServer

type UnimplementedUserServer struct {
}

UnimplementedUserServer must be embedded to have forward compatible implementations.

func (UnimplementedUserServer) ChangeUserRole

func (UnimplementedUserServer) CreateUser

func (UnimplementedUserServer) DeleteUser

func (UnimplementedUserServer) GetUser

func (UnimplementedUserServer) GetUserByEmail

func (UnimplementedUserServer) GetUsers

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 {
	UserId    string  `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	FirstName *string `protobuf:"bytes,2,opt,name=first_name,json=firstName,proto3,oneof" json:"first_name,omitempty"`
	LastName  *string `protobuf:"bytes,3,opt,name=last_name,json=lastName,proto3,oneof" json:"last_name,omitempty"`
	Address   *string `protobuf:"bytes,4,opt,name=address,proto3,oneof" json:"address,omitempty"`
	Phone     *string `protobuf:"bytes,5,opt,name=phone,proto3,oneof" json:"phone,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateUserRequest) Descriptor deprecated

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

Deprecated: Use UpdateUserRequest.ProtoReflect.Descriptor instead.

func (*UpdateUserRequest) GetAddress

func (x *UpdateUserRequest) GetAddress() string

func (*UpdateUserRequest) GetFirstName

func (x *UpdateUserRequest) GetFirstName() string

func (*UpdateUserRequest) GetLastName

func (x *UpdateUserRequest) GetLastName() string

func (*UpdateUserRequest) GetPhone

func (x *UpdateUserRequest) GetPhone() string

func (*UpdateUserRequest) GetUserId

func (x *UpdateUserRequest) GetUserId() 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 {
	GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*UserResponse, error)
	GetUserByEmail(ctx context.Context, in *GetUserByEmailRequest, opts ...grpc.CallOption) (*UserResponse, error)
	GetUsers(ctx context.Context, in *GetUsersRequest, opts ...grpc.CallOption) (*UsersResponse, error)
	CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*UserResponse, error)
	UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*UserResponse, error)
	ChangeUserRole(ctx context.Context, in *ChangeUserRoleRequest, opts ...grpc.CallOption) (*UserResponse, error)
	DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*DeleteUserResponse, 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 UserResponse

type UserResponse struct {
	UserId    string                 `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	FirstName string                 `protobuf:"bytes,2,opt,name=first_name,json=firstName,proto3" json:"first_name,omitempty"`
	LastName  string                 `protobuf:"bytes,3,opt,name=last_name,json=lastName,proto3" json:"last_name,omitempty"`
	Password  string                 `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"`
	Email     string                 `protobuf:"bytes,5,opt,name=email,proto3" json:"email,omitempty"`
	Address   string                 `protobuf:"bytes,6,opt,name=address,proto3" json:"address,omitempty"`
	Phone     string                 `protobuf:"bytes,7,opt,name=phone,proto3" json:"phone,omitempty"`
	Role      UserRole               `protobuf:"varint,8,opt,name=role,proto3,enum=user.UserRole" json:"role,omitempty"`
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

func (*UserResponse) Descriptor deprecated

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

Deprecated: Use UserResponse.ProtoReflect.Descriptor instead.

func (*UserResponse) GetAddress

func (x *UserResponse) GetAddress() string

func (*UserResponse) GetCreatedAt

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

func (*UserResponse) GetEmail

func (x *UserResponse) GetEmail() string

func (*UserResponse) GetFirstName

func (x *UserResponse) GetFirstName() string

func (*UserResponse) GetLastName

func (x *UserResponse) GetLastName() string

func (*UserResponse) GetPassword

func (x *UserResponse) GetPassword() string

func (*UserResponse) GetPhone

func (x *UserResponse) GetPhone() string

func (*UserResponse) GetRole

func (x *UserResponse) GetRole() UserRole

func (*UserResponse) GetUpdatedAt

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

func (*UserResponse) GetUserId

func (x *UserResponse) GetUserId() string

func (*UserResponse) ProtoMessage

func (*UserResponse) ProtoMessage()

func (*UserResponse) ProtoReflect

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

func (*UserResponse) Reset

func (x *UserResponse) Reset()

func (*UserResponse) String

func (x *UserResponse) String() string

type UserRole

type UserRole int32
const (
	UserRole_GUEST      UserRole = 0
	UserRole_USER       UserRole = 1
	UserRole_ADMIN      UserRole = 2
	UserRole_SUPERADMIN UserRole = 3
)

func (UserRole) Descriptor

func (UserRole) Descriptor() protoreflect.EnumDescriptor

func (UserRole) Enum

func (x UserRole) Enum() *UserRole

func (UserRole) EnumDescriptor deprecated

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

Deprecated: Use UserRole.Descriptor instead.

func (UserRole) Number

func (x UserRole) Number() protoreflect.EnumNumber

func (UserRole) String

func (x UserRole) String() string

func (UserRole) Type

type UserServer

type UserServer interface {
	GetUser(context.Context, *GetUserRequest) (*UserResponse, error)
	GetUserByEmail(context.Context, *GetUserByEmailRequest) (*UserResponse, error)
	GetUsers(context.Context, *GetUsersRequest) (*UsersResponse, error)
	CreateUser(context.Context, *CreateUserRequest) (*UserResponse, error)
	UpdateUser(context.Context, *UpdateUserRequest) (*UserResponse, error)
	ChangeUserRole(context.Context, *ChangeUserRoleRequest) (*UserResponse, error)
	DeleteUser(context.Context, *DeleteUserRequest) (*DeleteUserResponse, error)
	// contains filtered or unexported methods
}

UserServer is the server API for User service. All implementations must embed UnimplementedUserServer for forward compatibility

type UsersResponse

type UsersResponse struct {
	Users []*UserResponse `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"`
	// contains filtered or unexported fields
}

func (*UsersResponse) Descriptor deprecated

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

Deprecated: Use UsersResponse.ProtoReflect.Descriptor instead.

func (*UsersResponse) GetUsers

func (x *UsersResponse) GetUsers() []*UserResponse

func (*UsersResponse) ProtoMessage

func (*UsersResponse) ProtoMessage()

func (*UsersResponse) ProtoReflect

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

func (*UsersResponse) Reset

func (x *UsersResponse) Reset()

func (*UsersResponse) String

func (x *UsersResponse) String() string

Jump to

Keyboard shortcuts

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