func (t *traefik) DeleteServer(ba loadbalancer.Backend, srv loadbalancer.Server) error { logger.Debugf("[%v] Attempting delete: %v", ba.GetID(), srv) key := path.Join(t.prefix, "backends", ba.GetID(), "servers", srv.GetID()) if er := t.Exists(key); er != nil { return fmt.Errorf("Lookup %v failed: %v", srv, er) } return t.Delete(key) }
func (t *traefik) UpsertServer(ba loadbalancer.Backend, srv loadbalancer.Server) error { if er := t.Exists(path.Join(t.prefix, "backends", ba.GetID())); er != nil { return fmt.Errorf("Lookup %v failed: %v", ba, er) } urlKey := path.Join(t.prefix, "backends", ba.GetID(), "servers", srv.GetID(), "url") weightKey := path.Join(t.prefix, "backends", ba.GetID(), "servers", srv.GetID(), "weight") if er := t.Set(urlKey, srv.(*server).URL); er != nil { return er } weight := strconv.Itoa(srv.(*server).Weight) if er := t.Set(weightKey, weight); er != nil { return er } return nil }
func (b *backend) AddServer(s loadbalancer.Server) { b.Servers[s.GetID()] = s.(*server).Server }
func (v *vulcan) DeleteServer(ba loadbalancer.Backend, srv loadbalancer.Server) error { return v.Client.DeleteServer( engine.ServerKey{BackendKey: engine.BackendKey{Id: ba.GetID()}, Id: srv.GetID()}, ) }