diff --git a/data/nodeinfo.go b/data/nodeinfo.go index 2b0099a..6a402a2 100644 --- a/data/nodeinfo.go +++ b/data/nodeinfo.go @@ -48,9 +48,9 @@ type System struct { // Location struct type Location struct { - Longtitude float64 `json:"longitude,omitempty"` - Latitude float64 `json:"latitude,omitempty"` - Altitude float64 `json:"altitude,omitempty"` + Longitude float64 `json:"longitude,omitempty"` + Latitude float64 `json:"latitude,omitempty"` + Altitude float64 `json:"altitude,omitempty"` } // Software struct diff --git a/output/all/filter_inarea.go b/output/all/filter_inarea.go index bcea6f4..6de44f0 100644 --- a/output/all/filter_inarea.go +++ b/output/all/filter_inarea.go @@ -31,7 +31,7 @@ func (f filterConfig) InArea() filterFunc { if location == nil { return node } - if location.Latitude >= a.latitudeMin && location.Latitude <= a.latitudeMax && location.Longtitude >= a.longitudeMin && location.Longtitude <= a.longitudeMax { + if location.Latitude >= a.latitudeMin && location.Latitude <= a.latitudeMax && location.Longitude >= a.longitudeMin && location.Longitude <= a.longitudeMax { return node } } diff --git a/output/all/filter_inarea_test.go b/output/all/filter_inarea_test.go index a9b28e3..b19bf33 100644 --- a/output/all/filter_inarea_test.go +++ b/output/all/filter_inarea_test.go @@ -21,7 +21,7 @@ func TestFilterInArea(t *testing.T) { filterLocationInArea := config.InArea() n := filterLocationInArea(&runtime.Node{Nodeinfo: &data.NodeInfo{ - Location: &data.Location{Latitude: 4.0, Longtitude: 11.0}, + Location: &data.Location{Latitude: 4.0, Longitude: 11.0}, }}) assert.NotNil(n) @@ -44,22 +44,22 @@ func TestFilterInArea(t *testing.T) { // in area n = filterLocationInArea(&runtime.Node{Nodeinfo: &data.NodeInfo{ - Location: &data.Location{Latitude: 4.0, Longtitude: 11.0}, + Location: &data.Location{Latitude: 4.0, Longitude: 11.0}, }}) assert.NotNil(n) n = filterLocationInArea(&runtime.Node{Nodeinfo: &data.NodeInfo{ - Location: &data.Location{Latitude: 4.0, Longtitude: 13.0}, + Location: &data.Location{Latitude: 4.0, Longitude: 13.0}, }}) assert.Nil(n) n = filterLocationInArea(&runtime.Node{Nodeinfo: &data.NodeInfo{ - Location: &data.Location{Latitude: 6.0, Longtitude: 11.0}, + Location: &data.Location{Latitude: 6.0, Longitude: 11.0}, }}) assert.Nil(n) n = filterLocationInArea(&runtime.Node{Nodeinfo: &data.NodeInfo{ - Location: &data.Location{Latitude: 1.0, Longtitude: 2.0}, + Location: &data.Location{Latitude: 1.0, Longitude: 2.0}, }}) assert.Nil(n) } diff --git a/output/meshviewer-ffrgb/struct.go b/output/meshviewer-ffrgb/struct.go index 290d600..b84627f 100644 --- a/output/meshviewer-ffrgb/struct.go +++ b/output/meshviewer-ffrgb/struct.go @@ -57,8 +57,8 @@ type Autoupdater struct { // Location struct type Location struct { - Longtitude float64 `json:"longitude,omitempty"` - Latitude float64 `json:"latitude,omitempty"` + Longitude float64 `json:"longitude,omitempty"` + Latitude float64 `json:"latitude,omitempty"` } // Link @@ -91,7 +91,7 @@ func NewNode(nodes *runtime.Nodes, n *runtime.Node) *Node { } if location := nodeinfo.Location; location != nil { node.Location = &Location{ - Longtitude: location.Longtitude, + Longitude: location.Longitude, Latitude: location.Latitude, } } diff --git a/output/meshviewer-ffrgb/struct_test.go b/output/meshviewer-ffrgb/struct_test.go index a95daf8..863f19f 100644 --- a/output/meshviewer-ffrgb/struct_test.go +++ b/output/meshviewer-ffrgb/struct_test.go @@ -20,7 +20,7 @@ func TestRegister(t *testing.T) { Mac: "blub", }, Location: &data.Location{ - Longtitude: 13.3, + Longitude: 13.3, Latitude: 8.7, }, }, @@ -48,7 +48,7 @@ func TestRegister(t *testing.T) { assert.NotNil(node) assert.Equal("whoami", node.Owner) assert.Equal("blub", node.MAC) - assert.Equal(13.3, node.Location.Longtitude) + assert.Equal(13.3, node.Location.Longitude) assert.Equal(8.7, node.Location.Latitude) assert.Equal(0.74, *node.MemoryUsage) } diff --git a/output/nodelist/nodelist.go b/output/nodelist/nodelist.go index 0566a75..9202d81 100644 --- a/output/nodelist/nodelist.go +++ b/output/nodelist/nodelist.go @@ -35,7 +35,7 @@ func NewNode(n *runtime.Node) (node *Node) { Name: nodeinfo.Hostname, } if location := nodeinfo.Location; location != nil { - node.Position = &Position{Lat: location.Latitude, Long: location.Longtitude} + node.Position = &Position{Lat: location.Latitude, Long: location.Longitude} } node.Status.Online = n.Online diff --git a/output/nodelist/nodelist_test.go b/output/nodelist/nodelist_test.go index c923423..e7a32f1 100644 --- a/output/nodelist/nodelist_test.go +++ b/output/nodelist/nodelist_test.go @@ -48,7 +48,7 @@ func createTestNodes() *runtime.Nodes { }, Location: &data.Location{ Latitude: 23, - Longtitude: 2, + Longitude: 2, }, }, })