Documentation
¶
Index ¶
- type AppHandler
- func (ah *AppHandler) AddMovie(w http.ResponseWriter, r *http.Request)
- func (ah *AppHandler) AddStandardResponseHeaders(h http.Handler) http.Handler
- func (ah *AppHandler) Delete(w http.ResponseWriter, r *http.Request)
- func (ah *AppHandler) FindAll(w http.ResponseWriter, r *http.Request)
- func (ah *AppHandler) FindByID(w http.ResponseWriter, r *http.Request)
- func (ah *AppHandler) SetStandardResponseFields(h http.Handler) http.Handler
- func (ah *AppHandler) Update(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppHandler ¶ added in v0.12.0
type AppHandler struct {
App *app.Application
controller.StandardResponseFields
}
AppHandler is the struct that serves the application and methods for handling all HTTP requests
func NewAppHandler ¶ added in v0.13.0
func NewAppHandler(app *app.Application) *AppHandler
NewAppHandler initializes the AppHandler
func (*AppHandler) AddMovie ¶ added in v0.12.0
func (ah *AppHandler) AddMovie(w http.ResponseWriter, r *http.Request)
AddMovie handles POST requests for the /movies endpoint and creates a movie in the database
func (*AppHandler) AddStandardResponseHeaders ¶ added in v0.12.0
func (ah *AppHandler) AddStandardResponseHeaders(h http.Handler) http.Handler
AddStandardResponseHeaders middleware is used to add any standard HTTP response headers
func (*AppHandler) Delete ¶ added in v0.13.0
func (ah *AppHandler) Delete(w http.ResponseWriter, r *http.Request)
Delete handles DELETE requests for the /movies/{id} endpoint and updates the given movie
func (*AppHandler) FindAll ¶ added in v0.13.0
func (ah *AppHandler) FindAll(w http.ResponseWriter, r *http.Request)
FindAll handles GET requests for the /movies endpoint and finds all movies
func (*AppHandler) FindByID ¶ added in v0.12.0
func (ah *AppHandler) FindByID(w http.ResponseWriter, r *http.Request)
FindByID handles GET requests for the /movies/{id} endpoint and finds a movie by it's ID
func (*AppHandler) SetStandardResponseFields ¶ added in v0.16.0
func (ah *AppHandler) SetStandardResponseFields(h http.Handler) http.Handler
SetStandardResponseFields middleware is used to set the fields that are part of every response
func (*AppHandler) Update ¶ added in v0.13.0
func (ah *AppHandler) Update(w http.ResponseWriter, r *http.Request)
Update handles PUT requests for the /movies/{id} endpoint and updates the given movie