So, now that have covered our persistence layer, it's time to return to our RESTful API handlers and cover their implementation. Earlier in this chapter, we defined the eventServiceHandler struct type to look like this:
type eventServiceHandler struct {}func (eh *eventServiceHandler) findEventHandler(w http.ResponseWriter, r *http.Request) {}func (eh *eventServiceHandler) allEventHandler(w http.ResponseWriter, r *http.Request) {}func (eh *eventServiceHandler) newEventHandler(w http.ResponseWriter, r *http.Request) {}
The eventServiceHandler type now needs to support the DatabaseHandler interface type we created earlier in the chapter in order to be capable of performing database operations. ...