handlers

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(e error)

func CreateDb

func CreateDb()

func DeleteAllCoffeeOrders

func DeleteAllCoffeeOrders(c *fiber.Ctx) error

DELETE all coffeeorders

func DeleteDb

func DeleteDb()

func DeleteSingleNewestCoffeeOrderByEmailAddress

func DeleteSingleNewestCoffeeOrderByEmailAddress(c *fiber.Ctx) error

DELETE /coffeeorders/:emailAddress

func InsertACoffeeOrderIntoDb

func InsertACoffeeOrderIntoDb(co *CoffeeOrder)

func ListCoffeeOrders

func ListCoffeeOrders(c *fiber.Ctx) error

GET /coffeeorders

func ListCoffeeOrdersByEmailAddress

func ListCoffeeOrdersByEmailAddress(c *fiber.Ctx) error

GET /coffeeorders/:emailAddress

func PostACoffeeOrder

func PostACoffeeOrder(c *fiber.Ctx) error

POST a new coffeeorder

func PutCoffeeOrderOverExistingByEmail

func PutCoffeeOrderOverExistingByEmail(c *fiber.Ctx) error

PUT /coffeeorders/:emailAddress

func ReplaceCoffeeOrdersIntoDb

func ReplaceCoffeeOrdersIntoDb(cos *CoffeeOrders)

func Root

func Root(c *fiber.Ctx) error

GET /

Types

type CoffeeOrder

type CoffeeOrder struct {
	ID           primitive.ObjectID `json:"_id"`
	Coffee       string             `json:"coffee,omitempty"`
	EmailAddress string             `json:"emailAddress,omitempty"`
	Flavor       string             `json:"flavor,omitempty"`
	Strength     uint8              `json:"strength,omitempty"`
}

type CoffeeOrders

type CoffeeOrders struct {
	CoffeeOrder []CoffeeOrder `json:"users,omitempty"`
}

func ReadCoffeeOrdersFromDb

func ReadCoffeeOrdersFromDb() CoffeeOrders

Jump to

Keyboard shortcuts

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