Documentation
¶
Overview ¶
Package basev1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterUserServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterUserServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UserServiceClient) error
- func RegisterUserServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterUserServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UserServiceServer) error
- func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer)
- type ErrorCode
- type ErrorResponse
- func (*ErrorResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ErrorResponse) GetCode() ErrorCode
- func (x *ErrorResponse) GetMessage() string
- func (*ErrorResponse) ProtoMessage()
- func (x *ErrorResponse) ProtoReflect() protoreflect.Message
- func (x *ErrorResponse) Reset()
- func (x *ErrorResponse) String() string
- func (m *ErrorResponse) Validate() error
- func (m *ErrorResponse) ValidateAll() error
- type ErrorResponseMultiError
- type ErrorResponseValidationError
- func (e ErrorResponseValidationError) Cause() error
- func (e ErrorResponseValidationError) Error() string
- func (e ErrorResponseValidationError) ErrorName() string
- func (e ErrorResponseValidationError) Field() string
- func (e ErrorResponseValidationError) Key() bool
- func (e ErrorResponseValidationError) Reason() string
- type MessageResponse
- func (*MessageResponse) Descriptor() ([]byte, []int)deprecated
- func (x *MessageResponse) GetMessage() string
- func (*MessageResponse) ProtoMessage()
- func (x *MessageResponse) ProtoReflect() protoreflect.Message
- func (x *MessageResponse) Reset()
- func (x *MessageResponse) String() string
- func (m *MessageResponse) Validate() error
- func (m *MessageResponse) ValidateAll() error
- type MessageResponseMultiError
- type MessageResponseValidationError
- func (e MessageResponseValidationError) Cause() error
- func (e MessageResponseValidationError) Error() string
- func (e MessageResponseValidationError) ErrorName() string
- func (e MessageResponseValidationError) Field() string
- func (e MessageResponseValidationError) Key() bool
- func (e MessageResponseValidationError) Reason() string
- type UnimplementedUserServiceServer
- type UnsafeUserServiceServer
- type User
- func (*User) Descriptor() ([]byte, []int)deprecated
- func (x *User) GetCreatedAt() *timestamppb.Timestamp
- func (x *User) GetId() uint64
- func (x *User) GetName() string
- func (*User) ProtoMessage()
- func (x *User) ProtoReflect() protoreflect.Message
- func (x *User) Reset()
- func (x *User) String() string
- func (m *User) Validate() error
- func (m *User) ValidateAll() error
- type UserCreateRequest
- func (*UserCreateRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UserCreateRequest) GetId() string
- func (x *UserCreateRequest) GetName() string
- func (*UserCreateRequest) ProtoMessage()
- func (x *UserCreateRequest) ProtoReflect() protoreflect.Message
- func (x *UserCreateRequest) Reset()
- func (x *UserCreateRequest) String() string
- func (m *UserCreateRequest) Validate() error
- func (m *UserCreateRequest) ValidateAll() error
- type UserCreateRequestMultiError
- type UserCreateRequestValidationError
- func (e UserCreateRequestValidationError) Cause() error
- func (e UserCreateRequestValidationError) Error() string
- func (e UserCreateRequestValidationError) ErrorName() string
- func (e UserCreateRequestValidationError) Field() string
- func (e UserCreateRequestValidationError) Key() bool
- func (e UserCreateRequestValidationError) Reason() string
- type UserListRequest
- func (*UserListRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UserListRequest) GetPage() uint32
- func (x *UserListRequest) GetSize() uint32
- func (*UserListRequest) ProtoMessage()
- func (x *UserListRequest) ProtoReflect() protoreflect.Message
- func (x *UserListRequest) Reset()
- func (x *UserListRequest) String() string
- func (m *UserListRequest) Validate() error
- func (m *UserListRequest) ValidateAll() error
- type UserListRequestMultiError
- type UserListRequestValidationError
- func (e UserListRequestValidationError) Cause() error
- func (e UserListRequestValidationError) Error() string
- func (e UserListRequestValidationError) ErrorName() string
- func (e UserListRequestValidationError) Field() string
- func (e UserListRequestValidationError) Key() bool
- func (e UserListRequestValidationError) Reason() string
- type UserListResponse
- func (*UserListResponse) Descriptor() ([]byte, []int)deprecated
- func (x *UserListResponse) GetUsers() []*User
- func (*UserListResponse) ProtoMessage()
- func (x *UserListResponse) ProtoReflect() protoreflect.Message
- func (x *UserListResponse) Reset()
- func (x *UserListResponse) String() string
- func (m *UserListResponse) Validate() error
- func (m *UserListResponse) ValidateAll() error
- type UserListResponseMultiError
- type UserListResponseValidationError
- func (e UserListResponseValidationError) Cause() error
- func (e UserListResponseValidationError) Error() string
- func (e UserListResponseValidationError) ErrorName() string
- func (e UserListResponseValidationError) Field() string
- func (e UserListResponseValidationError) Key() bool
- func (e UserListResponseValidationError) Reason() string
- type UserMultiError
- type UserServiceClient
- type UserServiceServer
- type UserValidationError
Constants ¶
const ( UserService_Create_FullMethodName = "/base.v1.UserService/Create" UserService_List_FullMethodName = "/base.v1.UserService/List" )
Variables ¶
var ( ErrorCode_name = map[int32]string{ 0: "ERROR_CODE_UNSPECIFIED", 1001: "ERROR_CODE_MISSING_BEARER_TOKEN", 1002: "ERROR_CODE_UNAUTHENTICATED", 1003: "ERROR_CODE_INVALID_BEARER_TOKEN", 2000: "ERROR_CODE_VALIDATION", 2001: "ERROR_CODE_UNIQUE_CONSTRAINT", 2002: "ERROR_CODE_INVALID_ARGUMENT", 2003: "ERROR_CODE_MISSING_ARGUMENT", 2004: "ERROR_CODE_ALREADY_EXIST", 2005: "ERROR_CODE_INVALID_KEY", 4000: "ERROR_CODE_NOT_FOUND", 5000: "ERROR_CODE_INTERNAL", 5001: "ERROR_CODE_CANCELLED", 5002: "ERROR_CODE_SQL_BUILDER", 5003: "ERROR_CODE_CIRCUIT_BREAKER", 5004: "ERROR_CODE_EXECUTION", 5005: "ERROR_CODE_SCAN", 5006: "ERROR_CODE_MIGRATION", 5007: "ERROR_CODE_TYPE_CONVERSATION", 5008: "ERROR_CODE_ROLLBACK", 5009: "ERROR_CODE_NOT_IMPLEMENTED", 5010: "ERROR_CODE_DATASTORE", 5011: "ERROR_CODE_SERIALIZATION", } ErrorCode_value = map[string]int32{ "ERROR_CODE_UNSPECIFIED": 0, "ERROR_CODE_MISSING_BEARER_TOKEN": 1001, "ERROR_CODE_UNAUTHENTICATED": 1002, "ERROR_CODE_INVALID_BEARER_TOKEN": 1003, "ERROR_CODE_VALIDATION": 2000, "ERROR_CODE_UNIQUE_CONSTRAINT": 2001, "ERROR_CODE_INVALID_ARGUMENT": 2002, "ERROR_CODE_MISSING_ARGUMENT": 2003, "ERROR_CODE_ALREADY_EXIST": 2004, "ERROR_CODE_INVALID_KEY": 2005, "ERROR_CODE_NOT_FOUND": 4000, "ERROR_CODE_INTERNAL": 5000, "ERROR_CODE_CANCELLED": 5001, "ERROR_CODE_SQL_BUILDER": 5002, "ERROR_CODE_CIRCUIT_BREAKER": 5003, "ERROR_CODE_EXECUTION": 5004, "ERROR_CODE_SCAN": 5005, "ERROR_CODE_MIGRATION": 5006, "ERROR_CODE_TYPE_CONVERSATION": 5007, "ERROR_CODE_ROLLBACK": 5008, "ERROR_CODE_NOT_IMPLEMENTED": 5009, "ERROR_CODE_DATASTORE": 5010, "ERROR_CODE_SERIALIZATION": 5011, } )
Enum value maps for ErrorCode.
var File_base_v1_base_proto protoreflect.FileDescriptor
var File_base_v1_errors_proto protoreflect.FileDescriptor
var File_base_v1_openapi_proto protoreflect.FileDescriptor
var File_base_v1_service_proto protoreflect.FileDescriptor
var UserService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "base.v1.UserService", HandlerType: (*UserServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Create", Handler: _UserService_Create_Handler, }, { MethodName: "List", Handler: _UserService_List_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "base/v1/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.
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 ErrorCode ¶
type ErrorCode int32
const ( ErrorCode_ERROR_CODE_UNSPECIFIED ErrorCode = 0 // authn ErrorCode_ERROR_CODE_MISSING_BEARER_TOKEN ErrorCode = 1001 ErrorCode_ERROR_CODE_UNAUTHENTICATED ErrorCode = 1002 ErrorCode_ERROR_CODE_INVALID_BEARER_TOKEN ErrorCode = 1003 // validation ErrorCode_ERROR_CODE_VALIDATION ErrorCode = 2000 ErrorCode_ERROR_CODE_UNIQUE_CONSTRAINT ErrorCode = 2001 ErrorCode_ERROR_CODE_INVALID_ARGUMENT ErrorCode = 2002 ErrorCode_ERROR_CODE_MISSING_ARGUMENT ErrorCode = 2003 ErrorCode_ERROR_CODE_ALREADY_EXIST ErrorCode = 2004 ErrorCode_ERROR_CODE_INVALID_KEY ErrorCode = 2005 // not found ErrorCode_ERROR_CODE_NOT_FOUND ErrorCode = 4000 // internal ErrorCode_ERROR_CODE_INTERNAL ErrorCode = 5000 ErrorCode_ERROR_CODE_CANCELLED ErrorCode = 5001 ErrorCode_ERROR_CODE_SQL_BUILDER ErrorCode = 5002 ErrorCode_ERROR_CODE_CIRCUIT_BREAKER ErrorCode = 5003 ErrorCode_ERROR_CODE_EXECUTION ErrorCode = 5004 ErrorCode_ERROR_CODE_SCAN ErrorCode = 5005 ErrorCode_ERROR_CODE_MIGRATION ErrorCode = 5006 ErrorCode_ERROR_CODE_TYPE_CONVERSATION ErrorCode = 5007 ErrorCode_ERROR_CODE_ROLLBACK ErrorCode = 5008 ErrorCode_ERROR_CODE_NOT_IMPLEMENTED ErrorCode = 5009 ErrorCode_ERROR_CODE_DATASTORE ErrorCode = 5010 ErrorCode_ERROR_CODE_SERIALIZATION ErrorCode = 5011 )
func (ErrorCode) Descriptor ¶
func (ErrorCode) Descriptor() protoreflect.EnumDescriptor
func (ErrorCode) EnumDescriptor
deprecated
func (ErrorCode) Number ¶
func (x ErrorCode) Number() protoreflect.EnumNumber
func (ErrorCode) Type ¶
func (ErrorCode) Type() protoreflect.EnumType
type ErrorResponse ¶
type ErrorResponse struct { Code ErrorCode `protobuf:"varint,1,opt,name=code,proto3,enum=base.v1.ErrorCode" json:"code,omitempty"` Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
ErrorResponse
func (*ErrorResponse) Descriptor
deprecated
func (*ErrorResponse) Descriptor() ([]byte, []int)
Deprecated: Use ErrorResponse.ProtoReflect.Descriptor instead.
func (*ErrorResponse) GetCode ¶
func (x *ErrorResponse) GetCode() ErrorCode
func (*ErrorResponse) GetMessage ¶
func (x *ErrorResponse) GetMessage() string
func (*ErrorResponse) ProtoMessage ¶
func (*ErrorResponse) ProtoMessage()
func (*ErrorResponse) ProtoReflect ¶
func (x *ErrorResponse) ProtoReflect() protoreflect.Message
func (*ErrorResponse) Reset ¶
func (x *ErrorResponse) Reset()
func (*ErrorResponse) String ¶
func (x *ErrorResponse) String() string
func (*ErrorResponse) Validate ¶
func (m *ErrorResponse) Validate() error
Validate checks the field values on ErrorResponse 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 (*ErrorResponse) ValidateAll ¶
func (m *ErrorResponse) ValidateAll() error
ValidateAll checks the field values on ErrorResponse 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 ErrorResponseMultiError, or nil if none found.
type ErrorResponseMultiError ¶
type ErrorResponseMultiError []error
ErrorResponseMultiError is an error wrapping multiple validation errors returned by ErrorResponse.ValidateAll() if the designated constraints aren't met.
func (ErrorResponseMultiError) AllErrors ¶
func (m ErrorResponseMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ErrorResponseMultiError) Error ¶
func (m ErrorResponseMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ErrorResponseValidationError ¶
type ErrorResponseValidationError struct {
// contains filtered or unexported fields
}
ErrorResponseValidationError is the validation error returned by ErrorResponse.Validate if the designated constraints aren't met.
func (ErrorResponseValidationError) Cause ¶
func (e ErrorResponseValidationError) Cause() error
Cause function returns cause value.
func (ErrorResponseValidationError) Error ¶
func (e ErrorResponseValidationError) Error() string
Error satisfies the builtin error interface
func (ErrorResponseValidationError) ErrorName ¶
func (e ErrorResponseValidationError) ErrorName() string
ErrorName returns error name.
func (ErrorResponseValidationError) Field ¶
func (e ErrorResponseValidationError) Field() string
Field function returns field value.
func (ErrorResponseValidationError) Key ¶
func (e ErrorResponseValidationError) Key() bool
Key function returns key value.
func (ErrorResponseValidationError) Reason ¶
func (e ErrorResponseValidationError) Reason() string
Reason function returns reason value.
type MessageResponse ¶
type MessageResponse struct { // message is a string message. Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
MessageResponse
func (*MessageResponse) Descriptor
deprecated
func (*MessageResponse) Descriptor() ([]byte, []int)
Deprecated: Use MessageResponse.ProtoReflect.Descriptor instead.
func (*MessageResponse) GetMessage ¶
func (x *MessageResponse) GetMessage() string
func (*MessageResponse) ProtoMessage ¶
func (*MessageResponse) ProtoMessage()
func (*MessageResponse) ProtoReflect ¶
func (x *MessageResponse) ProtoReflect() protoreflect.Message
func (*MessageResponse) Reset ¶
func (x *MessageResponse) Reset()
func (*MessageResponse) String ¶
func (x *MessageResponse) String() string
func (*MessageResponse) Validate ¶
func (m *MessageResponse) Validate() error
Validate checks the field values on MessageResponse 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 (*MessageResponse) ValidateAll ¶
func (m *MessageResponse) ValidateAll() error
ValidateAll checks the field values on MessageResponse 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 MessageResponseMultiError, or nil if none found.
type MessageResponseMultiError ¶
type MessageResponseMultiError []error
MessageResponseMultiError is an error wrapping multiple validation errors returned by MessageResponse.ValidateAll() if the designated constraints aren't met.
func (MessageResponseMultiError) AllErrors ¶
func (m MessageResponseMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (MessageResponseMultiError) Error ¶
func (m MessageResponseMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type MessageResponseValidationError ¶
type MessageResponseValidationError struct {
// contains filtered or unexported fields
}
MessageResponseValidationError is the validation error returned by MessageResponse.Validate if the designated constraints aren't met.
func (MessageResponseValidationError) Cause ¶
func (e MessageResponseValidationError) Cause() error
Cause function returns cause value.
func (MessageResponseValidationError) Error ¶
func (e MessageResponseValidationError) Error() string
Error satisfies the builtin error interface
func (MessageResponseValidationError) ErrorName ¶
func (e MessageResponseValidationError) ErrorName() string
ErrorName returns error name.
func (MessageResponseValidationError) Field ¶
func (e MessageResponseValidationError) Field() string
Field function returns field value.
func (MessageResponseValidationError) Key ¶
func (e MessageResponseValidationError) Key() bool
Key function returns key value.
func (MessageResponseValidationError) Reason ¶
func (e MessageResponseValidationError) Reason() string
Reason function returns reason value.
type UnimplementedUserServiceServer ¶
type UnimplementedUserServiceServer struct { }
UnimplementedUserServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedUserServiceServer) Create ¶
func (UnimplementedUserServiceServer) Create(context.Context, *UserCreateRequest) (*MessageResponse, error)
func (UnimplementedUserServiceServer) List ¶
func (UnimplementedUserServiceServer) List(context.Context, *UserListRequest) (*UserListResponse, error)
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 uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // The ID of the user. Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // The name of the user. CreatedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=created_at,proto3" json:"created_at,omitempty"` // The time at which the user was created. // contains filtered or unexported fields }
User represents a single user in the system.
func (*User) Descriptor
deprecated
func (*User) GetCreatedAt ¶
func (x *User) GetCreatedAt() *timestamppb.Timestamp
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message
func (*User) Validate ¶
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 ¶
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 UserCreateRequest ¶
type UserCreateRequest struct { // id is a unique identifier for the user. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // name is the name of the user. Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
UserCreateRequest is the message used for the request to create a user.
func (*UserCreateRequest) Descriptor
deprecated
func (*UserCreateRequest) Descriptor() ([]byte, []int)
Deprecated: Use UserCreateRequest.ProtoReflect.Descriptor instead.
func (*UserCreateRequest) GetId ¶
func (x *UserCreateRequest) GetId() string
func (*UserCreateRequest) GetName ¶
func (x *UserCreateRequest) GetName() string
func (*UserCreateRequest) ProtoMessage ¶
func (*UserCreateRequest) ProtoMessage()
func (*UserCreateRequest) ProtoReflect ¶
func (x *UserCreateRequest) ProtoReflect() protoreflect.Message
func (*UserCreateRequest) Reset ¶
func (x *UserCreateRequest) Reset()
func (*UserCreateRequest) String ¶
func (x *UserCreateRequest) String() string
func (*UserCreateRequest) Validate ¶
func (m *UserCreateRequest) Validate() error
Validate checks the field values on UserCreateRequest 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 (*UserCreateRequest) ValidateAll ¶
func (m *UserCreateRequest) ValidateAll() error
ValidateAll checks the field values on UserCreateRequest 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 UserCreateRequestMultiError, or nil if none found.
type UserCreateRequestMultiError ¶
type UserCreateRequestMultiError []error
UserCreateRequestMultiError is an error wrapping multiple validation errors returned by UserCreateRequest.ValidateAll() if the designated constraints aren't met.
func (UserCreateRequestMultiError) AllErrors ¶
func (m UserCreateRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (UserCreateRequestMultiError) Error ¶
func (m UserCreateRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type UserCreateRequestValidationError ¶
type UserCreateRequestValidationError struct {
// contains filtered or unexported fields
}
UserCreateRequestValidationError is the validation error returned by UserCreateRequest.Validate if the designated constraints aren't met.
func (UserCreateRequestValidationError) Cause ¶
func (e UserCreateRequestValidationError) Cause() error
Cause function returns cause value.
func (UserCreateRequestValidationError) Error ¶
func (e UserCreateRequestValidationError) Error() string
Error satisfies the builtin error interface
func (UserCreateRequestValidationError) ErrorName ¶
func (e UserCreateRequestValidationError) ErrorName() string
ErrorName returns error name.
func (UserCreateRequestValidationError) Field ¶
func (e UserCreateRequestValidationError) Field() string
Field function returns field value.
func (UserCreateRequestValidationError) Key ¶
func (e UserCreateRequestValidationError) Key() bool
Key function returns key value.
func (UserCreateRequestValidationError) Reason ¶
func (e UserCreateRequestValidationError) Reason() string
Reason function returns reason value.
type UserListRequest ¶
type UserListRequest struct { // Pagination size, optional, must be a positive integer. Size uint32 `protobuf:"varint,1,opt,name=size,proto3" json:"size,omitempty"` // Pagination page, optional, must be a non-negative integer. Page uint32 `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty"` // contains filtered or unexported fields }
UserListRequest is the message used for the request to list all users.
func (*UserListRequest) Descriptor
deprecated
func (*UserListRequest) Descriptor() ([]byte, []int)
Deprecated: Use UserListRequest.ProtoReflect.Descriptor instead.
func (*UserListRequest) GetPage ¶
func (x *UserListRequest) GetPage() uint32
func (*UserListRequest) GetSize ¶
func (x *UserListRequest) GetSize() uint32
func (*UserListRequest) ProtoMessage ¶
func (*UserListRequest) ProtoMessage()
func (*UserListRequest) ProtoReflect ¶
func (x *UserListRequest) ProtoReflect() protoreflect.Message
func (*UserListRequest) Reset ¶
func (x *UserListRequest) Reset()
func (*UserListRequest) String ¶
func (x *UserListRequest) String() string
func (*UserListRequest) Validate ¶
func (m *UserListRequest) Validate() error
Validate checks the field values on UserListRequest 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 (*UserListRequest) ValidateAll ¶
func (m *UserListRequest) ValidateAll() error
ValidateAll checks the field values on UserListRequest 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 UserListRequestMultiError, or nil if none found.
type UserListRequestMultiError ¶
type UserListRequestMultiError []error
UserListRequestMultiError is an error wrapping multiple validation errors returned by UserListRequest.ValidateAll() if the designated constraints aren't met.
func (UserListRequestMultiError) AllErrors ¶
func (m UserListRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (UserListRequestMultiError) Error ¶
func (m UserListRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type UserListRequestValidationError ¶
type UserListRequestValidationError struct {
// contains filtered or unexported fields
}
UserListRequestValidationError is the validation error returned by UserListRequest.Validate if the designated constraints aren't met.
func (UserListRequestValidationError) Cause ¶
func (e UserListRequestValidationError) Cause() error
Cause function returns cause value.
func (UserListRequestValidationError) Error ¶
func (e UserListRequestValidationError) Error() string
Error satisfies the builtin error interface
func (UserListRequestValidationError) ErrorName ¶
func (e UserListRequestValidationError) ErrorName() string
ErrorName returns error name.
func (UserListRequestValidationError) Field ¶
func (e UserListRequestValidationError) Field() string
Field function returns field value.
func (UserListRequestValidationError) Key ¶
func (e UserListRequestValidationError) Key() bool
Key function returns key value.
func (UserListRequestValidationError) Reason ¶
func (e UserListRequestValidationError) Reason() string
Reason function returns reason value.
type UserListResponse ¶
type UserListResponse struct { // users is a list of users. Users []*User `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"` // contains filtered or unexported fields }
UserListResponse is the message returned from the request to list all users.
func (*UserListResponse) Descriptor
deprecated
func (*UserListResponse) Descriptor() ([]byte, []int)
Deprecated: Use UserListResponse.ProtoReflect.Descriptor instead.
func (*UserListResponse) GetUsers ¶
func (x *UserListResponse) GetUsers() []*User
func (*UserListResponse) ProtoMessage ¶
func (*UserListResponse) ProtoMessage()
func (*UserListResponse) ProtoReflect ¶
func (x *UserListResponse) ProtoReflect() protoreflect.Message
func (*UserListResponse) Reset ¶
func (x *UserListResponse) Reset()
func (*UserListResponse) String ¶
func (x *UserListResponse) String() string
func (*UserListResponse) Validate ¶
func (m *UserListResponse) Validate() error
Validate checks the field values on UserListResponse 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 (*UserListResponse) ValidateAll ¶
func (m *UserListResponse) ValidateAll() error
ValidateAll checks the field values on UserListResponse 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 UserListResponseMultiError, or nil if none found.
type UserListResponseMultiError ¶
type UserListResponseMultiError []error
UserListResponseMultiError is an error wrapping multiple validation errors returned by UserListResponse.ValidateAll() if the designated constraints aren't met.
func (UserListResponseMultiError) AllErrors ¶
func (m UserListResponseMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (UserListResponseMultiError) Error ¶
func (m UserListResponseMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type UserListResponseValidationError ¶
type UserListResponseValidationError struct {
// contains filtered or unexported fields
}
UserListResponseValidationError is the validation error returned by UserListResponse.Validate if the designated constraints aren't met.
func (UserListResponseValidationError) Cause ¶
func (e UserListResponseValidationError) Cause() error
Cause function returns cause value.
func (UserListResponseValidationError) Error ¶
func (e UserListResponseValidationError) Error() string
Error satisfies the builtin error interface
func (UserListResponseValidationError) ErrorName ¶
func (e UserListResponseValidationError) ErrorName() string
ErrorName returns error name.
func (UserListResponseValidationError) Field ¶
func (e UserListResponseValidationError) Field() string
Field function returns field value.
func (UserListResponseValidationError) Key ¶
func (e UserListResponseValidationError) Key() bool
Key function returns key value.
func (UserListResponseValidationError) Reason ¶
func (e UserListResponseValidationError) Reason() string
Reason function returns reason value.
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 { // Create is a unary RPC to create a new user. // It requires a UserCreateRequest and returns a MessageResponse. Create(ctx context.Context, in *UserCreateRequest, opts ...grpc.CallOption) (*MessageResponse, error) // List is a unary RPC to get a list of all users. // It requires a UserListRequest and returns a UserListResponse. List(ctx context.Context, in *UserListRequest, opts ...grpc.CallOption) (*UserListResponse, 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.
func NewUserServiceClient ¶
func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient
type UserServiceServer ¶
type UserServiceServer interface { // Create is a unary RPC to create a new user. // It requires a UserCreateRequest and returns a MessageResponse. Create(context.Context, *UserCreateRequest) (*MessageResponse, error) // List is a unary RPC to get a list of all users. // It requires a UserListRequest and returns a UserListResponse. List(context.Context, *UserListRequest) (*UserListResponse, 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.