Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateUserHandler ¶
type CreateUserHandler interface {
Handle(req CreateUserRequest) *CreateUserResponse
}
* Create users *
func NewCreateUserHandler ¶
func NewCreateUserHandler(idm entity.IDManager, createUserUseCase usecase.CreateUserUseCase) CreateUserHandler
type CreateUserRequest ¶
type CreateUserRequest struct {
User *UserDetail `json:"user"`
}
* Create users *
type CreateUserResponse ¶
type CreateUserResponse struct { Status ResponseStatus User *UserDetail `json:"user,omitempty"` Error *ErrorResult `json:"error,omitempty"` }
* Create users *
type DeleteUserHandler ¶
type DeleteUserHandler interface {
Handle(req DeleteUserRequest) *DeleteUserResponse
}
* Delete user by ID *
func NewDeleteUserHandler ¶
func NewDeleteUserHandler(idm entity.IDManager, deleteUserUseCase usecase.DeleteUserUseCase) DeleteUserHandler
type DeleteUserRequest ¶
type DeleteUserRequest struct {
ID string `json:"id"`
}
* Delete user by ID *
type DeleteUserResponse ¶
type DeleteUserResponse struct { Status ResponseStatus Error *ErrorResult `json:"error,omitempty"` }
* Delete user by ID *
type ErrorResult ¶
type ErrorResult struct { Message string `json:"message"` Details interface{} `json:"details,omitempty"` }
type GetUserHandler ¶
type GetUserHandler interface {
Handle(req GetUserRequest) *GetUserResponse
}
* Get user by ID *
func NewGetUserHandler ¶
func NewGetUserHandler(idm entity.IDManager, getUserUseCase usecase.GetUserUseCase) GetUserHandler
type GetUserResponse ¶
type GetUserResponse struct { Status ResponseStatus User *UserDetail `json:"user,omitempty"` Error *ErrorResult `json:"error,omitempty"` }
* Get user by ID *
type ListUsersHandler ¶
type ListUsersHandler interface {
Handle() *ListUsersResponse
}
* List users *
func NewListUsersHandler ¶
func NewListUsersHandler(listUsersUseCase usecase.ListUsersUseCase) ListUsersHandler
type ListUsersResponse ¶
type ListUsersResponse struct { Status ResponseStatus Users []*UserDetail `json:"users,omitempty"` Error *ErrorResult `json:"error,omitempty"` }
* List users *
type ResponseStatus ¶
type ResponseStatus int
const ( // 2XX ResponseStatusOK ResponseStatus = http.StatusOK ResponseStatusCreated ResponseStatus = http.StatusCreated ResponseStatusAccepted ResponseStatus = http.StatusAccepted ResponseStatusNoContent ResponseStatus = http.StatusNoContent // 4XX ResponseStatusBadRequest ResponseStatus = http.StatusBadRequest ResponseStatusForbidden ResponseStatus = http.StatusForbidden ResponseStatusNotFound ResponseStatus = http.StatusNotFound ResponseStatusConflict ResponseStatus = http.StatusConflict // 5XX ResponseStatusInternalServerError ResponseStatus = http.StatusInternalServerError )
func (ResponseStatus) Int ¶
func (s ResponseStatus) Int() int
func (ResponseStatus) String ¶
func (s ResponseStatus) String() string
type UserDetail ¶
Click to show internal directories.
Click to hide internal directories.