Redo route code (#2422)
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
parent
16868190c8
commit
7891378f57
53 changed files with 2977 additions and 6251 deletions
|
@ -74,3 +74,21 @@ func TailMapResponseToString(resp tailcfg.MapResponse) string {
|
|||
TailNodesToString(resp.Peers),
|
||||
)
|
||||
}
|
||||
|
||||
func TailcfgFilterRulesToString(rules []tailcfg.FilterRule) string {
|
||||
var sb strings.Builder
|
||||
|
||||
for index, rule := range rules {
|
||||
sb.WriteString(fmt.Sprintf(`
|
||||
{
|
||||
SrcIPs: %v
|
||||
DstIPs: %v
|
||||
}
|
||||
`, rule.SrcIPs, rule.DstPorts))
|
||||
if index < len(rules)-1 {
|
||||
sb.WriteString(", ")
|
||||
}
|
||||
}
|
||||
|
||||
return fmt.Sprintf("[ %s ](%d)", sb.String(), len(rules))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue