Documentation ¶
Index ¶
- type App
- func (a *App) AddComment(w http.ResponseWriter, r *http.Request)
- func (a *App) Chat(w http.ResponseWriter, r *http.Request)
- func (a *App) CreateRecipe(w http.ResponseWriter, r *http.Request)
- func (a *App) DeleteRecipe(w http.ResponseWriter, r *http.Request)
- func (a *App) GetRecipeByID(w http.ResponseWriter, r *http.Request)
- func (a *App) GetRecipeComments(w http.ResponseWriter, r *http.Request)
- func (a *App) Init()
- func (a *App) ListCategories(w http.ResponseWriter, r *http.Request)
- func (a *App) ListRecipes(w http.ResponseWriter, r *http.Request)
- func (a *App) Login(w http.ResponseWriter, r *http.Request)
- func (a *App) Register(w http.ResponseWriter, r *http.Request)
- func (a *App) RegisterRoutes()
- func (a *App) Run(addr string)
- func (a *App) UpdateRecipe(w http.ResponseWriter, r *http.Request)
- type ConnectionMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct { Router *chi.Mux RecipeStore contracts.IRecipeStore UserStore contracts.IUserStore CategoryStore contracts.ICategoryStore CommentStore contracts.ICommentStore Validator *validator.Validate Translator ut.Translator APISecret string }
App is struct for application
func (*App) AddComment ¶
func (a *App) AddComment(w http.ResponseWriter, r *http.Request)
AddComment POST /api/recipes/{recipeID}/comments
func (*App) CreateRecipe ¶
func (a *App) CreateRecipe(w http.ResponseWriter, r *http.Request)
CreateRecipe POST /api/recipes
func (*App) DeleteRecipe ¶
func (a *App) DeleteRecipe(w http.ResponseWriter, r *http.Request)
DeleteRecipe DELETE /api/recipes/{recipeID}
func (*App) GetRecipeByID ¶
func (a *App) GetRecipeByID(w http.ResponseWriter, r *http.Request)
GetRecipeByID GET /recipe/{recipeID}
func (*App) GetRecipeComments ¶
func (a *App) GetRecipeComments(w http.ResponseWriter, r *http.Request)
GetRecipeComments GET /api/recipes/{recipeID}/comments
func (*App) ListCategories ¶
func (a *App) ListCategories(w http.ResponseWriter, r *http.Request)
ListCategories GET /api/categories
func (*App) ListRecipes ¶
func (a *App) ListRecipes(w http.ResponseWriter, r *http.Request)
ListRecipes GET /api/recipes
func (*App) Login ¶
func (a *App) Login(w http.ResponseWriter, r *http.Request)
Login receives username and password and logs in the user if the credentials are valid Returns a jwt token via json response
func (*App) Register ¶
func (a *App) Register(w http.ResponseWriter, r *http.Request)
Register receives username, password, email, RepeatPassword If the credentials are valid Returns a jwt token via json response
func (*App) RegisterRoutes ¶
func (a *App) RegisterRoutes()
RegisterRoutes registers routes of the app
func (*App) UpdateRecipe ¶
func (a *App) UpdateRecipe(w http.ResponseWriter, r *http.Request)
UpdateRecipe PUT /api/recipes/{recipeID}
type ConnectionMap ¶
type ConnectionMap struct {
// contains filtered or unexported fields
}
func (*ConnectionMap) Delete ¶
func (c *ConnectionMap) Delete(client *websocket.Conn)
func (*ConnectionMap) SendMsg ¶
func (c *ConnectionMap) SendMsg(msg models.Message)