Documentation
¶
Overview ¶
Package v1 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 Address
- func (*Address) Descriptor() ([]byte, []int)deprecated
- func (x *Address) GetCity() string
- func (x *Address) GetCountry() string
- func (x *Address) GetState() string
- func (x *Address) GetStreet() string
- func (x *Address) GetZip() string
- func (*Address) ProtoMessage()
- func (x *Address) ProtoReflect() protoreflect.Message
- func (x *Address) Reset()
- func (x *Address) String() string
- func (m *Address) Validate() error
- func (m *Address) ValidateAll() error
- type AddressMultiError
- type AddressValidationError
- type CreateUserRequest
- func (*CreateUserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateUserRequest) GetEmail() string
- func (x *CreateUserRequest) GetFirstName() string
- func (x *CreateUserRequest) GetLastName() string
- func (x *CreateUserRequest) GetPassword() string
- func (x *CreateUserRequest) GetRole() string
- func (*CreateUserRequest) ProtoMessage()
- func (x *CreateUserRequest) ProtoReflect() protoreflect.Message
- func (x *CreateUserRequest) Reset()
- func (x *CreateUserRequest) String() string
- func (m *CreateUserRequest) Validate() error
- func (m *CreateUserRequest) ValidateAll() error
- type CreateUserRequestMultiError
- type CreateUserRequestValidationError
- func (e CreateUserRequestValidationError) Cause() error
- func (e CreateUserRequestValidationError) Error() string
- func (e CreateUserRequestValidationError) ErrorName() string
- func (e CreateUserRequestValidationError) Field() string
- func (e CreateUserRequestValidationError) Key() bool
- func (e CreateUserRequestValidationError) Reason() string
- type CreateUserResponse
- func (*CreateUserResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CreateUserResponse) GetUser() *User
- func (*CreateUserResponse) ProtoMessage()
- func (x *CreateUserResponse) ProtoReflect() protoreflect.Message
- func (x *CreateUserResponse) Reset()
- func (x *CreateUserResponse) String() string
- func (m *CreateUserResponse) Validate() error
- func (m *CreateUserResponse) ValidateAll() error
- type CreateUserResponseMultiError
- type CreateUserResponseValidationError
- func (e CreateUserResponseValidationError) Cause() error
- func (e CreateUserResponseValidationError) Error() string
- func (e CreateUserResponseValidationError) ErrorName() string
- func (e CreateUserResponseValidationError) Field() string
- func (e CreateUserResponseValidationError) Key() bool
- func (e CreateUserResponseValidationError) Reason() string
- type GetUserRequest
- func (*GetUserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetUserRequest) GetId() string
- func (*GetUserRequest) ProtoMessage()
- func (x *GetUserRequest) ProtoReflect() protoreflect.Message
- func (x *GetUserRequest) Reset()
- func (x *GetUserRequest) String() string
- func (m *GetUserRequest) Validate() error
- func (m *GetUserRequest) ValidateAll() error
- type GetUserRequestMultiError
- type GetUserRequestValidationError
- func (e GetUserRequestValidationError) Cause() error
- func (e GetUserRequestValidationError) Error() string
- func (e GetUserRequestValidationError) ErrorName() string
- func (e GetUserRequestValidationError) Field() string
- func (e GetUserRequestValidationError) Key() bool
- func (e GetUserRequestValidationError) Reason() string
- type GetUserResponse
- func (*GetUserResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetUserResponse) GetUser() *User
- func (*GetUserResponse) ProtoMessage()
- func (x *GetUserResponse) ProtoReflect() protoreflect.Message
- func (x *GetUserResponse) Reset()
- func (x *GetUserResponse) String() string
- func (m *GetUserResponse) Validate() error
- func (m *GetUserResponse) ValidateAll() error
- type GetUserResponseMultiError
- type GetUserResponseValidationError
- func (e GetUserResponseValidationError) Cause() error
- func (e GetUserResponseValidationError) Error() string
- func (e GetUserResponseValidationError) ErrorName() string
- func (e GetUserResponseValidationError) Field() string
- func (e GetUserResponseValidationError) Key() bool
- func (e GetUserResponseValidationError) Reason() string
- type SignupRequest
- func (*SignupRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SignupRequest) GetEmail() string
- func (x *SignupRequest) GetFirstName() string
- func (x *SignupRequest) GetLastName() string
- func (x *SignupRequest) GetPassword() string
- func (*SignupRequest) ProtoMessage()
- func (x *SignupRequest) ProtoReflect() protoreflect.Message
- func (x *SignupRequest) Reset()
- func (x *SignupRequest) String() string
- func (m *SignupRequest) Validate() error
- func (m *SignupRequest) ValidateAll() error
- type SignupRequestMultiError
- type SignupRequestValidationError
- func (e SignupRequestValidationError) Cause() error
- func (e SignupRequestValidationError) Error() string
- func (e SignupRequestValidationError) ErrorName() string
- func (e SignupRequestValidationError) Field() string
- func (e SignupRequestValidationError) Key() bool
- func (e SignupRequestValidationError) Reason() string
- type SignupResponse
- func (*SignupResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SignupResponse) GetUser() *User
- func (*SignupResponse) ProtoMessage()
- func (x *SignupResponse) ProtoReflect() protoreflect.Message
- func (x *SignupResponse) Reset()
- func (x *SignupResponse) String() string
- func (m *SignupResponse) Validate() error
- func (m *SignupResponse) ValidateAll() error
- type SignupResponseMultiError
- type SignupResponseValidationError
- func (e SignupResponseValidationError) Cause() error
- func (e SignupResponseValidationError) Error() string
- func (e SignupResponseValidationError) ErrorName() string
- func (e SignupResponseValidationError) Field() string
- func (e SignupResponseValidationError) Key() bool
- func (e SignupResponseValidationError) Reason() string
- type UnimplementedUserServiceServer
- func (UnimplementedUserServiceServer) CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error)
- func (UnimplementedUserServiceServer) GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error)
- func (UnimplementedUserServiceServer) Signup(context.Context, *SignupRequest) (*SignupResponse, error)
- type UnsafeUserServiceServer
- type User
- func (*User) Descriptor() ([]byte, []int)deprecated
- func (x *User) GetAddress() *Address
- func (x *User) GetCreatedAt() string
- func (x *User) GetEmail() string
- func (x *User) GetFirstName() string
- func (x *User) GetId() string
- func (x *User) GetLastName() string
- func (x *User) GetRole() string
- func (x *User) GetUpdatedAt() 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 UserMultiError
- type UserServiceClient
- type UserServiceServer
- type UserValidationError
Constants ¶
const ( UserService_GetUser_FullMethodName = "/user.v1.UserService/GetUser" UserService_CreateUser_FullMethodName = "/user.v1.UserService/CreateUser" UserService_Signup_FullMethodName = "/user.v1.UserService/Signup" )
Variables ¶
var File_user_v1_user_proto protoreflect.FileDescriptor
var UserService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "user.v1.UserService", HandlerType: (*UserServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetUser", Handler: _UserService_GetUser_Handler, }, { MethodName: "CreateUser", Handler: _UserService_CreateUser_Handler, }, { MethodName: "Signup", Handler: _UserService_Signup_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "user/v1/user.proto", }
UserService_ServiceDesc is the grpc.ServiceDesc for UserService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterUserServiceHandler ¶ added in v1.2.0
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 ¶ added in v1.2.0
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 ¶ added in v1.2.0
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 ¶ added in v1.2.0
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 Address ¶
type Address struct {
Street string `protobuf:"bytes,1,opt,name=street,proto3" json:"street,omitempty"`
City string `protobuf:"bytes,2,opt,name=city,proto3" json:"city,omitempty"`
State string `protobuf:"bytes,3,opt,name=state,proto3" json:"state,omitempty"`
Zip string `protobuf:"bytes,4,opt,name=zip,proto3" json:"zip,omitempty"`
Country string `protobuf:"bytes,5,opt,name=country,proto3" json:"country,omitempty"` // e.g. US, IT
// contains filtered or unexported fields
}
The Address message represents a physical location.
func (*Address) Descriptor
deprecated
func (*Address) GetCountry ¶
func (*Address) ProtoMessage ¶
func (*Address) ProtoMessage()
func (*Address) ProtoReflect ¶
func (x *Address) ProtoReflect() protoreflect.Message
func (*Address) Validate ¶ added in v1.1.1
Validate checks the field values on Address 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 (*Address) ValidateAll ¶ added in v1.1.1
ValidateAll checks the field values on Address 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 AddressMultiError, or nil if none found.
type AddressMultiError ¶ added in v1.1.1
type AddressMultiError []error
AddressMultiError is an error wrapping multiple validation errors returned by Address.ValidateAll() if the designated constraints aren't met.
func (AddressMultiError) AllErrors ¶ added in v1.1.1
func (m AddressMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (AddressMultiError) Error ¶ added in v1.1.1
func (m AddressMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type AddressValidationError ¶ added in v1.1.1
type AddressValidationError struct {
// contains filtered or unexported fields
}
AddressValidationError is the validation error returned by Address.Validate if the designated constraints aren't met.
func (AddressValidationError) Cause ¶ added in v1.1.1
func (e AddressValidationError) Cause() error
Cause function returns cause value.
func (AddressValidationError) Error ¶ added in v1.1.1
func (e AddressValidationError) Error() string
Error satisfies the builtin error interface
func (AddressValidationError) ErrorName ¶ added in v1.1.1
func (e AddressValidationError) ErrorName() string
ErrorName returns error name.
func (AddressValidationError) Field ¶ added in v1.1.1
func (e AddressValidationError) Field() string
Field function returns field value.
func (AddressValidationError) Key ¶ added in v1.1.1
func (e AddressValidationError) Key() bool
Key function returns key value.
func (AddressValidationError) Reason ¶ added in v1.1.1
func (e AddressValidationError) Reason() string
Reason function returns reason value.
type CreateUserRequest ¶
type CreateUserRequest struct {
Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"`
Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
FirstName string `protobuf:"bytes,3,opt,name=first_name,json=firstName,proto3" json:"first_name,omitempty"`
LastName string `protobuf:"bytes,4,opt,name=last_name,json=lastName,proto3" json:"last_name,omitempty"`
Role string `protobuf:"bytes,5,opt,name=role,proto3" json:"role,omitempty"`
// contains filtered or unexported fields
}
Request to create a new user.
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 ¶ added in v1.2.1
func (x *CreateUserRequest) GetPassword() string
func (*CreateUserRequest) GetRole ¶
func (x *CreateUserRequest) GetRole() 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
func (*CreateUserRequest) Validate ¶ added in v1.1.1
func (m *CreateUserRequest) Validate() error
Validate checks the field values on CreateUserRequest 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 (*CreateUserRequest) ValidateAll ¶ added in v1.1.1
func (m *CreateUserRequest) ValidateAll() error
ValidateAll checks the field values on CreateUserRequest 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 CreateUserRequestMultiError, or nil if none found.
type CreateUserRequestMultiError ¶ added in v1.1.1
type CreateUserRequestMultiError []error
CreateUserRequestMultiError is an error wrapping multiple validation errors returned by CreateUserRequest.ValidateAll() if the designated constraints aren't met.
func (CreateUserRequestMultiError) AllErrors ¶ added in v1.1.1
func (m CreateUserRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (CreateUserRequestMultiError) Error ¶ added in v1.1.1
func (m CreateUserRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type CreateUserRequestValidationError ¶ added in v1.1.1
type CreateUserRequestValidationError struct {
// contains filtered or unexported fields
}
CreateUserRequestValidationError is the validation error returned by CreateUserRequest.Validate if the designated constraints aren't met.
func (CreateUserRequestValidationError) Cause ¶ added in v1.1.1
func (e CreateUserRequestValidationError) Cause() error
Cause function returns cause value.
func (CreateUserRequestValidationError) Error ¶ added in v1.1.1
func (e CreateUserRequestValidationError) Error() string
Error satisfies the builtin error interface
func (CreateUserRequestValidationError) ErrorName ¶ added in v1.1.1
func (e CreateUserRequestValidationError) ErrorName() string
ErrorName returns error name.
func (CreateUserRequestValidationError) Field ¶ added in v1.1.1
func (e CreateUserRequestValidationError) Field() string
Field function returns field value.
func (CreateUserRequestValidationError) Key ¶ added in v1.1.1
func (e CreateUserRequestValidationError) Key() bool
Key function returns key value.
func (CreateUserRequestValidationError) Reason ¶ added in v1.1.1
func (e CreateUserRequestValidationError) Reason() string
Reason function returns reason value.
type CreateUserResponse ¶
type CreateUserResponse struct {
User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
// contains filtered or unexported fields
}
Response for creating a user.
func (*CreateUserResponse) Descriptor
deprecated
func (*CreateUserResponse) Descriptor() ([]byte, []int)
Deprecated: Use CreateUserResponse.ProtoReflect.Descriptor instead.
func (*CreateUserResponse) GetUser ¶
func (x *CreateUserResponse) GetUser() *User
func (*CreateUserResponse) ProtoMessage ¶
func (*CreateUserResponse) ProtoMessage()
func (*CreateUserResponse) ProtoReflect ¶
func (x *CreateUserResponse) ProtoReflect() protoreflect.Message
func (*CreateUserResponse) Reset ¶
func (x *CreateUserResponse) Reset()
func (*CreateUserResponse) String ¶
func (x *CreateUserResponse) String() string
func (*CreateUserResponse) Validate ¶ added in v1.1.1
func (m *CreateUserResponse) Validate() error
Validate checks the field values on CreateUserResponse 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 (*CreateUserResponse) ValidateAll ¶ added in v1.1.1
func (m *CreateUserResponse) ValidateAll() error
ValidateAll checks the field values on CreateUserResponse 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 CreateUserResponseMultiError, or nil if none found.
type CreateUserResponseMultiError ¶ added in v1.1.1
type CreateUserResponseMultiError []error
CreateUserResponseMultiError is an error wrapping multiple validation errors returned by CreateUserResponse.ValidateAll() if the designated constraints aren't met.
func (CreateUserResponseMultiError) AllErrors ¶ added in v1.1.1
func (m CreateUserResponseMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (CreateUserResponseMultiError) Error ¶ added in v1.1.1
func (m CreateUserResponseMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type CreateUserResponseValidationError ¶ added in v1.1.1
type CreateUserResponseValidationError struct {
// contains filtered or unexported fields
}
CreateUserResponseValidationError is the validation error returned by CreateUserResponse.Validate if the designated constraints aren't met.
func (CreateUserResponseValidationError) Cause ¶ added in v1.1.1
func (e CreateUserResponseValidationError) Cause() error
Cause function returns cause value.
func (CreateUserResponseValidationError) Error ¶ added in v1.1.1
func (e CreateUserResponseValidationError) Error() string
Error satisfies the builtin error interface
func (CreateUserResponseValidationError) ErrorName ¶ added in v1.1.1
func (e CreateUserResponseValidationError) ErrorName() string
ErrorName returns error name.
func (CreateUserResponseValidationError) Field ¶ added in v1.1.1
func (e CreateUserResponseValidationError) Field() string
Field function returns field value.
func (CreateUserResponseValidationError) Key ¶ added in v1.1.1
func (e CreateUserResponseValidationError) Key() bool
Key function returns key value.
func (CreateUserResponseValidationError) Reason ¶ added in v1.1.1
func (e CreateUserResponseValidationError) Reason() string
Reason function returns reason value.
type GetUserRequest ¶
type GetUserRequest struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
// contains filtered or unexported fields
}
Request to get a user by ID.
func (*GetUserRequest) Descriptor
deprecated
func (*GetUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetUserRequest.ProtoReflect.Descriptor instead.
func (*GetUserRequest) GetId ¶
func (x *GetUserRequest) GetId() 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
func (*GetUserRequest) Validate ¶ added in v1.1.1
func (m *GetUserRequest) Validate() error
Validate checks the field values on GetUserRequest 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 (*GetUserRequest) ValidateAll ¶ added in v1.1.1
func (m *GetUserRequest) ValidateAll() error
ValidateAll checks the field values on GetUserRequest 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 GetUserRequestMultiError, or nil if none found.
type GetUserRequestMultiError ¶ added in v1.1.1
type GetUserRequestMultiError []error
GetUserRequestMultiError is an error wrapping multiple validation errors returned by GetUserRequest.ValidateAll() if the designated constraints aren't met.
func (GetUserRequestMultiError) AllErrors ¶ added in v1.1.1
func (m GetUserRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (GetUserRequestMultiError) Error ¶ added in v1.1.1
func (m GetUserRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type GetUserRequestValidationError ¶ added in v1.1.1
type GetUserRequestValidationError struct {
// contains filtered or unexported fields
}
GetUserRequestValidationError is the validation error returned by GetUserRequest.Validate if the designated constraints aren't met.
func (GetUserRequestValidationError) Cause ¶ added in v1.1.1
func (e GetUserRequestValidationError) Cause() error
Cause function returns cause value.
func (GetUserRequestValidationError) Error ¶ added in v1.1.1
func (e GetUserRequestValidationError) Error() string
Error satisfies the builtin error interface
func (GetUserRequestValidationError) ErrorName ¶ added in v1.1.1
func (e GetUserRequestValidationError) ErrorName() string
ErrorName returns error name.
func (GetUserRequestValidationError) Field ¶ added in v1.1.1
func (e GetUserRequestValidationError) Field() string
Field function returns field value.
func (GetUserRequestValidationError) Key ¶ added in v1.1.1
func (e GetUserRequestValidationError) Key() bool
Key function returns key value.
func (GetUserRequestValidationError) Reason ¶ added in v1.1.1
func (e GetUserRequestValidationError) Reason() string
Reason function returns reason value.
type GetUserResponse ¶
type GetUserResponse struct {
User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
// contains filtered or unexported fields
}
Response for getting a user.
func (*GetUserResponse) Descriptor
deprecated
func (*GetUserResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetUserResponse.ProtoReflect.Descriptor instead.
func (*GetUserResponse) GetUser ¶
func (x *GetUserResponse) GetUser() *User
func (*GetUserResponse) ProtoMessage ¶
func (*GetUserResponse) ProtoMessage()
func (*GetUserResponse) ProtoReflect ¶
func (x *GetUserResponse) ProtoReflect() protoreflect.Message
func (*GetUserResponse) Reset ¶
func (x *GetUserResponse) Reset()
func (*GetUserResponse) String ¶
func (x *GetUserResponse) String() string
func (*GetUserResponse) Validate ¶ added in v1.1.1
func (m *GetUserResponse) Validate() error
Validate checks the field values on GetUserResponse 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 (*GetUserResponse) ValidateAll ¶ added in v1.1.1
func (m *GetUserResponse) ValidateAll() error
ValidateAll checks the field values on GetUserResponse 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 GetUserResponseMultiError, or nil if none found.
type GetUserResponseMultiError ¶ added in v1.1.1
type GetUserResponseMultiError []error
GetUserResponseMultiError is an error wrapping multiple validation errors returned by GetUserResponse.ValidateAll() if the designated constraints aren't met.
func (GetUserResponseMultiError) AllErrors ¶ added in v1.1.1
func (m GetUserResponseMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (GetUserResponseMultiError) Error ¶ added in v1.1.1
func (m GetUserResponseMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type GetUserResponseValidationError ¶ added in v1.1.1
type GetUserResponseValidationError struct {
// contains filtered or unexported fields
}
GetUserResponseValidationError is the validation error returned by GetUserResponse.Validate if the designated constraints aren't met.
func (GetUserResponseValidationError) Cause ¶ added in v1.1.1
func (e GetUserResponseValidationError) Cause() error
Cause function returns cause value.
func (GetUserResponseValidationError) Error ¶ added in v1.1.1
func (e GetUserResponseValidationError) Error() string
Error satisfies the builtin error interface
func (GetUserResponseValidationError) ErrorName ¶ added in v1.1.1
func (e GetUserResponseValidationError) ErrorName() string
ErrorName returns error name.
func (GetUserResponseValidationError) Field ¶ added in v1.1.1
func (e GetUserResponseValidationError) Field() string
Field function returns field value.
func (GetUserResponseValidationError) Key ¶ added in v1.1.1
func (e GetUserResponseValidationError) Key() bool
Key function returns key value.
func (GetUserResponseValidationError) Reason ¶ added in v1.1.1
func (e GetUserResponseValidationError) Reason() string
Reason function returns reason value.
type SignupRequest ¶ added in v1.1.1
type SignupRequest struct {
Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"`
Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
FirstName string `protobuf:"bytes,3,opt,name=first_name,json=firstName,proto3" json:"first_name,omitempty"`
LastName string `protobuf:"bytes,4,opt,name=last_name,json=lastName,proto3" json:"last_name,omitempty"`
// contains filtered or unexported fields
}
Request for customer signup
func (*SignupRequest) Descriptor
deprecated
added in
v1.1.1
func (*SignupRequest) Descriptor() ([]byte, []int)
Deprecated: Use SignupRequest.ProtoReflect.Descriptor instead.
func (*SignupRequest) GetEmail ¶ added in v1.1.1
func (x *SignupRequest) GetEmail() string
func (*SignupRequest) GetFirstName ¶ added in v1.1.1
func (x *SignupRequest) GetFirstName() string
func (*SignupRequest) GetLastName ¶ added in v1.1.1
func (x *SignupRequest) GetLastName() string
func (*SignupRequest) GetPassword ¶ added in v1.1.1
func (x *SignupRequest) GetPassword() string
func (*SignupRequest) ProtoMessage ¶ added in v1.1.1
func (*SignupRequest) ProtoMessage()
func (*SignupRequest) ProtoReflect ¶ added in v1.1.1
func (x *SignupRequest) ProtoReflect() protoreflect.Message
func (*SignupRequest) Reset ¶ added in v1.1.1
func (x *SignupRequest) Reset()
func (*SignupRequest) String ¶ added in v1.1.1
func (x *SignupRequest) String() string
func (*SignupRequest) Validate ¶ added in v1.1.1
func (m *SignupRequest) Validate() error
Validate checks the field values on SignupRequest 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 (*SignupRequest) ValidateAll ¶ added in v1.1.1
func (m *SignupRequest) ValidateAll() error
ValidateAll checks the field values on SignupRequest 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 SignupRequestMultiError, or nil if none found.
type SignupRequestMultiError ¶ added in v1.1.1
type SignupRequestMultiError []error
SignupRequestMultiError is an error wrapping multiple validation errors returned by SignupRequest.ValidateAll() if the designated constraints aren't met.
func (SignupRequestMultiError) AllErrors ¶ added in v1.1.1
func (m SignupRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (SignupRequestMultiError) Error ¶ added in v1.1.1
func (m SignupRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type SignupRequestValidationError ¶ added in v1.1.1
type SignupRequestValidationError struct {
// contains filtered or unexported fields
}
SignupRequestValidationError is the validation error returned by SignupRequest.Validate if the designated constraints aren't met.
func (SignupRequestValidationError) Cause ¶ added in v1.1.1
func (e SignupRequestValidationError) Cause() error
Cause function returns cause value.
func (SignupRequestValidationError) Error ¶ added in v1.1.1
func (e SignupRequestValidationError) Error() string
Error satisfies the builtin error interface
func (SignupRequestValidationError) ErrorName ¶ added in v1.1.1
func (e SignupRequestValidationError) ErrorName() string
ErrorName returns error name.
func (SignupRequestValidationError) Field ¶ added in v1.1.1
func (e SignupRequestValidationError) Field() string
Field function returns field value.
func (SignupRequestValidationError) Key ¶ added in v1.1.1
func (e SignupRequestValidationError) Key() bool
Key function returns key value.
func (SignupRequestValidationError) Reason ¶ added in v1.1.1
func (e SignupRequestValidationError) Reason() string
Reason function returns reason value.
type SignupResponse ¶ added in v1.1.1
type SignupResponse struct {
User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
// contains filtered or unexported fields
}
Response for customer signup
func (*SignupResponse) Descriptor
deprecated
added in
v1.1.1
func (*SignupResponse) Descriptor() ([]byte, []int)
Deprecated: Use SignupResponse.ProtoReflect.Descriptor instead.
func (*SignupResponse) GetUser ¶ added in v1.2.0
func (x *SignupResponse) GetUser() *User
func (*SignupResponse) ProtoMessage ¶ added in v1.1.1
func (*SignupResponse) ProtoMessage()
func (*SignupResponse) ProtoReflect ¶ added in v1.1.1
func (x *SignupResponse) ProtoReflect() protoreflect.Message
func (*SignupResponse) Reset ¶ added in v1.1.1
func (x *SignupResponse) Reset()
func (*SignupResponse) String ¶ added in v1.1.1
func (x *SignupResponse) String() string
func (*SignupResponse) Validate ¶ added in v1.1.1
func (m *SignupResponse) Validate() error
Validate checks the field values on SignupResponse 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 (*SignupResponse) ValidateAll ¶ added in v1.1.1
func (m *SignupResponse) ValidateAll() error
ValidateAll checks the field values on SignupResponse 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 SignupResponseMultiError, or nil if none found.
type SignupResponseMultiError ¶ added in v1.1.1
type SignupResponseMultiError []error
SignupResponseMultiError is an error wrapping multiple validation errors returned by SignupResponse.ValidateAll() if the designated constraints aren't met.
func (SignupResponseMultiError) AllErrors ¶ added in v1.1.1
func (m SignupResponseMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (SignupResponseMultiError) Error ¶ added in v1.1.1
func (m SignupResponseMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type SignupResponseValidationError ¶ added in v1.1.1
type SignupResponseValidationError struct {
// contains filtered or unexported fields
}
SignupResponseValidationError is the validation error returned by SignupResponse.Validate if the designated constraints aren't met.
func (SignupResponseValidationError) Cause ¶ added in v1.1.1
func (e SignupResponseValidationError) Cause() error
Cause function returns cause value.
func (SignupResponseValidationError) Error ¶ added in v1.1.1
func (e SignupResponseValidationError) Error() string
Error satisfies the builtin error interface
func (SignupResponseValidationError) ErrorName ¶ added in v1.1.1
func (e SignupResponseValidationError) ErrorName() string
ErrorName returns error name.
func (SignupResponseValidationError) Field ¶ added in v1.1.1
func (e SignupResponseValidationError) Field() string
Field function returns field value.
func (SignupResponseValidationError) Key ¶ added in v1.1.1
func (e SignupResponseValidationError) Key() bool
Key function returns key value.
func (SignupResponseValidationError) Reason ¶ added in v1.1.1
func (e SignupResponseValidationError) Reason() string
Reason function returns reason value.
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) CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error)
func (UnimplementedUserServiceServer) GetUser ¶
func (UnimplementedUserServiceServer) GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error)
func (UnimplementedUserServiceServer) Signup ¶ added in v1.1.1
func (UnimplementedUserServiceServer) Signup(context.Context, *SignupRequest) (*SignupResponse, 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 string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"`
FirstName string `protobuf:"bytes,3,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"`
Role string `protobuf:"bytes,4,opt,name=role,proto3" json:"role,omitempty"`
CreatedAt string `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
UpdatedAt string `protobuf:"bytes,6,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
Address *Address `protobuf:"bytes,7,opt,name=address,proto3" json:"address,omitempty"`
// contains filtered or unexported fields
}
The User message represents an e-commerce customer.
func (*User) Descriptor
deprecated
func (*User) GetAddress ¶ added in v1.1.1
func (*User) GetCreatedAt ¶
func (*User) GetFirstName ¶
func (*User) GetLastName ¶
func (*User) GetUpdatedAt ¶
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message
func (*User) Validate ¶ added in v1.1.1
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 ¶ added in v1.1.1
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 ¶ added in v1.1.1
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 ¶ added in v1.1.1
func (m UserMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (UserMultiError) Error ¶ added in v1.1.1
func (m UserMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type UserServiceClient ¶
type UserServiceClient interface {
GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*GetUserResponse, error)
CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserResponse, error)
Signup(ctx context.Context, in *SignupRequest, opts ...grpc.CallOption) (*SignupResponse, 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.
UserService provides user management operations.
func NewUserServiceClient ¶
func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient
type UserServiceServer ¶
type UserServiceServer interface {
GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error)
CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error)
Signup(context.Context, *SignupRequest) (*SignupResponse, error)
// contains filtered or unexported methods
}
UserServiceServer is the server API for UserService service. All implementations must embed UnimplementedUserServiceServer for forward compatibility.
UserService provides user management operations.
type UserValidationError ¶ added in v1.1.1
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 ¶ added in v1.1.1
func (e UserValidationError) Cause() error
Cause function returns cause value.
func (UserValidationError) Error ¶ added in v1.1.1
func (e UserValidationError) Error() string
Error satisfies the builtin error interface
func (UserValidationError) ErrorName ¶ added in v1.1.1
func (e UserValidationError) ErrorName() string
ErrorName returns error name.
func (UserValidationError) Field ¶ added in v1.1.1
func (e UserValidationError) Field() string
Field function returns field value.
func (UserValidationError) Key ¶ added in v1.1.1
func (e UserValidationError) Key() bool
Key function returns key value.
func (UserValidationError) Reason ¶ added in v1.1.1
func (e UserValidationError) Reason() string
Reason function returns reason value.