fea:support nexthop group for routing ha (#57)

This commit is contained in:
Teddy_Zhu
2024-04-16 14:23:08 +08:00
committed by GitHub
parent d5a0ef2904
commit c7a27a46bf
13 changed files with 664 additions and 54 deletions

13
pkg/cache/network.go vendored
View File

@@ -54,6 +54,19 @@ func (w *network) ListRoute(name string) <-chan *models.Route {
return c
}
func (w *network) UpdateRoute(name string, rt co.PrefixRoute, call func(obj *models.Route)) {
n := w.Get(name)
if n != nil {
for _, route := range n.Routes {
if route.Prefix == rt.Prefix {
call(route)
break
}
}
}
return
}
func (w *network) DelRoute(name string, rt co.PrefixRoute) {
n := w.Get(name)
if n != nil {