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

23
pkg/config/nextgroup.go Normal file
View File

@@ -0,0 +1,23 @@
package config
type NextGroup struct {
Check string `json:"check"`
Ping PingParams `json:"ping"`
Mode string `json:"mode,omitempty"`
NextHop []string `json:"nexthop"`
AvailableNextHop []MultiPath `json:"availableNexthop,omitempty"`
}
func (ng *NextGroup) Correct() {
if ng.AvailableNextHop == nil {
ng.AvailableNextHop = []MultiPath{}
}
}
type PingParams struct {
Count int `json:"count"`
Loss int `json:"loss,omitempty"`
Rtt int `json:"rtt,omitempty"`
CheckFrequency int `json:"checkFrequency,omitempty"`
}