mirror of
https://github.com/alice-lg/alice-lg.git
synced 2024-05-11 05:55:03 +00:00
20 lines
452 B
Go
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
|
||
|
}
|