Documentation ¶
Index ¶
- Variables
- func Delete(w http.ResponseWriter, r *http.Request)
- func Login(w http.ResponseWriter, r *http.Request)
- func Logout(w http.ResponseWriter, r *http.Request)
- func Me(w http.ResponseWriter, r *http.Request)
- func NoiseCreate(w http.ResponseWriter, r *http.Request)
- func NoiseDelete(w http.ResponseWriter, r *http.Request)
- func NoiseFileShow(w http.ResponseWriter, r *http.Request)
- func NoiseIndex(w http.ResponseWriter, r *http.Request)
- func NoiseShow(w http.ResponseWriter, r *http.Request)
- func NoiseUpdate(w http.ResponseWriter, r *http.Request)
- func SignUp(w http.ResponseWriter, r *http.Request)
- func UserAuthMiddleware(next http.Handler) http.Handler
- func Welcome(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
var ( // CurrentUser keeps the current user to use on the whole package CurrentUser models.User )
Functions ¶
func Login ¶
func Login(w http.ResponseWriter, r *http.Request)
Login creates session and returns a token. Form must contains "username" and "password".
func Logout ¶
func Logout(w http.ResponseWriter, r *http.Request)
Logout removes the sessions of the current user.
func NoiseCreate ¶
func NoiseCreate(w http.ResponseWriter, r *http.Request)
NoiseCreate create a noise for the current user. Form must contains "title" and "file". Form may contains "tags". Example: "Tag 1, Tag 2"
func NoiseDelete ¶
func NoiseDelete(w http.ResponseWriter, r *http.Request)
NoiseDelete temporarily deletes the given noise and it's file
func NoiseFileShow ¶
func NoiseFileShow(w http.ResponseWriter, r *http.Request)
NoiseFileShow returns the noise's file. There must be an {id} parameter.
func NoiseIndex ¶
func NoiseIndex(w http.ResponseWriter, r *http.Request)
NoiseIndex returns all noise for the current user.
func NoiseShow ¶
func NoiseShow(w http.ResponseWriter, r *http.Request)
NoiseShow returns the noise. There must be an {id} parameter.
func NoiseUpdate ¶
func NoiseUpdate(w http.ResponseWriter, r *http.Request)
NoiseUpdate update the noise. It works just like creating.
func SignUp ¶
func SignUp(w http.ResponseWriter, r *http.Request)
SignUp creates users Form must contains "name", "surname", "username" and "password".
func UserAuthMiddleware ¶
UserAuthMiddleware returns a middleware. That middleware check if the user's token is valid.
Types ¶
This section is empty.