Skip to content
Snippets Groups Projects

Develop

Merged Ghost User requested to merge develop into master
3 files
+ 4
11
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 2
9
@@ -8,13 +8,6 @@ import (
@@ -8,13 +8,6 @@ import (
"os"
"os"
)
)
/*
#example gosdn.toml
CliSocket="localhost:55055"
DatabaseSocket="localhost:7687"
ConfigPath="./gosdn.toml"
*/
type controllerConfig struct {
type controllerConfig struct {
CliSocket string
CliSocket string
DatabaseSocket string
DatabaseSocket string
@@ -30,7 +23,7 @@ type Core struct {
@@ -30,7 +23,7 @@ type Core struct {
config controllerConfig
config controllerConfig
}
}
func (c Core) Init(socket, configfile string) {
func (c *Core) Init(socket, configfile string) {
if configfile == "" {
if configfile == "" {
configfile = "gosdn.toml"
configfile = "gosdn.toml"
}
}
@@ -53,7 +46,7 @@ func (c Core) Init(socket, configfile string) {
@@ -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)
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)
f, err := os.Create(c.config.ConfigPath)
if err != nil {
if err != nil {
log.Fatal(err)
log.Fatal(err)
Loading