Re-structure packages
Overhaul of package structure and other cleanup.
This commit is contained in:
22
controller/controller.go
Normal file
22
controller/controller.go
Normal 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)
|
||||
}
|
Reference in New Issue
Block a user