Re-structure packages

Overhaul of package structure and other cleanup.
This commit is contained in:
Dave Gallant
2020-04-03 22:29:12 -04:00
parent 025b68de93
commit 49ea48976d
9 changed files with 87 additions and 71 deletions

22
controller/controller.go Normal file
View File

@@ -0,0 +1,22 @@
package controller
import (
"time"
config "github.com/davegallant/srv/config"
feeds "github.com/davegallant/srv/feeds"
)
// Controller keeps everything together
type Controller struct {
Config config.Configuration
lastUpdate time.Time
Rss *feeds.RSS
}
// Init initiates the controller with config
func (c *Controller) Init(conf string) {
c.Config = config.LoadConfiguration(conf)
c.Rss = &feeds.RSS{}
c.Rss.Update(c.Config.Feeds)
}