Documentation ¶
Index ¶
- type ErrorDetail
- type ErrorResponse
- type InvalidAttributeError
- type InvalidValidationError
- type StoryHandler
- func (h *StoryHandler) Create(w http.ResponseWriter, r *http.Request)
- func (h *StoryHandler) Delete(w http.ResponseWriter, r *http.Request)
- func (h *StoryHandler) Get(w http.ResponseWriter, r *http.Request)
- func (h *StoryHandler) Get10LatestStories(w http.ResponseWriter, r *http.Request)
- func (h *StoryHandler) GetByAuthorID(w http.ResponseWriter, r *http.Request)
- func (h *StoryHandler) Update(w http.ResponseWriter, r *http.Request)
- type SuccessResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorDetail ¶
ErrorDetail represents individual JSON API error detail
type ErrorResponse ¶
type ErrorResponse struct { Errors []ErrorDetail `json:"errors"` Meta interface{} `json:"meta"` }
ErrorResponse is the standard JSON API failed errors-meta response
type InvalidAttributeError ¶
InvalidAttributeError is used mostly in request payload validation
func (*InvalidAttributeError) Error ¶
func (e *InvalidAttributeError) Error() string
type InvalidValidationError ¶
type InvalidValidationError struct {
Detail string
}
InvalidValidationError is used mostly in request payload validation
func (*InvalidValidationError) Error ¶
func (e *InvalidValidationError) Error() string
type StoryHandler ¶
type StoryHandler struct {
StoryUsecase writing.StoryUsecase
}
StoryHandler is the controller for story scope
func NewStoryHandler ¶
func NewStoryHandler(storyUsecase writing.StoryUsecase) *StoryHandler
NewStoryHandler initializes fresh handler
func (*StoryHandler) Create ¶
func (h *StoryHandler) Create(w http.ResponseWriter, r *http.Request)
Create handles `POST /stories`
func (*StoryHandler) Delete ¶
func (h *StoryHandler) Delete(w http.ResponseWriter, r *http.Request)
Delete handles `DELETE /stories/{id}`
func (*StoryHandler) Get ¶
func (h *StoryHandler) Get(w http.ResponseWriter, r *http.Request)
Show handles `GET /stories/{id}`
func (*StoryHandler) Get10LatestStories ¶
func (h *StoryHandler) Get10LatestStories(w http.ResponseWriter, r *http.Request)
Get10LatestStories handles `GET /stories/ten-latests`
func (*StoryHandler) GetByAuthorID ¶
func (h *StoryHandler) GetByAuthorID(w http.ResponseWriter, r *http.Request)
GetByAuthorID handles `GET /stories/by-authors/{id}`
func (*StoryHandler) Update ¶
func (h *StoryHandler) Update(w http.ResponseWriter, r *http.Request)
Update handles `PATCH /stories/{id}`
type SuccessResponse ¶
type SuccessResponse struct { Data interface{} `json:"data"` Meta interface{} `json:"meta"` }
SuccessResponse is the standard JSON API success data-meta response