forked from arbor-dev/arbor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
security.go
40 lines (32 loc) · 861 Bytes
/
security.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
/**
* Copyright © 2017, ACM@UIUC
*
* This file is part of the Groot Project.
*
* The Groot Project is open source software, released under the University of
* Illinois/NCSA Open Source License. You should have received a copy of
* this license in a file with the distribution.
**/
package security
//Default location for access log
var AccessLogLocation string = "log/access.log"
//Default location for client db
var ClientRegistryLocation string = "clients.db"
var accessLog *accessLogger
var clientRegistry *levelDBConnector
var enabled = false
func Init() {
enabled = true
clientRegistry = newLevelDBConnector()
accessLog = newAccessLogger()
clientRegistry.open(ClientRegistryLocation)
accessLog.open(AccessLogLocation)
}
func IsEnabled() bool {
return enabled
}
func Shutdown() {
clientRegistry.close()
accessLog.close()
enabled = false
}