|
|
|
@@ -35,12 +35,6 @@ type BeaconMetric struct { |
|
|
|
Timestamp int64 |
|
|
|
} |
|
|
|
|
|
|
|
// Location defines a physical location and synchronization control. |
|
|
|
type Location struct { |
|
|
|
Name string |
|
|
|
Lock sync.RWMutex |
|
|
|
} |
|
|
|
|
|
|
|
// HTTPLocation describes a beacon's state as served over HTTP. |
|
|
|
type HTTPLocation struct { |
|
|
|
Method string `json:"method"` |
|
|
|
@@ -51,17 +45,6 @@ type HTTPLocation struct { |
|
|
|
LastSeen int64 `json:"last_seen"` |
|
|
|
} |
|
|
|
|
|
|
|
// LocationChange defines a change event for a beacon's detected location. |
|
|
|
type LocationChange struct { |
|
|
|
Method string `json:"method"` |
|
|
|
BeaconRef Beacon `json:"beacon_info"` |
|
|
|
Name string `json:"name"` |
|
|
|
BeaconName string `json:"beacon_name"` |
|
|
|
PreviousLocation string `json:"previous_location"` |
|
|
|
NewLocation string `json:"new_location"` |
|
|
|
Timestamp int64 `json:"timestamp"` |
|
|
|
} |
|
|
|
|
|
|
|
// Beacon holds all relevant information about a tracked beacon device. |
|
|
|
type Beacon struct { |
|
|
|
Name string `json:"name"` |
|
|
|
@@ -136,12 +119,6 @@ type BeaconEventList struct { |
|
|
|
Lock sync.RWMutex |
|
|
|
} |
|
|
|
|
|
|
|
// LocationsList holds all known locations with concurrency protection. |
|
|
|
type LocationsList struct { |
|
|
|
Locations map[string]Location |
|
|
|
Lock sync.RWMutex |
|
|
|
} |
|
|
|
|
|
|
|
// RawReading represents an incoming raw sensor reading. |
|
|
|
type RawReading struct { |
|
|
|
Timestamp string `json:"timestamp"` |
|
|
|
@@ -151,11 +128,6 @@ type RawReading struct { |
|
|
|
RawData string `json:"rawData"` |
|
|
|
} |
|
|
|
|
|
|
|
type LatestBeaconsList struct { |
|
|
|
LatestList map[string]Beacon |
|
|
|
Lock sync.RWMutex |
|
|
|
} |
|
|
|
|
|
|
|
type ApiUpdate struct { |
|
|
|
Method string |
|
|
|
ID string |
|
|
|
|