Files
EdgeCommon/pkg/serverconfigs/firewallconfigs/http_firewall_checkpoints_test.go

31 lines
869 B
Go
Raw Permalink Normal View History

2024-07-27 13:29:26 +08:00
// Copyright 2022 GoEdge CDN goedge.cdn@gmail.com. All rights reserved. Official site: https://goedge.cloud .
2023-01-13 19:36:10 +08:00
package firewallconfigs_test
import (
"fmt"
"strings"
"testing"
2024-07-27 13:29:26 +08:00
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/firewallconfigs"
2023-01-13 19:36:10 +08:00
)
func TestRuleCheckpoint_Markdown(t *testing.T) {
var result = []string{}
for _, def := range firewallconfigs.AllCheckpoints {
def.Description = strings.ReplaceAll(def.Description, "<code-label>", "`")
def.Description = strings.ReplaceAll(def.Description, "</code-label>", "`")
var row = "## " + def.Name + "\n"
row += "* 名称:" + def.Name + "\n"
row += "* 代号:`${" + def.Prefix + "}`\n"
row += "* 描述:" + def.Description + "\n"
2023-12-24 10:03:01 +08:00
if len(def.Version) > 0 {
row += "* 版本v" + def.Version + "\n"
}
2023-01-13 19:36:10 +08:00
result = append(result, row)
}
fmt.Print(strings.Join(result, "\n") + "\n")
}