mirror of
https://github.com/luscis/openlan.git
synced 2025-10-05 16:47:11 +08:00
fea:support nexthop group for routing ha (#57)
This commit is contained in:
13
pkg/cache/network.go
vendored
13
pkg/cache/network.go
vendored
@@ -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 {
|
||||
|
Reference in New Issue
Block a user