handlers

package
v0.0.0-...-b85db87 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleCantorsList

func HandleCantorsList(app *infrastructure.AppState) gin.HandlerFunc

HandleCantorsList godoc @Summary List Cantors @Description Returns a list of all available cantors with their geolocations. @Tags cantors @Produce json @Success 200 {array} infrastructure.CantorListResponse @Failure 500 {object} map[string]string @Router /cantors [get]

func HandleDeleteCantor

func HandleDeleteCantor(app *infrastructure.AppState) gin.HandlerFunc

HandleDeleteCantor godoc @Summary Delete Cantor @Description Deletes a discovered cantor from the database by ID. @Tags cantors @Param id path int true "Cantor ID" @Produce json @Success 200 {object} map[string]string @Failure 400 {object} map[string]string @Failure 403 {object} map[string]string @Failure 404 {object} map[string]string @Failure 500 {object} map[string]string @Router /cantors/{id} [delete]

func HandleDiscover

func HandleDiscover(app *infrastructure.AppState) gin.HandlerFunc

HandleDiscover godoc @Summary Discover New Cantor @Description Attempts to discover exchange rates on a new URL using heuristic scraping and adds it to the database and Elasticsearch. @Tags discovery @Accept json @Produce json @Param discovery body map[string]string true "Discovery parameters (url, name, lat, lon)" @Success 201 {object} map[string]string @Failure 400 {object} map[string]string @Failure 500 {object} map[string]string @Router /discover [post]

func HandleFinOps

func HandleFinOps(app *infrastructure.AppState) gin.HandlerFunc

func HandleGetHistory

func HandleGetHistory(app *infrastructure.AppState) gin.HandlerFunc

func HandleGetRates

func HandleGetRates(app *infrastructure.AppState) gin.HandlerFunc

HandleGetRates godoc @Summary Get Rates @Description Returns the buy and sell rates for a specific cantor and currency. Scrapes data in real-time if not cached. @Tags rates @Produce json @Param cantor_id query int true "Cantor ID" @Param currency query string true "Currency Code (e.g., EUR, USD)" @Success 200 {object} pb.RateResponse @Failure 400 {object} map[string]string @Failure 404 {object} map[string]string @Failure 500 {object} map[string]string @Router /rates [get]

func HandleHealthCheck

func HandleHealthCheck(app *infrastructure.AppState) gin.HandlerFunc

HandleHealthCheck godoc @Summary Health Check @Description Checks if the server, database, and Redis are running correctly. @Tags health @Produce json @Success 200 {object} map[string]string @Failure 503 {object} map[string]string @Router /healthz [get]

Types

This section is empty.

Jump to

Keyboard shortcuts

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