Documentation ¶
Index ¶
- func CommentCreate(c *gin.Context)
- func CommentDelete(c *gin.Context)
- func CommentIndex(c *gin.Context)
- func CommentShow(c *gin.Context)
- func CommentUpdate(c *gin.Context)
- func CommentVoteCreate(c *gin.Context)
- func PostCreate(c *gin.Context)
- func PostDelete(c *gin.Context)
- func PostIndex(c *gin.Context)
- func PostShow(c *gin.Context)
- func PostUpdate(c *gin.Context)
- func PostVoteCreate(c *gin.Context)
- func SubCreate(c *gin.Context)
- func SubDelete(c *gin.Context)
- func SubIndex(c *gin.Context)
- func SubShow(c *gin.Context)
- func SubUpdate(c *gin.Context)
- func UserAuth(c *gin.Context)
- func UserCreate(c *gin.Context)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommentCreate ¶
curl -H "Content-Type: application/json" -X POST -d '{"commentableId":3,"commentableType":"post","body":"the body of a comment"}' http://localhost:9999/comments CommentCreate creates a comment, validates that it belongs to something commentable
func CommentDelete ¶
curl -H "Content-Type: application/json" -X DELETE http://localhost:9999/comments/1 CommentDelete deletes a comment by id
func CommentIndex ¶
CommentIndex shows all comments belonging to a post or comment
func CommentUpdate ¶
curl -H "Content-Type: application/json" -X PATCH -d '{"body":"the body of a sss comment"}' http://localhost:9999/comments/20 CommentUpdate updates a comment by id
func CommentVoteCreate ¶
curl -H "Content-Type: application/json" -X POST -d '{"value":0}' http://localhost:9999/comments/20/vote CommentVoteCreate creates or updates a vote for the user on a given comment
func PostCreate ¶
curl -H "Content-Type: application/json" -X POST -d '{"userId":1,"title":"i dont get it","body":"no really i dont"}' http://localhost:9999/s/1/posts PostCreate creates a new post
func PostDelete ¶
curl -H "Content-Type: application/json" -X DELETE http://localhost:9999/posts/2 PostDelete deletes a post by id
func PostUpdate ¶
curl -H "Content-Type: application/json" -X PATCH -d '{"body":"lets all ignore how dirty our country is"}' http://localhost:9999/posts/3 PostUpdate updates a post by id
func PostVoteCreate ¶
curl -H "Content-Type: application/json" -X POST -d '{"value":0}' http://localhost:9999/posts/3/vote PostVoteCreate creates or updates a vote for the user on a given post
func SubCreate ¶
curl -H "Content-Type: application/json" -X POST -d '{"name":"random", "description":"something"}' http://localhost:9999/api/s SubCreate creates a new sub
func SubUpdate ¶
curl -H "Content-Type: application/json" -X PATCH -d '{"name":"random", "description":"something"}' http://localhost:9999/s/:id SubUpdate updates a sub by id
func UserAuth ¶
curl -H "Content-Type: application/json" http://localhost:9999/api/users/auth UserAuth checks a user against the database and gives them a jwt if successful
func UserCreate ¶
Types ¶
This section is empty.