controllers

package
v0.0.0-...-3bc4b72 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2015 License: GPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommentCreate

func CommentCreate(c *gin.Context)

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

func CommentDelete(c *gin.Context)

curl -H "Content-Type: application/json" -X DELETE http://localhost:9999/comments/1 CommentDelete deletes a comment by id

func CommentIndex

func CommentIndex(c *gin.Context)

CommentIndex shows all comments belonging to a post or comment

func CommentShow

func CommentShow(c *gin.Context)

CommentShow shows a comment by Id

func CommentUpdate

func CommentUpdate(c *gin.Context)

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

func CommentVoteCreate(c *gin.Context)

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

func PostCreate(c *gin.Context)

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

func PostDelete(c *gin.Context)

curl -H "Content-Type: application/json" -X DELETE http://localhost:9999/posts/2 PostDelete deletes a post by id

func PostIndex

func PostIndex(c *gin.Context)

PostIndex shows all post in a given sub

func PostShow

func PostShow(c *gin.Context)

PostShow shows a post by id

func PostUpdate

func PostUpdate(c *gin.Context)

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

func PostVoteCreate(c *gin.Context)

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

func SubCreate(c *gin.Context)

curl -H "Content-Type: application/json" -X POST -d '{"name":"random", "description":"something"}' http://localhost:9999/api/s SubCreate creates a new sub

func SubDelete

func SubDelete(c *gin.Context)

SubDelete deletes a sub by id

func SubIndex

func SubIndex(c *gin.Context)

SubIndex shows a list of all subs

func SubShow

func SubShow(c *gin.Context)

SubShow shows a sub by id

func SubUpdate

func SubUpdate(c *gin.Context)

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

func UserAuth(c *gin.Context)

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

func UserCreate(c *gin.Context)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL