feat: Add traffic-editor plugin (#2825)

This commit is contained in:
Kent Dong
2025-12-26 17:29:55 +08:00
committed by jingze
parent 7c7205b572
commit 95ff52cde9
18 changed files with 3026 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
package main
import "strings"
func headerSlice2Map(headerSlice [][2]string) map[string][]string {
headerMap := make(map[string][]string)
for _, header := range headerSlice {
k, v := strings.ToLower(header[0]), header[1]
headerMap[k] = append(headerMap[k], v)
}
return headerMap
}
func headerMap2Slice(headerMap map[string][]string) [][2]string {
headerSlice := make([][2]string, 0, len(headerMap))
for k, vs := range headerMap {
for _, v := range vs {
headerSlice = append(headerSlice, [2]string{k, v})
}
}
return headerSlice
}