diff --git a/gosdn.toml b/gosdn.toml index 3c16579ad09332844408a17188184d921a51e0fa..38bf79e214017af9635c8015c019a6db0b59ce4b 100644 --- a/gosdn.toml +++ b/gosdn.toml @@ -1,4 +1,4 @@ #example gosdn.toml CliSocket="localhost:55055" -DatabaseSocket="localhost:7687" +DatabaseSocket="bolt://localhost:7687" ConfigPath="./gosdn.toml" \ No newline at end of file diff --git a/main.go b/main.go index 712ed2f3098c261ea2acc8f10c11535f6c4bf498..66836589d998071df74049e746168c5c39424027 100644 --- a/main.go +++ b/main.go @@ -13,7 +13,7 @@ func main() { configFileName := flag.String("config-file", "", "Path to the config file") flag.Parse() - cliSocket := *cliListenAddr + *cliListenPort + cliSocket := *cliListenAddr + ":" + *cliListenPort // hand off to cmd for further processing nucleus.StartUp(cliSocket, *configFileName) diff --git a/nucleus/controller.go b/nucleus/controller.go index 306e268999363e12c8169388f1d8656d47aef22e..fb36ba54c1423bfacc8c5946d839006939e0a49a 100644 --- a/nucleus/controller.go +++ b/nucleus/controller.go @@ -8,13 +8,6 @@ import ( "os" ) -/* -#example gosdn.toml -CliSocket="localhost:55055" -DatabaseSocket="localhost:7687" -ConfigPath="./gosdn.toml" -*/ - type controllerConfig struct { CliSocket string DatabaseSocket string @@ -30,7 +23,7 @@ type Core struct { config controllerConfig } -func (c Core) Init(socket, configfile string) { +func (c *Core) Init(socket, configfile string) { if configfile == "" { configfile = "gosdn.toml" } @@ -53,7 +46,7 @@ func (c Core) Init(socket, configfile string) { c.database = database.NewDatabaseClient(c.config.DatabaseSocket, c.config.DatabaseUser, c.config.DatabasePassword, c.config.DatabaseCrypto) } -func (c Core) Shutdown() { +func (c *Core) Shutdown() { f, err := os.Create(c.config.ConfigPath) if err != nil { log.Fatal(err)