Improve core module to take care of dir structures and db init

This commit is contained in:
Daniel
2019-07-31 22:34:23 +02:00
parent 82026cd7d9
commit 7a6189143c
5 changed files with 169 additions and 10 deletions

View File

@@ -2,21 +2,12 @@ package core
import (
"github.com/safing/portbase/database"
"github.com/safing/portbase/modules"
"github.com/safing/portbase/notifications"
// module dependencies
_ "github.com/safing/portbase/database/dbmodule"
_ "github.com/safing/portbase/database/storage/bbolt"
)
func init() {
modules.Register("core", nil, start, nil, "database")
notifications.SetPersistenceBasePath("core:notifications")
}
func start() error {
func registerDatabases() error {
_, err := database.Register(&database.Database{
Name: "core",
Description: "Holds core data, such as settings and profiles",