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 bookmarksFile = "bookmarks.json"
func init() {
func NewBookmarkService() {
createFolderStructure()
parseBookmarks()
go watchBookmarks()

View file

@ -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()
}

View file

@ -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()

View file

@ -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()