Documentation ¶
Index ¶
- func CorsHandler(w http.ResponseWriter, r *http.Request)
- func NewAPIContext(bindAddress *string, hr application.HealthRepository, ...) *http.Server
- type APIContext
- func (apiContext *APIContext) GetBookInfo(rw http.ResponseWriter, r *http.Request)
- func (apiContext *APIContext) GetBooks(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) MiddlewareValidateNewBookInfo(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.BookInfoRepository) *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) GetBookInfo ¶
func (apiContext *APIContext) GetBookInfo(rw http.ResponseWriter, r *http.Request)
GetBookInfo gets the bookInfos of the Titanic with the given id
func (*APIContext) GetBooks ¶
func (apiContext *APIContext) GetBooks(rw http.ResponseWriter, r *http.Request)
GetBooks gets the tree of all the bookInfos inside a space.
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) MiddlewareValidateNewBookInfo ¶
func (apiContext *APIContext) MiddlewareValidateNewBookInfo(next http.Handler) http.Handler
MiddlewareValidateNewBookInfo Checks the integrity of new bookInfo 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.