-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
46 lines (33 loc) · 887 Bytes
/
main.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
// Copyright 2022 Blues Inc. All rights reserved.
// Use of this source code is governed by licenses granted by the
// copyright holder including that found in the LICENSE file.
package main
import (
"os"
"time"
)
// Directory that will be used for data
const configDataDirectoryBase = "/data/"
// Fully-resolved data directory
var configDataDirectory = ""
// Main service entry point
func main() {
// Read creds
ServiceReadConfig()
// Compute folder location
configDataDirectory = os.Getenv("HOME") + configDataDirectoryBase
_ = configDataDirectory
// Spawn the stats maintenance task
go statsMaintainer()
// Spawn the availability task
go pingWatcher()
// Spawn the console input handler
go inputHandler()
// Init our web request inbound server
go HTTPInboundHandler(":80")
// Housekeeping
for {
time.Sleep(1 * time.Minute)
canarySweepDevices()
}
}