Documentation ¶
Index ¶
- func HandleLive(w http.ResponseWriter, _ *http.Request)
- type Server
- func (s *Server) HandleCreateBook(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleDeleteBook(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleIndex(w http.ResponseWriter, _ *http.Request)
- func (s *Server) HandleListBooks(w http.ResponseWriter, _ *http.Request)
- func (s *Server) HandleReadBook(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleReady(w http.ResponseWriter, _ *http.Request)
- func (s *Server) HandleUpdateBook(w http.ResponseWriter, r *http.Request)
- func (s *Server) Logger() *logger.Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleLive ¶
func HandleLive(w http.ResponseWriter, _ *http.Request)
HandleLive - A http.HandlerFunc that handles liveness checks by immediately responding with an HTTP 200 status.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server - application representation wrapping a logger.Logger
func (*Server) HandleCreateBook ¶
func (s *Server) HandleCreateBook(w http.ResponseWriter, r *http.Request)
HandleCreateBook - http route to create new book, with supplied model.Book json
func (*Server) HandleDeleteBook ¶
func (s *Server) HandleDeleteBook(w http.ResponseWriter, r *http.Request)
HandleDeleteBook - http request to handle delete book request by bookId
func (*Server) HandleIndex ¶
func (s *Server) HandleIndex(w http.ResponseWriter, _ *http.Request)
HandleIndex - HandleIndex is the router to process index request.
func (*Server) HandleListBooks ¶
func (s *Server) HandleListBooks(w http.ResponseWriter, _ *http.Request)
HandleListBooks - http route to list all the books. Returns result in form of model.BookDtos
func (*Server) HandleReadBook ¶
func (s *Server) HandleReadBook(w http.ResponseWriter, r *http.Request)
HandleReadBook - http route to handle book by id request. Returns result in form of model.BookDto json
func (*Server) HandleReady ¶
func (s *Server) HandleReady(w http.ResponseWriter, _ *http.Request)
HandleReady - A http.HandlerFunc that handles readiness checks by responding with an HTTP 200 status if it is healthy, 500 otherwise.
func (*Server) HandleUpdateBook ¶
func (s *Server) HandleUpdateBook(w http.ResponseWriter, r *http.Request)
HandleUpdateBook - http route to handle update book based on id and supplied model.Book json payload