fix: update mapsturcture decode and remove unused config (#396)
Signed-off-by: Jim Ma <majinjing3@gmail.com>
This commit is contained in:
parent
5721554396
commit
35ff8da689
|
|
@ -4,13 +4,6 @@ aliveTime: 0s
|
||||||
# daemon gc task running interval
|
# daemon gc task running interval
|
||||||
gcInterval: 1m0s
|
gcInterval: 1m0s
|
||||||
|
|
||||||
# daemon pid location
|
|
||||||
pid_file: /var/run/dfdaemon.pid
|
|
||||||
|
|
||||||
# daemon lock file location
|
|
||||||
# some lock file will only allow to run one daemon service
|
|
||||||
lock_file: /var/run/dfdaemon.lock
|
|
||||||
|
|
||||||
# daemon data directory
|
# daemon data directory
|
||||||
dataDir: /home/t4/dragonfly/
|
dataDir: /home/t4/dragonfly/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -231,14 +231,14 @@ func (p *ProxyOption) UnmarshalYAML(node *yaml.Node) error {
|
||||||
|
|
||||||
func (p *ProxyOption) unmarshal(unmarshal func(in []byte, out interface{}) (err error), b []byte) error {
|
func (p *ProxyOption) unmarshal(unmarshal func(in []byte, out interface{}) (err error), b []byte) error {
|
||||||
pt := struct {
|
pt := struct {
|
||||||
ListenOption `yaml:",inline"`
|
ListenOption `mapstructure:",squash" yaml:",inline"`
|
||||||
DefaultFilter string `json:"defaultFilter" yaml:"defaultFilter"`
|
BasicAuth *BasicAuth `mapstructure:"basicAuth" yaml:"basicAuth"`
|
||||||
MaxConcurrency int64 `json:"maxConcurrency" yaml:"maxConcurrency"`
|
DefaultFilter string `mapstructure:"defaultFilter" yaml:"defaultFilter"`
|
||||||
RegistryMirror *RegistryMirror `json:"registryMirror" yaml:"registryMirror"`
|
MaxConcurrency int64 `mapstructure:"maxConcurrency" yaml:"maxConcurrency"`
|
||||||
Proxies []*Proxy `json:"proxies" yaml:"proxies"`
|
RegistryMirror *RegistryMirror `mapstructure:"registryMirror" yaml:"registryMirror"`
|
||||||
HijackHTTPS *HijackConfig `json:"hijackHTTPS" yaml:"hijackHTTPS"`
|
WhiteList []*WhiteList `mapstructure:"whiteList" yaml:"whiteList"`
|
||||||
WhiteList []*WhiteList `json:"whiteList" yaml:"whiteList"`
|
Proxies []*Proxy `mapstructure:"proxies" yaml:"proxies"`
|
||||||
BasicAuth *BasicAuth `json:"basicAuth" yaml:"basicAuth"`
|
HijackHTTPS *HijackConfig `mapstructure:"hijackHTTPS" yaml:"hijackHTTPS"`
|
||||||
}{}
|
}{}
|
||||||
|
|
||||||
if err := unmarshal(b, &pt); err != nil {
|
if err := unmarshal(b, &pt); err != nil {
|
||||||
|
|
|
||||||
|
|
@ -361,5 +361,4 @@ func TestPeerHostOption_Load(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
assert.EqualValues(peerHostOption, peerHostOptionYAML)
|
assert.EqualValues(peerHostOption, peerHostOptionYAML)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
aliveTime: 0s
|
aliveTime: 0s
|
||||||
gcInterval: 1m0s
|
gcInterval: 1m0s
|
||||||
pid_file: /tmp/dfdaemon.pid
|
|
||||||
lock_file: /tmp/dfdaemon.lock
|
|
||||||
dataDir: /tmp/dragonfly/dfdaemon/
|
dataDir: /tmp/dragonfly/dfdaemon/
|
||||||
workHome: /tmp/dragonfly/dfdaemon/
|
workHome: /tmp/dragonfly/dfdaemon/
|
||||||
keepStorage: false
|
keepStorage: false
|
||||||
|
|
|
||||||
|
|
@ -195,7 +195,7 @@ func initDecoderConfig(dc *mapstructure.DecoderConfig) {
|
||||||
reflect.TypeOf(dfnet.NetAddr{}),
|
reflect.TypeOf(dfnet.NetAddr{}),
|
||||||
reflect.TypeOf(clientutil.RateLimit{}),
|
reflect.TypeOf(clientutil.RateLimit{}),
|
||||||
reflect.TypeOf(clientutil.Duration{}),
|
reflect.TypeOf(clientutil.Duration{}),
|
||||||
reflect.TypeOf(config.ProxyOption{}),
|
reflect.TypeOf(&config.ProxyOption{}),
|
||||||
reflect.TypeOf(config.TCPListenPortRange{}),
|
reflect.TypeOf(config.TCPListenPortRange{}),
|
||||||
reflect.TypeOf(config.FileString("")),
|
reflect.TypeOf(config.FileString("")),
|
||||||
reflect.TypeOf(config.URL{}),
|
reflect.TypeOf(config.URL{}),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue