mirror of
https://github.com/nadoo/glider.git
synced 2026-11-19 07:09:42 +08:00
rule: optimized codes
This commit is contained in:
1 parent
84b00d6db6
commit
04c65fb444
10 files changed
+97
-100
No files matched your search
+14
-1
@@ -9,7 +9,7 @@ import (
|
||||
"github.com/nadoo/conflag"
|
||||
)
|
||||
|
||||
// Config of rule dialer.
|
||||
// Config is config of rule.
|
||||
type Config struct {
|
||||
Name string
|
||||
|
||||
@@ -24,6 +24,19 @@ type Config struct {
|
||||
CIDR []string
|
||||
}
|
||||
|
||||
// StrategyConfig is config of strategy.
|
||||
type StrategyConfig struct {
|
||||
Strategy string
|
||||
CheckWebSite string
|
||||
CheckInterval int
|
||||
CheckTimeout int
|
||||
CheckDisabledOnly bool
|
||||
MaxFailures int
|
||||
DialTimeout int
|
||||
RelayTimeout int
|
||||
IntFace string
|
||||
}
|
||||
|
||||
// NewConfFromFile returns a new config from file.
|
||||
func NewConfFromFile(ruleFile string) (*Config, error) {
|
||||
p := &Config{Name: ruleFile}
|
||||
|
||||
Reference in new issue
Block a user