Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler interface { List(ctx *gin.Context) Find(ctx *gin.Context) Create(ctx *gin.Context) Update(ctx *gin.Context) Delete(ctx *gin.Context) }
Handler defines methods for posts to interact with the server.
type Posts ¶
Posts defines the handler for all posts routes.
func (*Posts) Create ¶
Create
Returns http.StatusOK if the post was created. Returns http.StatusInternalServerError if there was an error creating or formatting the post. Returns http.StatusBadRequest if the the validation failed or there was a conflict with the post.
func (*Posts) Delete ¶
Delete
Returns http.StatusOK if the post was deleted. Returns http.StatusInternalServerError if there was an error deleting the post. Returns http.StatusBadRequest if the the post wasn't found or no ID was passed.
func (*Posts) Find ¶
Find
Returns http.StatusOK if the posts were obtained. Returns http.StatusBadRequest if the ID wasn't passed or failed to convert. Returns http.StatusInternalServerError if there as an error obtaining or formatting the post.
func (*Posts) List ¶
List
Get all posts, obtain resource param to pass to the get function.
Returns http.StatusOK if there are no posts or success. Returns http.StatusBadRequest if there was conflict or the request was invalid. Returns http.StatusInternalServerError if there was an error getting or formatting the posts.