Documentation
¶
Index ¶
- func CreateUserHandler() *httptransport.Server
- func DeleteUserHandler() *httptransport.Server
- func GetUserHandler() *httptransport.Server
- func UpdateUserHandler() *httptransport.Server
- type CreateUserRequest
- type CreateUserResponse
- type DeleteUserRequest
- type DeleteUserResponse
- type GetUserReqeust
- type GetUserResponse
- type Service
- type UpdateUserRequest
- type UpdateUserResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateUserHandler ¶
func CreateUserHandler() *httptransport.Server
CreateUserHandler will give you the UpdateUser service server
func DeleteUserHandler ¶
func DeleteUserHandler() *httptransport.Server
DeleteUserHandler will give you the DeleteUser service server
func GetUserHandler ¶
func GetUserHandler() *httptransport.Server
GetUserHandler will give you the GetUser service server
func UpdateUserHandler ¶
func UpdateUserHandler() *httptransport.Server
UpdateUserHandler will give you the UpdateUser service server
Types ¶
type CreateUserRequest ¶
type CreateUserRequest struct {
Username string `json:"username"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Age int `json:"age"`
}
CreateUserRequest is the CreateUser request structure
type CreateUserResponse ¶
type CreateUserResponse struct {
ID int `json:"id"`
CreateUserRequest
}
CreateUserResponse is the CreateUser response structure
type DeleteUserRequest ¶
type DeleteUserRequest struct {
ID string `json:"id"`
}
DeleteUserRequest is the DeleteUser service request structure
type DeleteUserResponse ¶
type DeleteUserResponse struct {
ID string `json:"id"`
Deleted bool `json:"deleted"`
Err string `json:"error"`
}
DeleteUserResponse is the DeleteUser service response
type GetUserReqeust ¶
type GetUserReqeust struct {
ID string `json:"id"`
}
GetUserReqeust is the GetUser request structure
type GetUserResponse ¶
type GetUserResponse struct {
ID string `json:"id"`
Username string `json:"username"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Age int `json:"age"`
}
GetUserResponse is the GetUser reponse structure
func NewGetUserResponse ¶
func NewGetUserResponse(id, username, firstName, lastName string, age int) GetUserResponse
NewGetUserResponse is the GetUserResponse factory function
type Service ¶
type Service interface {
GetUser(GetUserReqeust) (GetUserResponse, error)
UpdateUser(UpdateUserRequest) (UpdateUserResponse, error)
DeleteUser(DeleteUserRequest) (DeleteUserResponse, error)
CreateUser(CreateUserRequest) (CreateUserResponse, error)
}
Service is the users microservice interface
type UpdateUserRequest ¶
type UpdateUserRequest struct {
ID string `json:"id"`
Username string `json:"username"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Age int `json:"age"`
}
UpdateUserRequest is the UpdateUser request structure
type UpdateUserResponse ¶
type UpdateUserResponse struct {
UpdateUserRequest
}
UpdateUserResponse is the UpdateUser reponse strucutre