controllers

package
v0.0.0-...-31f8ae8 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRouter

func NewRouter() *mux.Router

NewRouter ...

Types

type Server

type Server struct {
	App app.App
}

Server is a struct

func (*Server) GetArtist

func (server *Server) GetArtist(w http.ResponseWriter, r *http.Request)

GetArtist Controller @Summary Get artist by query @Description Calling the discogs api and get the artist by id @ID get-artist @Accept json @Produce json @Success 200 {object} models.Artist @Header 200 {string} Token "ok" @Failure 404 {object} http. @Router /artists/ [get]

func (*Server) GetArtistReleases

func (server *Server) GetArtistReleases(w http.ResponseWriter, r *http.Request)

GetArtistReleases Controller @Summary Get artists releases by query @Description Calling the discogs api and get the artists releases by id @ID get-artists-releases @Accept json @Produce json @Success 200 {object} models.ArtistReleases @Header 200 {string} "" @Failure 404 {object} http.NotFound @Router /artists/releases/ [get]

func (*Server) GetLabel

func (server *Server) GetLabel(w http.ResponseWriter, r *http.Request)

GetLabel Controller @Summary Get label @Description Calling the discogs api and get the label by id @ID home @Accept json @Produce json @Success 200 {object} model.Label @Header 200 {string} "" @Failure 404 {object} http. @Router /labels/ [get]

func (*Server) GetLabelReleases

func (server *Server) GetLabelReleases(w http.ResponseWriter, r *http.Request)

GetLabelReleases Controller @Summary Get label releases @Description Calling the discogs api and get the label releases by id @ID home @Accept json @Produce json @Success 200 {object} model.LabelReleases @Header 200 {string} "" @Failure 404 {object} http. @Router /labels/ [get]

func (*Server) GetMaster

func (server *Server) GetMaster(w http.ResponseWriter, r *http.Request)

GetMaster Controller

func (*Server) GetMasterVersions

func (server *Server) GetMasterVersions(w http.ResponseWriter, r *http.Request)

GetMasterVersions Controller

func (*Server) GetRelease

func (server *Server) GetRelease(w http.ResponseWriter, r *http.Request)

GetRelease Controller

func (*Server) GetReleaseRating

func (server *Server) GetReleaseRating(w http.ResponseWriter, r *http.Request)

GetReleaseRating Controller

func (*Server) GetSearchResult

func (server *Server) GetSearchResult(w http.ResponseWriter, r *http.Request)

GetSearchResult Controller

func (*Server) HealthCheck

func (server *Server) HealthCheck(w http.ResponseWriter, r *http.Request)

HealthCheck checks api health status

func (*Server) Home

func (server *Server) Home(w http.ResponseWriter, r *http.Request)

Home Controller @Summary Get home @Description Homepage @ID home @Accept json @Produce json @Header 200 {string} Token "ok" @Failure 404 {object} utils.HTTPError404 @Router /home [get]

func (*Server) Initialize

func (server *Server) Initialize() error

Initialize is a method @Summary init db connection and set router @Description initialize database connection and set multiplexer router @ID init-db-and-set-router

func (*Server) Run

func (server *Server) Run()

Run calls listen-and-serve and implements logging handler @Summary Runs the listener on tcp and serves handler for incoming connections @Description run listen and serve on given port @ID run-listen-and-serve-on-give-port

Jump to

Keyboard shortcuts

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