-
Notifications
You must be signed in to change notification settings - Fork 0
/
Configuratorstructs.go
65 lines (57 loc) · 1.7 KB
/
Configuratorstructs.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
package goweb
import "time"
type WebConf struct {
Name *string
}
type Config struct {
General *generic
Website *WebConf
Database *DbConf
Listener *RpcConf
Loggers *LoggersConf
EarlyDebug bool
}
type generic struct {
MonitorSleepSeconds time.Duration
DebugMainLoop bool
ServiceName string
}
type DbConf struct {
Type string
Server string
User string
Password string
DbName string
UseTLS bool
TLSSkipVerify bool
Ssl_ca string
ListenerConfID int
LoadLoggersFromDB bool
}
type RpcConf struct {
Id int
ListenIp string
ListenPort int
UseSSL bool //will only support TLS1.2 by default, not adding support for others.
SSLCrtPath string
SSLKeyPath string
CookieLifetimeSeconds int
SessionExpireSeconds int
SessionCleanerRun bool
SessionCleanerIntervalSeconds int
RpcListenerRun bool
SessionDebug bool
}
type LoggersConf struct {
Logger []*loggerConf
}
type loggerConf struct {
Id int
LogLevel string // DEBUG, INFO, etc...
Destination string
RpcLogLevel string // rpcListener has it's own log level definitions so we can switch on debug in rpc, but not in the main code
SessionDebug bool
// udp://1.2.3.4:389, tcp://logger.example.com:1234, devlog, stdout, stderr
// as such, we support syslog via tcp and udp, direct-to-file logging, /dev/log, stdout, stderr
// and array of these can be specified! This basically means we can configure more than one destination and loglevel
}