Start bookmark-service in main

This commit is contained in:
Florian Hoss 2022-10-27 18:43:33 +02:00
parent b3bf334bae
commit c53770f9c9
4 changed files with 7 additions and 5 deletions

View file

@ -17,7 +17,7 @@ const StorageDir = "storage/"
const IconsDir = StorageDir + "icons/" const IconsDir = StorageDir + "icons/"
const bookmarksFile = "bookmarks.json" const bookmarksFile = "bookmarks.json"
func init() { func NewBookmarkService() {
createFolderStructure() createFolderStructure()
parseBookmarks() parseBookmarks()
go watchBookmarks() go watchBookmarks()

View file

@ -1,6 +1,7 @@
package main package main
import ( import (
"godash/bookmark"
"godash/logging" "godash/logging"
"godash/server" "godash/server"
"godash/system" "godash/system"
@ -9,7 +10,8 @@ import (
func main() { func main() {
logging.NewGlobalLogger() logging.NewGlobalLogger()
weather.NewWeather() weather.NewWeatherService()
system.NewSystem() system.NewSystemService()
bookmark.NewBookmarkService()
server.NewServer() server.NewServer()
} }

View file

@ -10,7 +10,7 @@ import (
var Config = SystemConfig{} var Config = SystemConfig{}
var Sys = System{} var Sys = System{}
func NewSystem() { func NewSystemService() {
config.ParseViperConfig(&Config, config.AddViperConfig("system")) config.ParseViperConfig(&Config, config.AddViperConfig("system"))
if Config.LiveSystem { if Config.LiveSystem {
Sys.Initialize() Sys.Initialize()

View file

@ -14,7 +14,7 @@ import (
var Conf = Config{} var Conf = Config{}
var CurrentWeather = Weather{} var CurrentWeather = Weather{}
func NewWeather() { func NewWeatherService() {
config.ParseViperConfig(&Conf, config.AddViperConfig("weather")) config.ParseViperConfig(&Conf, config.AddViperConfig("weather"))
if Conf.OpenWeather.Key != "" { if Conf.OpenWeather.Key != "" {
setWeatherUnits() setWeatherUnits()