-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmega_config.go
101 lines (85 loc) · 2.5 KB
/
mega_config.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
package main
import "time"
// Megalith directory names
var (
// name of megalith workspace directory.
// relative to your $HOME directory on Unix/Linux or
// %USERPROFILE% on Windows.
// Prefix this variable with a root location to save
// megalith data in another folder.
megaWorkspace string = "megaWorkSpace"
// name of megalith log directory.
logDirectory string = "logDirectory"
)
// Name of megalith settings file.
var configName string = "settings.json"
// Run megalith in production mode.
var Production bool = false
// Interval to perform requests
// to the servers your are
// monitoring.
const Checkinterval time.Duration = 1 * time.Minute // minutes
// String formats
const (
//log file name format
logformat string = "log.%s.json"
// URL format : HOST_NAME + PATH
urlformat string = "%s%s"
// Twilio Phone format : AREA_CODE + PHONE_NUMBER
TwFormat = "%s%s"
)
//Notifier message constants
const (
DownMsg string = `Dear %s
Server %s(%s) has an uptime below %.2f%%.
Megalith`
DownSub string = "%s is down."
DownMsgk8s string = `Dear %s
Pod %s %s.
Megalith`
DownSubk8s string = "%s is using more than its compute resources."
)
// Notifier SMTP settings
const (
SMTPNoSettingsError string = "SMTP settings are not set."
SMTPMessage string = "From: %s\nTo: %s\nSubject:%s\nMIME-version: 1.0;\nContent-Type: text/plain; charset=\"UTF-8\";\n\n%s"
SMTPAddress string = "%s:%s"
)
// HTTP request constants
const (
//request considered successful if
// status code is below 300.
MaxPossibleHTTPSuccessCode int = 300
// Network error status code.
NetworkAccessErrorCode int = 900
)
// Timer constants
const BeatAt string = "Beat at "
// Browser open command
const (
DarwinOpen string = "open http://localhost:9001/index"
NTOpen string = "cmd /C start http://localhost:9001/index"
LinuxOpen string = "xdg-open http://localhost:9001/index"
)
// Misc constants
const (
NewLine string = "\n"
HeaderSeparator string = ":"
EmptyString string = ""
ContentJson string = "application/json"
DayInSeconds int64 = 86400
Zero int = 0
PORT string = "PORT"
DefaultAddress string = "http://127.0.0.1:9001"
LockExt string = ".lock"
DefaultPort string = "9001"
)
// Misc variables
var (
OK = []byte("OK")
)
// Headers to use during instance communication
// Intended to be used to provide authentication information
// To access megalith worker cluster/server.
// ie : Content-Type: value\nX-Header: value\n
var AuthorizeHeader string