keyserver/cmd/fetch/types.go

61 lines
1.6 KiB
Go
Raw Normal View History

2024-03-10 23:16:16 +01:00
package main
type root struct {
2024-03-11 10:22:28 +01:00
Id uint `json:"id"`
Active uint `json:"active"`
Name string `json:"name"`
Lat float64 `json:"lat"`
Long float64 `json:"lon"`
Polygons [][]GeoCoordinate `json:"polygons"`
2024-03-10 23:16:16 +01:00
Hood Hood
}
2024-03-11 10:22:28 +01:00
type GeoCoordinate struct {
2024-03-10 23:16:16 +01:00
Lat float64 `json:"lat"`
Long float64 `json:"lon"`
}
type Hood struct {
2024-03-10 23:40:27 +01:00
Version uint64 `json:"version"`
Network HoodNetwork `json:"network"`
Vpn []HoodVpnEndpoint `json:"vpn"`
HoodInfo HoodInfo `json:"hood"`
2024-03-10 23:16:16 +01:00
// one coordinate: voronoi
// two coordinates: invalid
// three or more coordinates: polygon
2024-03-11 10:22:28 +01:00
Location []GeoCoordinate `json:"location,omitempty"`
2024-03-10 23:16:16 +01:00
}
type HoodNetwork struct {
UlaPrefix string `json:"ula_prefix"`
}
2024-03-10 23:40:27 +01:00
type HoodVpnEndpoint struct {
2024-03-10 23:16:16 +01:00
Name string `json:"name"`
Protocol string `json:"protocol"`
Address string `json:"address"`
Port uint16 `json:"port"`
Key string `json:"key"`
Contact string `json:"contact"`
}
type HoodInfo struct {
Id uint64 `json:"id"`
Name string `json:"name"`
Essid string `json:"essid"`
MeshBssid string `json:"mesh_bssid"`
MeshEssid string `json:"mesh_essid"`
MeshId string `json:"mesh_id"`
Protocol string `json:"protocol"`
Channel2 uint64 `json:"channel2"`
Mode2 string `json:"mode2"`
MeshType2 string `json:"mesh_type2"`
Channel5 uint64 `json:"channel5"`
Mode5 string `json:"mode5"`
MeshType5 string `json:"mesh_type5"`
UpgradePath string `json:"upgrade_path"`
NtpIp string `json:"ntp_ip"`
Timestamp uint64 `json:"timestamp"`
}