meal

package
v0.0.0-...-5ac2c70 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	Log *log.Logger
	DB  *sql.DB
}

func (*Base) Create

func (b *Base) Create(w http.ResponseWriter, r *http.Request)

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) GetAll

func (b *Base) GetAll(w http.ResponseWriter, r *http.Request)

func (*Base) RecipeOfTheDayHandler

func (b *Base) RecipeOfTheDayHandler(w http.ResponseWriter, r *http.Request)

func (*Base) Save

func (b *Base) Save(w http.ResponseWriter, r *http.Request)

func (*Base) SaveMany

func (b *Base) SaveMany(w http.ResponseWriter, r *http.Request)

func (*Base) Update

func (b *Base) Update(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL