Hide transitive fields from API responses in Website and Device structs
This commit is contained in:
parent
3442864fbe
commit
4ac47429cd
@ -16,7 +16,7 @@ const websitesFile = "websites.json"
|
|||||||
type Website struct {
|
type Website struct {
|
||||||
URL string `json:"url"`
|
URL string `json:"url"`
|
||||||
Icon string `json:"icon"`
|
Icon string `json:"icon"`
|
||||||
Status int `json:"status"`
|
Status int `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func RunProbe() []Website {
|
func RunProbe() []Website {
|
||||||
|
|||||||
@ -15,10 +15,10 @@ const deviceFile = "devices.json"
|
|||||||
|
|
||||||
type Device struct {
|
type Device struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
IP string `json:"ip"`
|
IP string `json:"-"`
|
||||||
Interface string `json:"interface"`
|
Interface string `json:"-"`
|
||||||
Icon string `json:"icon"`
|
Icon string `json:"icon"`
|
||||||
Online bool `json:"online"`
|
Online bool `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetDevices() map[string]Device {
|
func GetDevices() map[string]Device {
|
||||||
|
|||||||
@ -1,9 +1,6 @@
|
|||||||
{
|
{
|
||||||
"00:00:00:00:00:00": {
|
"00:00:00:00:00:00": {
|
||||||
"name": "Sample Device",
|
"name": "Sample Device",
|
||||||
"ip": "192.168.1.10",
|
"icon": ""
|
||||||
"interface": "",
|
|
||||||
"icon": "",
|
|
||||||
"online": false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user