Documentation ¶
Index ¶
- func CorsHandler(w http.ResponseWriter, r *http.Request)
- func NewAPIContext(bindAddress *string, hr application.HealthRepository, ...) *http.Server
- type APIContext
- func (apiContext *APIContext) GetBookStock(rw http.ResponseWriter, r *http.Request)
- func (p *APIContext) Index(rw http.ResponseWriter, r *http.Request)
- func (ctx *APIContext) Live(rw http.ResponseWriter, r *http.Request)
- func (apiContext *APIContext) MiddlewareValidateNewBookStock(next http.Handler) http.Handler
- func (ctx *APIContext) Ready(rw http.ResponseWriter, r *http.Request)
- func (p *APIContext) Version(rw http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CorsHandler ¶
func CorsHandler(w http.ResponseWriter, r *http.Request)
CorsHandler swagger:route OPTIONS /
Handler to respond to CORS preflight requests ¶
Responses:
200: OK
func NewAPIContext ¶
func NewAPIContext(bindAddress *string, hr application.HealthRepository, br application.BookStockRepository) *http.Server
NewAPIContext returns a new APIContext handler with the given logger
Types ¶
type APIContext ¶
type APIContext struct {
// contains filtered or unexported fields
}
APIContext handler for getting and updating Ratings
func (*APIContext) GetBookStock ¶
func (apiContext *APIContext) GetBookStock(rw http.ResponseWriter, r *http.Request)
GetBookStock gets the bookStocks of the Titanic with the given id
func (*APIContext) Index ¶
func (p *APIContext) Index(rw http.ResponseWriter, r *http.Request)
Index returns OK handles GET requests
func (*APIContext) Live ¶
func (ctx *APIContext) Live(rw http.ResponseWriter, r *http.Request)
Live handles GET requests
func (*APIContext) MiddlewareValidateNewBookStock ¶
func (apiContext *APIContext) MiddlewareValidateNewBookStock(next http.Handler) http.Handler
MiddlewareValidateNewBookStock Checks the integrity of new bookStock in the request and calls next if ok
func (*APIContext) Ready ¶
func (ctx *APIContext) Ready(rw http.ResponseWriter, r *http.Request)
Ready handles GET requests
func (*APIContext) Version ¶
func (p *APIContext) Version(rw http.ResponseWriter, r *http.Request)
Version returns the version info for the service by reading from a static file
Source Files ¶
Click to show internal directories.
Click to hide internal directories.