2018-09-22 15:51:20 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/alice-lg/alice-lg/backend/api"
|
|
|
|
"github.com/julienschmidt/httprouter"
|
|
|
|
|
|
|
|
"net/http"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Handle get neighbors on routeserver
|
|
|
|
func apiNeighborsList(_req *http.Request, params httprouter.Params) (api.Response, error) {
|
|
|
|
rsId, err := validateSourceId(params.ByName("id"))
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
source := AliceConfig.Sources[rsId].getInstance()
|
|
|
|
result, err := source.Neighbours()
|
2018-10-02 14:52:47 +02:00
|
|
|
if err != nil {
|
|
|
|
apiLogSourceError("neighbors", rsId, err)
|
|
|
|
}
|
|
|
|
|
2018-09-22 15:51:20 +02:00
|
|
|
return result, err
|
|
|
|
}
|