1
0
mirror of https://github.com/alice-lg/alice-lg.git synced 2024-05-11 05:55:03 +00:00

added route dump fetching

This commit is contained in:
Matthias Hannig
2017-06-22 21:04:41 +02:00
parent a515ac1e77
commit 8f110726d3
2 changed files with 16 additions and 1 deletions

View File

@ -174,3 +174,18 @@ func (self *Birdwatcher) LookupPrefix(prefix string) (api.LookupResponse, error)
}
return response, nil
}
func (self *Birdwatcher) AllRoutes() (api.RoutesResponse, error) {
bird, err := self.client.GetJson("/routes/dump")
if err != nil {
return api.RoutesResponse{}, err
}
apiStatus, err := parseApiStatus(bird, self.config)
result := api.RoutesResponse{
Api: apiStatus,
}
return result, nil
}

View File

@ -8,5 +8,5 @@ type Source interface {
Status() (api.StatusResponse, error)
Neighbours() (api.NeighboursResponse, error)
Routes(neighbourId string) (api.RoutesResponse, error)
LookupPrefix(prefix string) (api.LookupResponse, error)
AllRoutes() (api.RoutesResponse, error)
}