controllers

package module
v0.0.0-...-d0b3471 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
}

Controller struct

func NewController

func NewController() *Controller

NewController example

func (*Controller) ListShows

func (c *Controller) ListShows(ctx *gin.Context)

ListShows function to return shows from API @Summary List shows @Description get shows @Tags shows @Accept json @Produce json @Param prettyPrint query string false "pretty print show" Format(bool) @Success 200 {array} models.Show @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /shows [get]

func (*Controller) Ping

func (c *Controller) Ping(ctx *gin.Context)

Ping return pong @Summary ping common @Description do ping @Tags common @Accept json @Produce json @Success 200 {string} string "pong" @Failure 400 {string} string "ok" @Failure 404 {string} string "ok" @Failure 500 {string} string "ok" @Router /ping [get]

func (*Controller) ShowShow

func (c *Controller) ShowShow(ctx *gin.Context)

ShowShow func to retrun a specific show @Summary Show an show @Description get show by slug @Tags shows @Accept json @Produce json @Param slug path string true "Show ID" @Param prettyPrint query string false "pretty print show" Format(bool) @Success 200 {object} models.Show @Failure 400 {object} ErrorResponse @Failure 404 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /shows/{slug} [get]

type ErrorResponse

type ErrorResponse struct {
	Message  string `json:"message" groups:"api" example:"status bad request"`
	Code     int    `json:"code" groups:"api" example:"400"`
	MoreInfo string `json:"more_info" groups:"api" example:"http://"`
}

ErrorResponse used to descrive api error response

type Response

type Response struct {
	Data interface{} `json:"data" groups:"api"`
}

Response used to describe api response

Jump to

Keyboard shortcuts

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