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

added proto counts to validated methods

This commit is contained in:
hellerve 2016-12-06 14:44:18 +01:00
parent 652193711d
commit 7cdad2d9ca

View file

@ -20,7 +20,11 @@ func TableRoutes(ps httprouter.Params) (bird.Parsed, bool) {
}
func ProtoCount(ps httprouter.Params) (bird.Parsed, bool) {
return bird.RoutesProtoCount(ps.ByName("protocol"))
protocol, err := ValidateProtocolParam(ps.ByName("protocol"))
if err != nil {
return bird.Parsed{"error": fmt.Sprintf("%s", err)}, false
}
return bird.RoutesProtoCount(protocol)
}
func TableCount(ps httprouter.Params) (bird.Parsed, bool) {