-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
42 lines (37 loc) · 961 Bytes
/
types.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
package eg8145v5
import "strings"
type UserDevice struct {
Domain string
IpAddr string
MacAddr string
Port string
PortID string
DevStatus string
IpType string
Time string
HostName string
IPv4Enabled string
IPv6Enabled string
DeviceType string
UserDevAlias string
UserSpecifiedDeviceType string
LeaseTimeRemaining string
}
func (d *UserDevice) Online() bool {
return strings.EqualFold(d.DevStatus, "online")
}
var (
ResourceUsageFuncScript = `
function resourceUsage() {
return {
Memory: Number(memUsed.slice(0, -1)),
CPU: Number(cpuUsed.slice(0, -1)),
}
}
`
ResourceUsageFuncName = "resourceUsage"
)
type ResourceUsage struct {
Memory int // Memory usage in percent (0-100)
CPU int // CPU usage in percent (0-100)
}