/
main.structs.go
72 lines (67 loc) · 1.9 KB
/
main.structs.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package main
import (
"github.com/cheggaaa/pb"
_ "github.com/hornbill/goApiLib"
"net"
"net/http"
"sync"
"time"
)
const (
version = "1.1.0"
applicationName = "Hornbill Email Attachment Archiver"
appName = "goEmailAttachmentArchiver"
execName = "goEmailAttachmentArchiver"
globalUltimateCutOff = 12
globalDefaultCutOff = 0
)
var (
localLogFileName = "EAA_"
espLogFileName = "EmailAttachmentArchiver"
configFileName string
configDryRun bool
configOverride bool
configDoNotStoreLocally bool
configForceDelete bool
configOutputFolder string
configCutOff int
configPageSize = 100
globalMaxRoutines int
globalAPIKeys []string
globalMailFolders []int
globalTimeNow string
globalCutOffDate string
globalAttachmentLocation = ""
importConf importConfStruct
startTime time.Time
endTime time.Duration
wg sync.WaitGroup
client = http.Client{
Transport: &http.Transport{
Dial: (&net.Dialer{
Timeout: 600 * time.Second,
KeepAlive: 30 * time.Second,
}).Dial,
TLSHandshakeTimeout: 10 * time.Second,
ResponseHeaderTimeout: 10 * time.Second,
ExpectContinueTimeout: 1 * time.Second,
MaxIdleConnsPerHost: 1,
Proxy: http.ProxyFromEnvironment,
},
//Timeout: time.Duration(120 * time.Second),
}
mutex = &sync.Mutex{}
globalArrayEmails []string
globalArrayProcessed []string
globalBarEmails *pb.ProgressBar
globalArrayBars []*pb.ProgressBar
//globalArrayLinks []*apiLib.XmlmcInstStruct
)
//----- Config Data Structs
type importConfStruct struct {
InstanceID string
APIKeys []string
AttachmentFolder string
Mailboxes []string
Folders []int
}