Initial rendering of the node tree
This commit is contained in:
commit
c5bec0afa6
7477 changed files with 8513 additions and 0 deletions
35
config.go
Normal file
35
config.go
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
// External
|
||||
"github.com/go-yaml/yaml"
|
||||
|
||||
// Standard
|
||||
"os"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
Network struct {
|
||||
Address string
|
||||
Port int
|
||||
}
|
||||
|
||||
Database struct {
|
||||
Host string
|
||||
Port int
|
||||
Db string
|
||||
Username string
|
||||
Password string
|
||||
}
|
||||
}
|
||||
|
||||
func readConfig() (err error) {
|
||||
var configData []byte
|
||||
configData, err = os.ReadFile(flagConfigFile)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = yaml.Unmarshal(configData, &config)
|
||||
return
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue