Documentation ¶
Index ¶
- Constants
- func AuthRequired(next http.HandlerFunc) http.HandlerFunc
- type Board
- type BoardsResponse
- type FavoritesResponse
- type Handlers
- func (h *Handlers) AuthHandler(w http.ResponseWriter, r *http.Request)
- func (h *Handlers) BoardsHandler(w http.ResponseWriter, r *http.Request)
- func (h *Handlers) CatchHandler(w http.ResponseWriter, r *http.Request)
- func (h *Handlers) FavoritesHandler(w http.ResponseWriter, r *http.Request)
- func (h *Handlers) HomeHandler(w http.ResponseWriter, r *http.Request)
- func (h *Handlers) LogoutHandler(w http.ResponseWriter, r *http.Request)
- func (h *Handlers) RecipesHandler(w http.ResponseWriter, r *http.Request)
- type HomeResponse
- type PindishClaims
- type Recipe
- type RecipesResponse
- type User
Constants ¶
const ( // CtxUserID used to access user id CtxUserID key = iota // CtxAccessToken used to access user token CtxAccessToken key = iota // CtxUserImage used to access user image CtxUserImage key = iota // CtxUserFName used to access user first name CtxUserFName key = iota //CtxUserUName used to access user username CtxUserUName key = iota )
Variables ¶
This section is empty.
Functions ¶
func AuthRequired ¶
func AuthRequired(next http.HandlerFunc) http.HandlerFunc
AuthRequired is middleware that handles auth checking
Types ¶
type Board ¶
type Board struct { jsonhal.Hal Name string `json:"name"` URL string `json:"url"` Image models.PinterestImages `json:"image"` Counts models.PinterestCount `json:"counts"` ID string `json:"id"` Description string `json:"description"` Favorited bool `json:"favorited"` LastUpdate int `json:"last_update"` }
Board describes a board resource
type BoardsResponse ¶
BoardsResponse describes boards for user
type FavoritesResponse ¶
FavoritesResponse is our response to a favorites request
type Handlers ¶
Handlers is the wrapper for handlers
func (*Handlers) AuthHandler ¶
func (h *Handlers) AuthHandler(w http.ResponseWriter, r *http.Request)
AuthHandler redirects a user to the pinterest oauth
func (*Handlers) BoardsHandler ¶
func (h *Handlers) BoardsHandler(w http.ResponseWriter, r *http.Request)
BoardsHandler Gets a list of user's boards
func (*Handlers) CatchHandler ¶
func (h *Handlers) CatchHandler(w http.ResponseWriter, r *http.Request)
CatchHandler handles the oauth catch
func (*Handlers) FavoritesHandler ¶
func (h *Handlers) FavoritesHandler(w http.ResponseWriter, r *http.Request)
FavoritesHandler Gets a list of user's boards
func (*Handlers) HomeHandler ¶
func (h *Handlers) HomeHandler(w http.ResponseWriter, r *http.Request)
HomeHandler handles the root api listing
func (*Handlers) LogoutHandler ¶
func (h *Handlers) LogoutHandler(w http.ResponseWriter, r *http.Request)
LogoutHandler removes a user's JWT and redirects them back to the app
func (*Handlers) RecipesHandler ¶
func (h *Handlers) RecipesHandler(w http.ResponseWriter, r *http.Request)
RecipesHandler Gets a list of user's boards
type HomeResponse ¶
HomeResponse is a response model for home
type PindishClaims ¶
type PindishClaims struct { ID string `json:"id"` Token string `json:"token"` FName string `json:"fname"` UName string `json:"uname"` Image string `json:"image"` jwt.StandardClaims }
PindishClaims are the custom claims for pindish
type Recipe ¶
type Recipe struct { jsonhal.Hal ID int `json:"id"` Image models.PinterestImages `json:"image"` Link string `json:"link"` Servings struct { Serves string `json:"serves"` Summary string `json:"summary"` } `json:"servings"` Name string `json:"name"` Ingredients []models.IngredientCategory `json:"ingredients"` }
Recipe describes a recipe
type RecipesResponse ¶
RecipesResponse describes boards for user