Exemple #1
0
func (c *Configurator) upsertHost(host *Host) error {
	if c.a.GetHostRouter().GetRouter(host.Name) != nil {
		return nil
	}
	router := pathroute.NewPathRouter()
	c.a.GetHostRouter().SetRouter(host.Name, router)
	log.Infof("Added %s", host)
	return nil
}
Exemple #2
0
func (s *Service) addHost(host *Host) error {
	router := pathroute.NewPathRouter()
	return s.router.SetRouter(host.Name, router)
}