code: func (h *Handler) servePutServiceMeta(w http.ResponseWriter, r *http.Request, params httprouter.Params) {
  	// Read the metadata from the request.
  	meta := &discoverd.ServiceMeta{}
  	if err := hh.DecodeJSON(r, meta); err != nil {
  		hh.Error(w, err)
  		return
  	}
  
  	// Update the meta in the store.
  	if err := h.Store.SetServiceMeta(params.ByName("service"), meta); err == ErrNotLeader {
  		h.redirectToLeader(w, r)
  		return
  	} else if IsNotFound(err) {
  		hh.ObjectNotFoundError(w, err.Error())
  		return
  	} else if err != nil {
  		hh.Error(w, err)
  		return
  	}
  
  	// Write meta back to response.
  	hh.JSON(w, 200, meta)
  }
docs: // serveServiceMeta sets the metadata for a service.