handlers

package
v0.0.0-...-481979b Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handlers

type Handlers struct {
	// contains filtered or unexported fields
}

Handlers struct to hold the data service.

func NewHandlers

func NewHandlers(dataService *services.APIDataService) *Handlers

NewHandlers creates a new Handlers instance.

func RegisterRoutes

func RegisterRoutes(mux *http.ServeMux, dataService *services.APIDataService) *Handlers

RegisterRoutes registers all the routes for the API.

func (*Handlers) GetCompetitionFixtures

func (h *Handlers) GetCompetitionFixtures(w http.ResponseWriter, r *http.Request)

GetCompetitionFixtures retrieves fixtures for a specific competition. @Summary Retrieve fixtures for a specific competition @Description Get fixtures by competition ID @Tags fixtures @Produce json @Param competition_id path int true "Competition ID" example(111) @Param round query int false "Round number" example(1) @Success 200 {array} models.APIFixture @Failure 400 "Invalid competition_id" @Router /api/v1/fixtures/{competition_id} [get]

func (*Handlers) GetCompetitions

func (h *Handlers) GetCompetitions(w http.ResponseWriter, r *http.Request)

GetCompetitions retrieves a list of all available competitions. @Summary Retrieve a list of all available competitions @Description Get all competitions @Tags competitions @Produce json @Success 200 {array} models.APICompetition @Router /api/v1/competitions [get]

func (*Handlers) GetFixtures

func (h *Handlers) GetFixtures(w http.ResponseWriter, r *http.Request)

GetFixtures retrieves all fixtures. @Summary Retrieve a list of all fixtures @Description Get all fixtures @Tags fixtures @Produce json @Success 200 {array} models.APIFixture @Router /api/v1/fixtures [get]

func (*Handlers) GetMatchDetails

func (h *Handlers) GetMatchDetails(w http.ResponseWriter, r *http.Request)

GetMatchDetails retrieves details for a specific match in a competition.

@Summary Retrieve match details @Description Get detailed information for a specific match within a competition. @Tags fixtures @Produce json @Param competition_id path int true "Competition ID" example(111) @Param match_id path int true "Match ID" example(20241610510) @Success 200 {object} models.APIFixture @Failure 400 "Invalid competition_id or match_id, or Fixture does not belong to the specified competition" @Failure 500 "Internal server error" @Router /api/v1/fixtures/{competition_id}/{match_id} [get]

Jump to

Keyboard shortcuts

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