-
Notifications
You must be signed in to change notification settings - Fork 0
/
parameters.go
47 lines (40 loc) · 913 Bytes
/
parameters.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
package main
import (
"log"
"os"
"strconv"
)
const (
toWorkFilename = "to-work.png"
fromWorkFilename = "from-work.png"
)
type environmentParameters struct {
toWork bool
emailAddress string
emailPassword string
name string
homeLocation string
workLocation string
apiKey string
}
func parameters() environmentParameters {
toWork, err := strconv.ParseBool(os.Getenv("TOWORK"))
if err != nil {
log.Fatal(err)
}
email := os.Getenv("EMAIL_ADDRESS")
password := os.Getenv("EMAIL_PASSWORD")
username := os.Getenv("NAME")
homeLocation := os.Getenv("HOME_LOCATION")
workLocation := os.Getenv("WORK_LOCATION")
apiKey := os.Getenv("APIKEY")
return environmentParameters{
toWork: toWork,
emailAddress: email,
emailPassword: password,
name: username,
homeLocation: homeLocation,
workLocation: workLocation,
apiKey: apiKey,
}
}