code: func (rm *RouteManager) Add(route *Route) error {
  	rm.Lock()
  	defer rm.Unlock()
  	factory, found := AdapterFactories.Lookup(route.AdapterType())
  	if !found {
  		return errors.New("bad adapter: " + route.Adapter)
  	}
  	adapter, err := factory(route)
  	if err != nil {
  		return err
  	}
  	if route.ID == "" {
  		h := sha1.New()
  		io.WriteString(h, strconv.Itoa(int(time.Now().UnixNano())))
  		route.ID = fmt.Sprintf("%x", h.Sum(nil))[:12]
  	}
  	route.closer = make(chan bool)
  	route.adapter = adapter
  	//Stop any existing route with this ID:
  	if rm.routes[route.ID] != nil {
  		rm.routes[route.ID].closer <- true
  	}
  
  	rm.routes[route.ID] = route
  	if rm.persistor != nil {
  		if err := rm.persistor.Add(route); err != nil {
  			log.Println("persistor:", err)
  		}
  	}
  	if rm.routing {
  		go rm.route(route)
  	}
  	return nil
  }
docs: // Add adds a route to the RouteManager