2020-05-23 17:57:49 -07:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
log "github.com/sirupsen/logrus"
|
2020-06-02 17:35:49 -07:00
|
|
|
|
2020-06-22 20:11:56 -05:00
|
|
|
"github.com/gabek/owncast/config"
|
|
|
|
"github.com/gabek/owncast/core"
|
|
|
|
"github.com/gabek/owncast/router"
|
|
|
|
)
|
2020-05-29 18:08:33 -07:00
|
|
|
|
2020-06-01 12:15:07 -07:00
|
|
|
func main() {
|
2020-06-18 13:09:54 -07:00
|
|
|
// logrus.SetReportCaller(true)
|
2020-06-22 20:11:56 -05:00
|
|
|
log.Println(core.GetVersion())
|
2020-06-11 13:33:20 -07:00
|
|
|
|
2020-06-22 20:11:56 -05:00
|
|
|
//TODO: potentially load the config from a flag like:
|
|
|
|
//configFile := flag.String("configFile", "config.yaml", "Config File full path. Defaults to current folder")
|
|
|
|
// flag.Parse()
|
2020-06-11 13:33:20 -07:00
|
|
|
|
2020-06-22 20:11:56 -05:00
|
|
|
if err := config.Load("config.yaml"); err != nil {
|
|
|
|
panic(err)
|
2020-06-02 00:27:54 -07:00
|
|
|
}
|
|
|
|
|
2020-06-22 20:11:56 -05:00
|
|
|
// starts the core
|
|
|
|
if err := core.Start(); err != nil {
|
|
|
|
log.Println("failed to start the core package")
|
|
|
|
panic(err)
|
2020-06-10 01:16:17 -07:00
|
|
|
}
|
2020-06-02 00:27:54 -07:00
|
|
|
|
2020-06-22 20:11:56 -05:00
|
|
|
if err := router.Start(); err != nil {
|
|
|
|
log.Println("failed to start/run the router")
|
|
|
|
panic(err)
|
2020-06-15 16:27:58 -07:00
|
|
|
}
|
2020-06-02 00:27:54 -07:00
|
|
|
}
|