1
0
Fork 0
mirror of https://github.com/alice-lg/birdwatcher.git synced 2025-03-09 00:00:05 +01:00
birdwatcher/endpoints/symbols.go

23 lines
581 B
Go
Raw Permalink Normal View History

2016-11-11 14:14:38 +01:00
package endpoints
import (
"net/http"
2016-11-11 15:33:08 +01:00
"github.com/ecix/birdwatcher/bird"
2016-11-11 14:14:38 +01:00
"github.com/julienschmidt/httprouter"
)
func Symbols(r *http.Request, ps httprouter.Params) (bird.Parsed, bool) {
2016-11-11 14:14:38 +01:00
return bird.Symbols()
}
func SymbolTables(r *http.Request, ps httprouter.Params) (bird.Parsed, bool) {
2016-11-11 17:47:51 +01:00
val, from_cache := bird.Symbols()
2016-11-11 17:33:33 +01:00
return bird.Parsed{"symbols": val["routing table"]}, from_cache
2016-11-11 14:14:38 +01:00
}
func SymbolProtocols(r *http.Request, ps httprouter.Params) (bird.Parsed, bool) {
2016-11-11 17:47:51 +01:00
val, from_cache := bird.Symbols()
2016-11-11 17:33:33 +01:00
return bird.Parsed{"symbols": val["protocols"]}, from_cache
2016-11-11 14:14:38 +01:00
}