Exemplo n.º 1
0
//ListBackendConfigs lists the backend definitions present in the supplied KVS
func ListBackendConfigs(kvs kvstore.KVStore) ([]*BackendConfig, error) {
	pairs, err := kvs.List("backends/")
	if err != nil {
		return nil, err
	}

	var backends []*BackendConfig
	for _, p := range pairs {
		backends = append(backends, JSONToBackend(p.Value))
	}

	return backends, nil
}
Exemplo n.º 2
0
//ListListenerConfigs retrieves the listener defs from the KVS
func ListListenerConfigs(kvs kvstore.KVStore) ([]*ListenerConfig, error) {
	pairs, err := kvs.List("listeners/")
	if err != nil {
		return nil, err
	}

	var listeners []*ListenerConfig
	for _, p := range pairs {
		listeners = append(listeners, JSONToListener(p.Value))
	}

	return listeners, nil
}
Exemplo n.º 3
0
//ListRouteConfigs returns the route configs in the key value store
func ListRouteConfigs(kvs kvstore.KVStore) ([]*RouteConfig, error) {
	pairs, err := kvs.List("routes/")
	if err != nil {
		return nil, err
	}

	var routes []*RouteConfig
	for _, p := range pairs {
		routes = append(routes, JSONToRoute(p.Value))
	}

	return routes, nil
}