user

package
v0.0.0-...-0c70c35 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2026 License: GPL-3.0 Imports: 31 Imported by: 0

Documentation

Overview

Package user is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	UserService_CreateUser_FullMethodName = "/user.v1.UserService/CreateUser"
	UserService_GetUser_FullMethodName    = "/user.v1.UserService/GetUser"
	UserService_DeleteUser_FullMethodName = "/user.v1.UserService/DeleteUser"
)

Variables

View Source
var (
	Role_name = map[int32]string{
		0: "ADMIN",
		1: "USER",
	}
	Role_value = map[string]int32{
		"ADMIN": 0,
		"USER":  1,
	}
)

Enum value maps for Role.

View Source
var File_user_v1_user_proto protoreflect.FileDescriptor
View Source
var File_user_v1_user_service_proto protoreflect.FileDescriptor
View Source
var UserService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "user.v1.UserService",
	HandlerType: (*UserServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateUser",
			Handler:    _UserService_CreateUser_Handler,
		},
		{
			MethodName: "GetUser",
			Handler:    _UserService_GetUser_Handler,
		},
		{
			MethodName: "DeleteUser",
			Handler:    _UserService_DeleteUser_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "user/v1/user.service.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. This client ignores the HTTP middlewares.

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. GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.

func RegisterUserServiceServer

func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer)

Types

type CreateUser

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

func (*CreateUser) Descriptor deprecated

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

Deprecated: Use CreateUser.ProtoReflect.Descriptor instead.

func (*CreateUser) ProtoMessage

func (*CreateUser) ProtoMessage()

func (*CreateUser) ProtoReflect

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

func (*CreateUser) Reset

func (x *CreateUser) Reset()

func (*CreateUser) String

func (x *CreateUser) String() string

func (*CreateUser) Validate

func (m *CreateUser) Validate() error

Validate checks the field values on CreateUser with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*CreateUser) ValidateAll

func (m *CreateUser) ValidateAll() error

ValidateAll checks the field values on CreateUser with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in CreateUserMultiError, or nil if none found.

type CreateUserMultiError

type CreateUserMultiError []error

CreateUserMultiError is an error wrapping multiple validation errors returned by CreateUser.ValidateAll() if the designated constraints aren't met.

func (CreateUserMultiError) AllErrors

