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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.