code: func (h *Handler) serveGetLeader(w http.ResponseWriter, r *http.Request, params httprouter.Params) {
  	// Process as a stream if that's what the client wants.
  	if strings.Contains(r.Header.Get("Accept"), "text/event-stream") {
  		h.serveStream(w, params, discoverd.EventKindLeader)
  		return
  	}
  
  	// Otherwise retrieve the current leader.
  	service := params.ByName("service")
  	leader, err := h.Store.ServiceLeader(service)
  	if err != nil {
  		hh.Error(w, err)
  		return
  	} else if leader == nil {
  		hh.ObjectNotFoundError(w, "no leader found")
  		return
  	}
  
  	// Write leader to the response.
  	hh.JSON(w, 200, leader)
  }
docs: // serveGetLeader returns the current leader for a service.