This repository was archived by the owner on Jan 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtypes.go
74 lines (63 loc) · 2 KB
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package devicedetector
// This types are based to js library to parse result
type DeviceDetectorOptions struct {
SkipBotDetection bool
VersionTruncation VersionTruncation
}
type VersionTruncation int
const (
VC VersionTruncation = iota
VC1
VC2
VC3
)
type DeviceDetectorResult struct {
Client ClientResult `json:"client"`
Device DeviceResult `json:"device"`
OS OperatingSystemResult `json:"os"`
Bot BotResult `json:"bot"`
}
type ClientResult struct {
Name string `json:"name"`
Version string `json:"version"`
Engine string `json:"engine"`
EngineVersion string `json:"engineVersion"`
Type string `json:"type"`
URL string `json:"url"`
}
type DeviceResult struct {
Type DeviceType `json:"type"`
Brand string `json:"brand"`
Model string `json:"model"`
}
type DeviceType string
const (
DeviceTypeDesktop DeviceType = "desktop"
DeviceTypeSmartphone DeviceType = "smartphone"
DeviceTypeTablet DeviceType = "tablet"
DeviceTypeTelevision DeviceType = "television"
DeviceTypeSmartDisplay DeviceType = "smart display"
DeviceTypeCamera DeviceType = "camera"
DeviceTypeCar DeviceType = "car"
DeviceTypeConsole DeviceType = "console"
DeviceTypePortableMediaPlayer DeviceType = "portable media player"
DeviceTypePhablet DeviceType = "phablet"
DeviceTypeWearable DeviceType = "wearable"
DeviceTypeSmartSpeaker DeviceType = "smart speaker"
DeviceTypeFeaturePhone DeviceType = "feature phone"
DeviceTypePeripheral DeviceType = "peripheral"
)
type OperatingSystemResult struct {
Name string `json:"name"`
Version string `json:"version"`
Platform string `json:"platform"`
}
type BotResult struct {
Name string `json:"name"`
Category string `json:"category"`
URL string `json:"url"`
Producer struct {
Name string `json:"name"`
URL string `json:"url"`
} `json:"producer"`
}