Implementing our RESTful APIs handler functions

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. ...

Get Cloud Native programming with Golang now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.