Documentation ¶
Index ¶
- func RespondWithError(w http.ResponseWriter, code int, message string)
- func RespondWithJSON(w http.ResponseWriter, code int, payload interface{})
- type API
- func (api *API) AuthJWTMiddleware(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
- func (api *API) GetUserFromContext(req *http.Request) *models.User
- func (api *API) ProjectsHandler(w http.ResponseWriter, req *http.Request)
- func (api *API) UserInfoHandler(w http.ResponseWriter, req *http.Request)
- func (api *API) UserSignup(w http.ResponseWriter, req *http.Request)
- type ProjectJSON
- type Token
- type UserJSON
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RespondWithError ¶
func RespondWithError(w http.ResponseWriter, code int, message string)
func RespondWithJSON ¶
func RespondWithJSON(w http.ResponseWriter, code int, payload interface{})
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API struct
func (*API) AuthJWTMiddleware ¶
func (api *API) AuthJWTMiddleware(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
func (*API) GetUserFromContext ¶
GetUserFromContext - return User reference from header token
func (*API) ProjectsHandler ¶
func (api *API) ProjectsHandler(w http.ResponseWriter, req *http.Request)
func (*API) UserInfoHandler ¶
func (api *API) UserInfoHandler(w http.ResponseWriter, req *http.Request)
UserInfoHandler - Return user details as marshalled to JSON.
func (*API) UserSignup ¶
func (api *API) UserSignup(w http.ResponseWriter, req *http.Request)
UserSignup -
type ProjectJSON ¶
ProjectJSON - JSON data expected for login/signup
Click to show internal directories.
Click to hide internal directories.