routes

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllCategoriesHandler

func GetAllCategoriesHandler(categoriesToTrickSliceMap map[models.TrickCategory][]models.Trick) gin.HandlerFunc

GetAllCategories godoc @Description Reads and returns all existing categories of tricks from the tricks.json file at https://github.com/TrickingApi/trickingapi @Sumary Get All Category Names from TrickingApi/data/tricks @Tags categories @Accept */* @Produce json @Success 200 {object} []string @Router /categories [get]

func GetAllTrickNamesHandler

func GetAllTrickNamesHandler(idToTrickMap map[string]models.Trick) gin.HandlerFunc

GetAllTrickNames godoc @Description Returns the names of all tricks from the static trickNames.json file at https://github.com/TrickingApi/trickingapi @Summary Get All Trick Names and their ids from TrickingApi/data/tricks @Tags tricks @Accept */* @Produce json @Success 200 {object} map[string]string @Router /tricks/names [get]

func GetAllTricksByCategoriesHandler

func GetAllTricksByCategoriesHandler(categoriesToTrickSliceMap map[models.TrickCategory][]models.Trick) gin.HandlerFunc

GetAllTricksByCategories godoc @Description Reads and returns a mapping of categories to list of tricks from the tricks.json file at https://github.com/TrickingApi/trickingapi @Summary Get All Tricks Grouped by Categories from TrickingApi/data/tricks @Tags categories, tricks @Accept */* @Produce json @Success 200 {object} map[models.TrickCategory][]models.Trick @Router /categories/tricks [get]

func GetAllTricksHandler

func GetAllTricksHandler(idToTrickMap map[string]models.Trick) gin.HandlerFunc

GetAllTricks godoc @Description Reads and returns list of tricks from the static tricks.json file at https://github.com/TrickingApi/trickingapi @Summary Get All Tricks from TrickingApi/data/tricks @Tags tricks @Accept */* @Produce json @Success 200 {object} map[string]models.Trick @Router /tricks [get]

func GetTrickHandler

func GetTrickHandler(idToTrickMap map[string]models.Trick) gin.HandlerFunc

GetTrick godoc @Description reads list of known Trick objects and returns trick matching the name param in the request @Summary Get Trick by Specific Name from TrickingApi/data/tricks @Tags tricks @Accept */* @Produce json @Success 200 {object} models.Trick @Failure 404 {object} models.TrickError @Router /tricks:name [get]

func GetTricksForCategoryHandler

func GetTricksForCategoryHandler(categoriesToTrickSliceMap map[models.TrickCategory][]models.Trick) gin.HandlerFunc

GetTricksForCategory godoc @Description Reads and returns a list of tricks for a specific category from the tricks.json file at https://github.com/TrickingApi/trickingapi @Summary Get All Tricks Grouped Under A Category from TrickingApi/data/tricks @Tags categories, tricks @Accept */* @Produce json @Success 200 {object} []models.Trick @Router /categories/:name [get]

func SetUpTests

func SetUpTests() (*gin.Context, *httptest.ResponseRecorder, models.Trick)

Types

This section is empty.

Jump to

Keyboard shortcuts

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