feat(config): enhance NodeConfig with TrafficReportThreshold, IPStrategy, DNS, Block, and Outbound fields

This commit is contained in:
Chang lue Tsen
2025-09-28 19:05:54 +09:00
parent 64f0bcc55a
commit 0d1df5f905
14 changed files with 395 additions and 115 deletions
+11
View File
@@ -1,6 +1,7 @@
package tool
import (
"encoding/json"
"fmt"
"reflect"
"strconv"
@@ -26,6 +27,16 @@ func ConvertValueToString(value reflect.Value) string {
default:
return ""
}
case reflect.Struct, reflect.Map, reflect.Slice, reflect.Array:
bytes, err := json.Marshal(value.Interface())
if err != nil {
fmt.Println("Error marshaling struct:", err.Error())
return ""
}
if string(bytes) == "null" {
return ""
}
return string(bytes)
default:
return ""
}