-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.go
40 lines (35 loc) · 971 Bytes
/
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
package agent
import (
"errors"
"sync/atomic"
"time"
"github.com/nats-io/nats.go"
)
const (
defaultWGPort = 51820
maxNetworks = 100
defaultKeepalive = time.Second * 20
NatsTimeout = time.Second * 5
NatsLongTimeout = time.Second * 15
checkinTime = time.Minute * 1
serverCheckTime = time.Minute * 3
connectivityTimeout = time.Minute * 3
endpointServerTimeout = time.Second * 30
networkNotMapped = "network not mapped to server"
version = "v0.2.1"
networkTable = "networks"
deviceTable = "devices"
path = "/var/lib/plexus/"
)
var (
Config Configuration
serverConn atomic.Pointer[nats.EncodedConn]
subscriptions []*nats.Subscription
//errors
ErrNetNotMapped = errors.New("network not mapped to server")
ErrNotConnected = errors.New("not connected to server")
)
type Configuration struct {
NatsPort int
Verbosity string
}