mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-17 22:57:10 +00:00
massive refactoring against json config parsing
This commit is contained in:
1 parent
f87ab4713c
commit
e5fa96f814
51 files changed
+424
-586
No files matched your search
@@ -1,16 +0,0 @@
|
||||
package json
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/v2ray/v2ray-core/common/log"
|
||||
)
|
||||
|
||||
func JsonConfigLoader(newConfig func() interface{}) func(data []byte) (interface{}, error) {
|
||||
return func(data []byte) (interface{}, error) {
|
||||
obj := newConfig()
|
||||
log.Debug("Unmarshalling JSON: %s", string(data))
|
||||
err := json.Unmarshal(data, obj)
|
||||
return obj, err
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user