Ejemplo n.º 1
0
// Inserts or updates a routes in etcd.
func (c *Client) Upsert(r *eskip.Route) error {
	if r.Id == "" {
		return missingRouteId
	}

	_, err := c.etcd.Set(c.routesRoot+"/"+r.Id, r.String(), 0)
	return err
}
Ejemplo n.º 2
0
func (c *Client) etcdSet(r *eskip.Route) error {
	_, err := c.etcdRequest("PUT", c.routesRoot+"/"+r.Id, r.String())
	return err
}
Ejemplo n.º 3
0
func routesDiffer(left, right *eskip.Route) bool {
	return left.String() != right.String()
}