Documentation ¶
Index ¶
- func WriteBadRequestResponse(w http.ResponseWriter)
- func WriteInternalServerErrorResponse(w http.ResponseWriter)
- func WriteResponse(w http.ResponseWriter, statusCode int, body interface{})
- type DataResponse
- type FriendHandler
- func (h *FriendHandler) Create(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func (h *FriendHandler) Delete(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func (h *FriendHandler) Index(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func (h *FriendHandler) Update(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- type HealthzHandler
- type MessageDataResponse
- type MessageResponse
- type ResponseMeta
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteBadRequestResponse ¶
func WriteBadRequestResponse(w http.ResponseWriter)
WriteBadRequestResponse writes bad request response to the HTTP connection
func WriteInternalServerErrorResponse ¶
func WriteInternalServerErrorResponse(w http.ResponseWriter)
WriteInternalServerErrorResponse writes internal server error response to the HTTP connection
func WriteResponse ¶
func WriteResponse(w http.ResponseWriter, statusCode int, body interface{})
WriteResponse writes response to the HTTP connection
Types ¶
type DataResponse ¶
type DataResponse struct { Data interface{} `json:"data"` Meta ResponseMeta `json:"meta"` }
DataResponse is a response with data and meta property
type FriendHandler ¶
type FriendHandler struct {
FriendService service.FriendUseCase
}
FriendHandler handle /friends routes
func (*FriendHandler) Create ¶
func (h *FriendHandler) Create(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
Create is a handler function for POST /friends
func (*FriendHandler) Delete ¶
func (h *FriendHandler) Delete(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
Delete is a handler function for DELETE /friends/:id
func (*FriendHandler) Index ¶
func (h *FriendHandler) Index(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
Index is a handler function for GET /friends
func (*FriendHandler) Update ¶
func (h *FriendHandler) Update(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
Update is a handler function for PUT /friends/:id
type HealthzHandler ¶
type HealthzHandler struct{}
HealthzHandler handle /healthz routes
func (*HealthzHandler) Index ¶
func (h *HealthzHandler) Index(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
Index is a handler function for GET /healthz
type MessageDataResponse ¶
type MessageDataResponse struct { Message string `json:"message"` Meta ResponseMeta `json:"meta"` }
MessageDataResponse is a response with message, data and meta property
type MessageResponse ¶
type MessageResponse struct { Message string `json:"message"` Meta ResponseMeta `json:"meta"` }
MessageResponse is a response with message and meta property
type ResponseMeta ¶
type ResponseMeta struct {
HTTPStatus int `json:"http_status"`
}
ResponseMeta is a struct for response meta property