Documentation ¶
Index ¶
- type Base
- func (b *Base) Create(w http.ResponseWriter, r *http.Request)
- func (b *Base) Get(w http.ResponseWriter, r *http.Request)
- func (b *Base) GetAll(w http.ResponseWriter, r *http.Request)
- func (b *Base) RecipeOfTheDayHandler(w http.ResponseWriter, r *http.Request)
- func (b *Base) Save(w http.ResponseWriter, r *http.Request)
- func (b *Base) SaveMany(w http.ResponseWriter, r *http.Request)
- func (b *Base) Update(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Base ¶
func (*Base) Get ¶
func (b *Base) Get(w http.ResponseWriter, r *http.Request)
Get retrieves a recipe by ID and returns it as JSON. It expects the recipe ID to be passed as a query parameter "id" in the URL. If the recipe is found, it returns a JSON response with the recipe data. If the recipe ID is not provided or is invalid, it returns a "Bad Request" response. If the recipe is not found, it returns a "Not Found" response. If there is an error retrieving or encoding the recipe, it returns an "Internal Server Error" response.
func (*Base) RecipeOfTheDayHandler ¶
func (b *Base) RecipeOfTheDayHandler(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.