func (m CreateUserMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (CreateUserMultiError) Error

func (m CreateUserMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type CreateUserValidationError

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

CreateUserValidationError is the validation error returned by CreateUser.Validate if the designated constraints aren't met.

func (CreateUserValidationError) Cause

func (e CreateUserValidationError) Cause() error

Cause function returns cause value.

func (CreateUserValidationError) Error

Error satisfies the builtin error interface

func (CreateUserValidationError) ErrorName

func (e CreateUserValidationError) ErrorName() string

ErrorName returns error name.

func (CreateUserValidationError) Field

Field function returns field value.

func (CreateUserValidationError) Key

Key function returns key value.

func (CreateUserValidationError) Reason

func (e CreateUserValidationError) Reason() string

Reason function returns reason value.

type CreateUser_Request

type CreateUser_Request struct {
	Email     string                 `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"`
	Role      Role                   `protobuf:"varint,2,opt,name=role,proto3,enum=user.v1.Role" json:"role,omitempty"`
	Username  string                 `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"`
	Password  string                 `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"`
	AvatarUrl string                 `protobuf:"bytes,5,opt,name=avatar_url,json=avatarUrl,proto3" json:"avatar_url,omitempty"`
	Mobile    string                 `protobuf:"bytes,6,opt,name=mobile,proto3" json:"mobile,omitempty"`
	FirstName string                 `protobuf:"bytes,7,opt,name=first_name,json=firstName,proto3" json:"first_name,omitempty"`
	LastName  string                 `protobuf:"bytes,8,opt,name=last_name,json=lastName,proto3" json:"last_name,omitempty"`
	BirthDate *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=birth_date,json=birthDate,proto3" json:"birth_date,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateUser_Request) Descriptor deprecated

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

Deprecated: Use CreateUser_Request.ProtoReflect.Descriptor instead.

func (*CreateUser_Request) GetAvatarUrl

func (x *CreateUser_Request) GetAvatarUrl() string

func (*CreateUser_Request) GetBirthDate

func (x *CreateUser_Request) GetBirthDate() *timestamppb.Timestamp

func (*CreateUser_Request) GetEmail

func (x *CreateUser_Request) GetEmail() string

func (*CreateUser_Request) GetFirstName

func (x *CreateUser_Request) GetFirstName() string

func (*CreateUser_Request) GetLastName

func (x *CreateUser_Request) GetLastName() string

func (*CreateUser_Request) GetMobile

func (x *CreateUser_Request) GetMobile() string

func (*CreateUser_Request) GetPassword

func (x *CreateUser_Request) GetPassword() string

func (*CreateUser_Request) GetRole

func (x *CreateUser_Request) GetRole() Role

func (*CreateUser_Request) GetUsername

func (x *CreateUser_Request) GetUsername() string

func (*CreateUser_Request) ProtoMessage

func (*CreateUser_Request) ProtoMessage()

func (*CreateUser_Request) ProtoReflect

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

func (*CreateUser_Request) Reset

func (x *CreateUser_Request) Reset()

func (*CreateUser_Request) String

func (x *CreateUser_Request) String() string

func (*CreateUser_Request) Validate

func (m *CreateUser_Request) Validate() error

Validate checks the field values on CreateUser_Request with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*CreateUser_Request) ValidateAll

func (m *CreateUser_Request) ValidateAll() error

ValidateAll checks the field values on CreateUser_Request with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in CreateUser_RequestMultiError, or nil if none found.

type CreateUser_RequestMultiError

type CreateUser_RequestMultiError []error

CreateUser_RequestMultiError is an error wrapping multiple validation errors returned by CreateUser_Request.ValidateAll() if the designated constraints aren't met.

func (CreateUser_RequestMultiError) AllErrors

func (m CreateUser_RequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (CreateUser_RequestMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type CreateUser_RequestValidationError

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

CreateUser_RequestValidationError is the validation error returned by CreateUser_Request.Validate if the designated constraints aren't met.

func (CreateUser_RequestValidationError) Cause

Cause function returns cause value.

func (CreateUser_RequestValidationError) Error

Error satisfies the builtin error interface

func (CreateUser_RequestValidationError) ErrorName

ErrorName returns error name.

func (CreateUser_RequestValidationError) Field

Field function returns field value.

func (CreateUser_RequestValidationError) Key

Key function returns key value.

func (CreateUser_RequestValidationError) Reason

Reason function returns reason value.

type CreateUser_Response

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

func (*CreateUser_Response) Descriptor deprecated

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

Deprecated: Use CreateUser_Response.ProtoReflect.Descriptor instead.

func (*CreateUser_Response) GetId

func (x *CreateUser_Response) GetId() string

func (*CreateUser_Response) ProtoMessage

func (*CreateUser_Response) ProtoMessage()

func (*CreateUser_Response) ProtoReflect

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

func (*CreateUser_Response) Reset

func (x *CreateUser_Response) Reset()

func (*CreateUser_Response) String

func (x *CreateUser_Response) String() string

func (*CreateUser_Response) Validate

func (m *CreateUser_Response) Validate() error

Validate checks the field values on CreateUser_Response with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*CreateUser_Response) ValidateAll

func (m *CreateUser_Response) ValidateAll() error

ValidateAll checks the field values on CreateUser_Response with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in CreateUser_ResponseMultiError, or nil if none found.

type CreateUser_ResponseMultiError

type CreateUser_ResponseMultiError []error

CreateUser_ResponseMultiError is an error wrapping multiple validation errors returned by CreateUser_Response.ValidateAll() if the designated constraints aren't met.

func (CreateUser_ResponseMultiError) AllErrors

func (m CreateUser_ResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (CreateUser_ResponseMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type CreateUser_ResponseValidationError

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

CreateUser_ResponseValidationError is the validation error returned by CreateUser_Response.Validate if the designated constraints aren't met.

func (CreateUser_ResponseValidationError) Cause

Cause function returns cause value.

func (CreateUser_ResponseValidationError) Error

Error satisfies the builtin error interface

func (CreateUser_ResponseValidationError) ErrorName

ErrorName returns error name.

func (CreateUser_ResponseValidationError) Field

Field function returns field value.

func (CreateUser_ResponseValidationError) Key

Key function returns key value.

func (CreateUser_ResponseValidationError) Reason

Reason function returns reason value.

type DeleteUser

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

func (*DeleteUser) Descriptor deprecated

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

Deprecated: Use DeleteUser.ProtoReflect.Descriptor instead.

func (*DeleteUser) ProtoMessage

func (*DeleteUser) ProtoMessage()

func (*DeleteUser) ProtoReflect

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

func (*DeleteUser) Reset

func (x *DeleteUser) Reset()

func (*DeleteUser) String

func (x *DeleteUser) String() string

func (*DeleteUser) Validate

func (m *DeleteUser) Validate() error

Validate checks the field values on DeleteUser with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*DeleteUser) ValidateAll

func (m *DeleteUser) ValidateAll() error

ValidateAll checks the field values on DeleteUser with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in DeleteUserMultiError, or nil if none found.

type DeleteUserMultiError

type DeleteUserMultiError []error

DeleteUserMultiError is an error wrapping multiple validation errors returned by DeleteUser.ValidateAll() if the designated constraints aren't met.

func (DeleteUserMultiError) AllErrors

func (m DeleteUserMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (DeleteUserMultiError) Error

func (m DeleteUserMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type DeleteUserValidationError

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

DeleteUserValidationError is the validation error returned by DeleteUser.Validate if the designated constraints aren't met.

func (DeleteUserValidationError) Cause

func (e DeleteUserValidationError) Cause() error

Cause function returns cause value.

func (DeleteUserValidationError) Error

Error satisfies the builtin error interface

func (DeleteUserValidationError) ErrorName

func (e DeleteUserValidationError) ErrorName() string

ErrorName returns error name.

func (DeleteUserValidationError) Field

Field function returns field value.

func (DeleteUserValidationError) Key

Key function returns key value.

func (DeleteUserValidationError) Reason

func (e DeleteUserValidationError) Reason() string

Reason function returns reason value.

type DeleteUser_Request

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

func (*DeleteUser_Request) Descriptor deprecated

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

Deprecated: Use DeleteUser_Request.ProtoReflect.Descriptor instead.

func (*DeleteUser_Request) GetId

func (x *DeleteUser_Request) GetId() string

func (*DeleteUser_Request) ProtoMessage

func (*DeleteUser_Request) ProtoMessage()

func (*DeleteUser_Request) ProtoReflect

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

func (*DeleteUser_Request) Reset

func (x *DeleteUser_Request) Reset()

func (*DeleteUser_Request) String

func (x *DeleteUser_Request) String() string

func (*DeleteUser_Request) Validate

func (m *DeleteUser_Request) Validate() error

Validate checks the field values on DeleteUser_Request with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*DeleteUser_Request) ValidateAll

func (m *DeleteUser_Request) ValidateAll() error

ValidateAll checks the field values on DeleteUser_Request with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in DeleteUser_RequestMultiError, or nil if none found.

type DeleteUser_RequestMultiError

type DeleteUser_RequestMultiError []error

DeleteUser_RequestMultiError is an error wrapping multiple validation errors returned by DeleteUser_Request.ValidateAll() if the designated constraints aren't met.

func (DeleteUser_RequestMultiError) AllErrors

func (m DeleteUser_RequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (DeleteUser_RequestMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type DeleteUser_RequestValidationError

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

DeleteUser_RequestValidationError is the validation error returned by DeleteUser_Request.Validate if the designated constraints aren't met.

func (DeleteUser_RequestValidationError) Cause

Cause function returns cause value.

func (DeleteUser_RequestValidationError) Error

Error satisfies the builtin error interface

func (DeleteUser_RequestValidationError) ErrorName

ErrorName returns error name.

func (DeleteUser_RequestValidationError) Field

Field function returns field value.

func (DeleteUser_RequestValidationError) Key

Key function returns key value.

func (DeleteUser_RequestValidationError) Reason

Reason function returns reason value.

type DeleteUser_Response

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

func (*DeleteUser_Response) Descriptor deprecated

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

Deprecated: Use DeleteUser_Response.ProtoReflect.Descriptor instead.

func (*DeleteUser_Response) ProtoMessage

func (*DeleteUser_Response) ProtoMessage()

func (*DeleteUser_Response) ProtoReflect

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

func (*DeleteUser_Response) Reset

func (x *DeleteUser_Response) Reset()

func (*DeleteUser_Response) String

func (x *DeleteUser_Response) String() string

func (*DeleteUser_Response) Validate

func (m *DeleteUser_Response) Validate() error

Validate checks the field values on DeleteUser_Response with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*DeleteUser_Response) ValidateAll

func (m *DeleteUser_Response) ValidateAll() error

ValidateAll checks the field values on DeleteUser_Response with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in DeleteUser_ResponseMultiError, or nil if none found.

type DeleteUser_ResponseMultiError

type DeleteUser_ResponseMultiError []error

DeleteUser_ResponseMultiError is an error wrapping multiple validation errors returned by DeleteUser_Response.ValidateAll() if the designated constraints aren't met.

func (DeleteUser_ResponseMultiError) AllErrors

func (m DeleteUser_ResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (DeleteUser_ResponseMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type DeleteUser_ResponseValidationError

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

DeleteUser_ResponseValidationError is the validation error returned by DeleteUser_Response.Validate if the designated constraints aren't met.

func (DeleteUser_ResponseValidationError) Cause

Cause function returns cause value.

func (DeleteUser_ResponseValidationError) Error

Error satisfies the builtin error interface

func (DeleteUser_ResponseValidationError) ErrorName

ErrorName returns error name.

func (DeleteUser_ResponseValidationError) Field

Field function returns field value.

func (DeleteUser_ResponseValidationError) Key

Key function returns key value.

func (DeleteUser_ResponseValidationError) Reason

Reason function returns reason value.

type GetUser

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

func (*GetUser) Descriptor deprecated

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

Deprecated: Use GetUser.ProtoReflect.Descriptor instead.

func (*GetUser) ProtoMessage

func (*GetUser) ProtoMessage()

func (*GetUser) ProtoReflect

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

func (*GetUser) Reset

func (x *GetUser) Reset()

func (*GetUser) String

func (x *GetUser) String() string

func (*GetUser) Validate

func (m *GetUser) Validate() error

Validate checks the field values on GetUser with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*GetUser) ValidateAll

func (m *GetUser) ValidateAll() error

ValidateAll checks the field values on GetUser with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in GetUserMultiError, or nil if none found.

type GetUserMultiError

type GetUserMultiError []error

GetUserMultiError is an error wrapping multiple validation errors returned by GetUser.ValidateAll() if the designated constraints aren't met.

func (GetUserMultiError) AllErrors

func (m GetUserMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (GetUserMultiError) Error

func (m GetUserMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type GetUserValidationError

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

GetUserValidationError is the validation error returned by GetUser.Validate if the designated constraints aren't met.

func (GetUserValidationError) Cause

func (e GetUserValidationError) Cause() error

Cause function returns cause value.

func (GetUserValidationError) Error

func (e GetUserValidationError) Error() string

Error satisfies the builtin error interface

func (GetUserValidationError) ErrorName

func (e GetUserValidationError) ErrorName() string

ErrorName returns error name.

func (GetUserValidationError) Field

func (e GetUserValidationError) Field() string

Field function returns field value.

func (GetUserValidationError) Key

func (e GetUserValidationError) Key() bool

Key function returns key value.

func (GetUserValidationError) Reason

func (e GetUserValidationError) Reason() string

Reason function returns reason value.

type GetUser_Request

type GetUser_Request struct {
	Id    *string `protobuf:"bytes,1,opt,name=id,proto3,oneof" json:"id,omitempty"`
	Email *string `protobuf:"bytes,2,opt,name=email,proto3,oneof" json:"email,omitempty"`
	// contains filtered or unexported fields
}

func (*GetUser_Request) Descriptor deprecated

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

Deprecated: Use GetUser_Request.ProtoReflect.Descriptor instead.

func (*GetUser_Request) GetEmail

func (x *GetUser_Request) GetEmail() string

func (*GetUser_Request) GetId

func (x *GetUser_Request) GetId() string

func (*GetUser_Request) ProtoMessage

func (*GetUser_Request) ProtoMessage()

func (*GetUser_Request) ProtoReflect

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

func (*GetUser_Request) Reset

func (x *GetUser_Request) Reset()

func (*GetUser_Request) String

func (x *GetUser_Request) String() string

func (*GetUser_Request) Validate

func (m *GetUser_Request) Validate() error

Validate checks the field values on GetUser_Request with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*GetUser_Request) ValidateAll

func (m *GetUser_Request) ValidateAll() error

ValidateAll checks the field values on GetUser_Request with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in GetUser_RequestMultiError, or nil if none found.

type GetUser_RequestMultiError

type GetUser_RequestMultiError []error

GetUser_RequestMultiError is an error wrapping multiple validation errors returned by GetUser_Request.ValidateAll() if the designated constraints aren't met.

func (GetUser_RequestMultiError) AllErrors

func (m GetUser_RequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (GetUser_RequestMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type GetUser_RequestValidationError

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

GetUser_RequestValidationError is the validation error returned by GetUser_Request.Validate if the designated constraints aren't met.

func (GetUser_RequestValidationError) Cause

Cause function returns cause value.

func (GetUser_RequestValidationError) Error

Error satisfies the builtin error interface

func (GetUser_RequestValidationError) ErrorName

func (e GetUser_RequestValidationError) ErrorName() string

ErrorName returns error name.

func (GetUser_RequestValidationError) Field

Field function returns field value.

func (GetUser_RequestValidationError) Key

Key function returns key value.

func (GetUser_RequestValidationError) Reason

Reason function returns reason value.

type GetUser_Response

type GetUser_Response struct {
	User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
	// contains filtered or unexported fields
}

func (*GetUser_Response) Descriptor deprecated

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

Deprecated: Use GetUser_Response.ProtoReflect.Descriptor instead.

func (*GetUser_Response) GetUser

func (x *GetUser_Response) GetUser() *User

func (*GetUser_Response) ProtoMessage

func (*GetUser_Response) ProtoMessage()

func (*GetUser_Response) ProtoReflect

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

func (*GetUser_Response) Reset

func (x *GetUser_Response) Reset()

func (*GetUser_Response) String

func (x *GetUser_Response) String() string

func (*GetUser_Response) Validate

func (m *GetUser_Response) Validate() error

Validate checks the field values on GetUser_Response with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*GetUser_Response) ValidateAll

func (m *GetUser_Response) ValidateAll() error

ValidateAll checks the field values on GetUser_Response with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in GetUser_ResponseMultiError, or nil if none found.

type GetUser_ResponseMultiError

type GetUser_ResponseMultiError []error

GetUser_ResponseMultiError is an error wrapping multiple validation errors returned by GetUser_Response.ValidateAll() if the designated constraints aren't met.

func (GetUser_ResponseMultiError) AllErrors

func (m GetUser_ResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (GetUser_ResponseMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type GetUser_ResponseValidationError

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

GetUser_ResponseValidationError is the validation error returned by GetUser_Response.Validate if the designated constraints aren't met.

func (GetUser_ResponseValidationError) Cause

Cause function returns cause value.

func (GetUser_ResponseValidationError) Error

Error satisfies the builtin error interface

func (GetUser_ResponseValidationError) ErrorName

ErrorName returns error name.

func (GetUser_ResponseValidationError) Field

Field function returns field value.

func (GetUser_ResponseValidationError) Key

Key function returns key value.

func (GetUser_ResponseValidationError) Reason

Reason function returns reason value.

type Role

type Role int32
const (
	Role_ADMIN Role = 0
	Role_USER  Role = 1
)

func (Role) Descriptor

func (Role) Descriptor() protoreflect.EnumDescriptor

func (Role) Enum

func (x Role) Enum() *Role

func (Role) EnumDescriptor deprecated

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

Deprecated: Use Role.Descriptor instead.

func (Role) Number

func (x Role) Number() protoreflect.EnumNumber

func (Role) String

func (x Role) String() string

func (Role) Type

func (Role) Type() protoreflect.EnumType

type UnimplementedUserServiceServer

type UnimplementedUserServiceServer struct{}

UnimplementedUserServiceServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedUserServiceServer) CreateUser

func (UnimplementedUserServiceServer) DeleteUser

func (UnimplementedUserServiceServer) GetUser

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"`
	Email     string                 `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"`
	Role      Role                   `protobuf:"varint,3,opt,name=role,proto3,enum=user.v1.Role" json:"role,omitempty"`
	Username  string                 `protobuf:"bytes,4,opt,name=username,proto3" json:"username,omitempty"`
	Password  string                 `protobuf:"bytes,5,opt,name=password,proto3" json:"password,omitempty"`
	AvatarUrl string                 `protobuf:"bytes,6,opt,name=avatar_url,json=avatarUrl,proto3" json:"avatar_url,omitempty"`
	Mobile    string                 `protobuf:"bytes,7,opt,name=mobile,proto3" json:"mobile,omitempty"`
	FirstName string                 `protobuf:"bytes,8,opt,name=first_name,json=firstName,proto3" json:"first_name,omitempty"`
	LastName  string                 `protobuf:"bytes,9,opt,name=last_name,json=lastName,proto3" json:"last_name,omitempty"`
	BirthDate *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=birth_date,json=birthDate,proto3" json:"birth_date,omitempty"`
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	// contains filtered or unexported fields
}

func (*User) Descriptor deprecated

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

Deprecated: Use User.ProtoReflect.Descriptor instead.

func (*User) GetAvatarUrl

func (x *User) GetAvatarUrl() string

func (*User) GetBirthDate

func (x *User) GetBirthDate() *timestamppb.Timestamp

func (*User) GetCreatedAt

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

func (*User) GetEmail

func (x *User) GetEmail() string

func (*User) GetFirstName

func (x *User) GetFirstName() string

func (*User) GetId

func (x *User) GetId() string

func (*User) GetLastName

func (x *User) GetLastName() string

func (*User) GetMobile

func (x *User) GetMobile() string

func (*User) GetPassword

func (x *User) GetPassword() string

func (*User) GetRole

func (x *User) GetRole() Role

func (*User) GetUsername

func (x *User) GetUsername() 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

func (*User) Validate

func (m *User) Validate() error

Validate checks the field values on User with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*User) ValidateAll

func (m *User) ValidateAll() error

ValidateAll checks the field values on User with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in UserMultiError, or nil if none found.

type UserMultiError

type UserMultiError []error

UserMultiError is an error wrapping multiple validation errors returned by User.ValidateAll() if the designated constraints aren't met.

func (UserMultiError) AllErrors

func (m UserMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (UserMultiError) Error

func (m UserMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type UserServiceClient

type UserServiceClient interface {
	CreateUser(ctx context.Context, in *CreateUser_Request, opts ...grpc.CallOption) (*CreateUser_Response, error)
	GetUser(ctx context.Context, in *GetUser_Request, opts ...grpc.CallOption) (*GetUser_Response, error)
	DeleteUser(ctx context.Context, in *DeleteUser_Request, opts ...grpc.CallOption) (*DeleteUser_Response, 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 {
	CreateUser(context.Context, *CreateUser_Request) (*CreateUser_Response, error)
	GetUser(context.Context, *GetUser_Request) (*GetUser_Response, error)
	DeleteUser(context.Context, *DeleteUser_Request) (*DeleteUser_Response, error)
	// contains filtered or unexported methods
}

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

type UserValidationError

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

UserValidationError is the validation error returned by User.Validate if the designated constraints aren't met.

func (UserValidationError) Cause

func (e UserValidationError) Cause() error

Cause function returns cause value.

func (UserValidationError) Error

func (e UserValidationError) Error() string

Error satisfies the builtin error interface

func (UserValidationError) ErrorName

func (e UserValidationError) ErrorName() string

ErrorName returns error name.

func (UserValidationError) Field

func (e UserValidationError) Field() string

Field function returns field value.

func (UserValidationError) Key

func (e UserValidationError) Key() bool

Key function returns key value.

func (UserValidationError) Reason

func (e UserValidationError) Reason() string

Reason function returns reason value.

Jump to

Keyboard shortcuts

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