diff --git a/bookmark/bookmark.go b/bookmark/bookmark.go index 86c09e25b0264b9a6897312596e7911e9fd33c4c..a602ebd2b737e0c9c3dd5db677e13d06d73ffaa5 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 3b5d4ebcf18e994b39dbe4f628cc2a88b9023605..7764039f6574b7cf9f9cde144676880e40f113e7 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 0c532ed1ca60923c913e146eecf6f2551f849413..9453a7f78a7732ba1ebcd81cb6b48a1f217c8ecc 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 00c55bf27643286418189ad08026a03769eb232e..f90da3e683f0b76df3f84db391f5772b47604483 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()