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:
parent
652193711d
commit
7cdad2d9ca
1 changed files with 5 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue