mirror of
https://github.com/safing/portbase
synced 2025-09-01 10:09:50 +00:00
32 lines
468 B
Go
32 lines
468 B
Go
package config
|
|
|
|
import (
|
|
"os"
|
|
"path"
|
|
|
|
"github.com/Safing/portbase/database"
|
|
"github.com/Safing/portbase/modules"
|
|
)
|
|
|
|
func init() {
|
|
modules.Register("config", prep, start, stop, "database")
|
|
}
|
|
|
|
func prep() error {
|
|
return nil
|
|
}
|
|
|
|
func start() error {
|
|
configFilePath = path.Join(database.GetDatabaseRoot(), "config.json")
|
|
|
|
err := loadConfig()
|
|
if err != nil && !os.IsNotExist(err) {
|
|
return err
|
|
}
|
|
|
|
return registerAsDatabase()
|
|
}
|
|
|
|
func stop() error {
|
|
return nil
|
|
}
|