ソースを参照

Start bookmark-service in main

Florian Hoss 2 年 前
コミット
c53770f9c9
4 ファイル変更7 行追加5 行削除
  1. 1 1
      bookmark/bookmark.go
  2. 4 2
      main.go
  3. 1 1
      system/system.go
  4. 1 1
      weather/weather.go

+ 1 - 1
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()

+ 4 - 2
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()
 }

+ 1 - 1
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()

+ 1 - 1
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()