diff --git a/bookmark/bookmark.go b/bookmark/bookmark.go index 86c09e2..a602ebd 100644 --- a/bookmark/bookmark.go +++ b/bookmark/bookmark.go @@ -17,7 +17,7 @@ const StorageDir = "storage/" const IconsDir = StorageDir + "icons/" const bookmarksFile = "bookmarks.json" -func init() { +func NewBookmarkService() { createFolderStructure() parseBookmarks() go watchBookmarks() diff --git a/main.go b/main.go index 3b5d4eb..7764039 100644 --- a/main.go +++ b/main.go @@ -1,6 +1,7 @@ package main import ( + "godash/bookmark" "godash/logging" "godash/server" "godash/system" @@ -9,7 +10,8 @@ import ( func main() { logging.NewGlobalLogger() - weather.NewWeather() - system.NewSystem() + weather.NewWeatherService() + system.NewSystemService() + bookmark.NewBookmarkService() server.NewServer() } diff --git a/system/system.go b/system/system.go index 0c532ed..9453a7f 100644 --- a/system/system.go +++ b/system/system.go @@ -10,7 +10,7 @@ import ( var Config = SystemConfig{} var Sys = System{} -func NewSystem() { +func NewSystemService() { config.ParseViperConfig(&Config, config.AddViperConfig("system")) if Config.LiveSystem { Sys.Initialize() diff --git a/weather/weather.go b/weather/weather.go index 00c55bf..f90da3e 100644 --- a/weather/weather.go +++ b/weather/weather.go @@ -14,7 +14,7 @@ import ( var Conf = Config{} var CurrentWeather = Weather{} -func NewWeather() { +func NewWeatherService() { config.ParseViperConfig(&Conf, config.AddViperConfig("weather")) if Conf.OpenWeather.Key != "" { setWeatherUnits()