MCPcopy Create free account
hub / github.com/NextDotID/proof_server / Init

Function Init

config/main.go:80–93  ·  view source on GitHub ↗
(configPath string)

Source from the content-addressed store, hash-verified

78)
79
80func Init(configPath string) {
81 if C.DB.Host != "" { // Initialized
82 return
83 }
84 configContent, err := ioutil.ReadFile(configPath)
85 if err != nil {
86 logrus.Fatalf("Error during opening config file! %v", err)
87 }
88
89 err = json.Unmarshal(configContent, C)
90 if err != nil {
91 logrus.Fatalf("Error duriong unmarshaling config file: %v", err)
92 }
93}
94
95func InitCliConfig() {
96 Viper = viper.New()

Callers 12

TestMainFunction · 0.92
TestMainFunction · 0.92
TestMainFunction · 0.92
mainFunction · 0.92
before_eachFunction · 0.92
before_eachFunction · 0.92
before_eachFunction · 0.92
before_eachFunction · 0.92
before_eachFunction · 0.92
before_eachFunction · 0.92
before_eachFunction · 0.92
before_eachFunction · 0.92

Calls

no outgoing calls

Tested by 11

TestMainFunction · 0.74
TestMainFunction · 0.74
TestMainFunction · 0.74
before_eachFunction · 0.74
before_eachFunction · 0.74
before_eachFunction · 0.74
before_eachFunction · 0.74
before_eachFunction · 0.74
before_eachFunction · 0.74
before_eachFunction · 0.74
before_eachFunction · 0.74