/
main.go
51 lines (43 loc) · 852 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package main
import (
"github.com/caarlos0/env"
"github.com/dimorinny/teamcity-board/config"
"github.com/dimorinny/teamcity-board/data"
"github.com/dimorinny/teamcity-board/data/model"
"github.com/dimorinny/teamcity-board/view"
"github.com/dimorinny/teamcity-board/view/screen"
"log"
)
var (
configuration config.Config
)
func initConfig() {
configuration = config.Config{}
err := env.Parse(&configuration)
if err != nil {
log.Fatal(err)
}
}
func init() {
initConfig()
}
func main() {
context := view.NewContext(
configuration.Interval,
data.NewTeamcity(configuration),
data.NewTeamcityBrowser(configuration),
)
project := model.NewProject(
configuration.ProjectID,
)
context.Init()
defer context.Close()
context.StartScreen(
screen.NewBoardScreen(
context,
project,
),
true,
)
context.StartLoop()
}