1
0
mirror of https://github.com/alice-lg/alice-lg.git synced 2024-05-11 05:55:03 +00:00
alice-lg-alice-lg/backend/api_endpoints_neighbors.go
2018-09-22 15:51:20 +02:00

20 lines
452 B
Go

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()
return result, err
}