-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.go
More file actions
44 lines (37 loc) · 773 Bytes
/
Copy pathconfig.go
File metadata and controls
44 lines (37 loc) · 773 Bytes
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
package main
import (
"github.com/BurntSushi/toml"
log "github.com/sirupsen/logrus"
)
// Config stores the values read from the TOML config
type Config struct {
Repository repository
Boards map[string]board
Database database
}
type repository struct {
Owner string
Name string
UpdateInterval uint64
BugLabels []string
SupportLabels []string
}
type board struct {
PlannedColumns []string
BlockedColumns []string
}
type database struct {
Host string
Port int
User string
Password string
DBname string
}
// A global config variable
var config Config
func loadConfig(pathToConfig string) {
if _, err := toml.DecodeFile(pathToConfig, &config); err != nil {
log.Fatal(err)
}
log.Debugf("%#v\n", config)
}