Meow
2026-05-03 04:40:46 +08:00
committed by GitHub
parent 8381a5a8a6
commit 958eb9ea8f
5 changed files with 173 additions and 49 deletions
+12 -4
View File
@@ -44,10 +44,11 @@ type Noise struct {
}
type FreedomFinalRuleConfig struct {
Action string `json:"action"`
Network *NetworkList `json:"network"`
Port *PortList `json:"port"`
IP *StringList `json:"ip"`
Action string `json:"action"`
Network *NetworkList `json:"network"`
Port *PortList `json:"port"`
IP *StringList `json:"ip"`
BlockDelay *Int32Range `json:"blockDelay"`
}
// Build implements Buildable
@@ -276,5 +277,12 @@ func (c *FreedomFinalRuleConfig) Build() (*freedom.FinalRuleConfig, error) {
rule.Ip = rules
}
if c.BlockDelay != nil {
rule.BlockDelay = &freedom.Range{
Min: uint64(c.BlockDelay.From),
Max: uint64(c.BlockDelay.To),
}
}
return rule, nil
}