Documentation
¶
Index ¶
- type AppHandler
- func (ah *AppHandler) AddMovie() http.HandlerFunc
- func (ah *AppHandler) AddRequestID(h http.Handler) http.Handler
- func (ah *AppHandler) AddStandardResponseHeaders(h http.Handler) http.Handler
- func (ah *AppHandler) Delete() http.HandlerFunc
- func (ah *AppHandler) FindAll() http.HandlerFunc
- func (ah *AppHandler) FindByID() http.HandlerFunc
- func (ah *AppHandler) Update() http.HandlerFunc
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() http.HandlerFunc
AddMovie handles POST requests for the /movies endpoint and creates a movie in the database
func (*AppHandler) AddRequestID ¶ added in v0.13.0
func (ah *AppHandler) AddRequestID(h http.Handler) http.Handler
AddRequestID middleware is used to add a unique request ID to each request
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() http.HandlerFunc
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() http.HandlerFunc
FindAll handles GET requests for the /movies endpoint and finds all movies
func (*AppHandler) FindByID ¶ added in v0.12.0
func (ah *AppHandler) FindByID() http.HandlerFunc
FindByID handles GET requests for the /movies/{id} endpoint and finds a movie by it's ID
func (*AppHandler) Update ¶ added in v0.13.0
func (ah *AppHandler) Update() http.HandlerFunc
Update handles PUT requests for the /movies/{id} endpoint and updates the given movie