code: func (s *Server) localEvent(event serf.UserEvent) {
  	// Handle only consul events
  	if !strings.HasPrefix(event.Name, "consul:") {
  		return
  	}
  
  	switch name := event.Name; {
  	case name == newLeaderEvent:
  		s.logger.Printf("[INFO] consul: New leader elected: %s", event.Payload)
  
  		// Trigger the callback
  		if s.config.ServerUp != nil {
  			s.config.ServerUp()
  		}
  	case isUserEvent(name):
  		event.Name = rawUserEventName(name)
  		s.logger.Printf("[DEBUG] consul: User event: %s", event.Name)
  
  		// Trigger the callback
  		if s.config.UserEventHandler != nil {
  			s.config.UserEventHandler(event)
  		}
  	default:
  		if !s.handleEnterpriseUserEvents(event) {
  			s.logger.Printf("[WARN] consul: Unhandled local event: %v", event)
  		}
  	}
  }
docs: // localEvent is called when we receive an event on the local Serf