Documentation ¶
Index ¶
- type History
- type Map
- func (t *Map) AircraftJSONHandler(w http.ResponseWriter, r *http.Request)
- func (t *Map) HistoryJSONHandler(w http.ResponseWriter, r *http.Request)
- func (t *Map) MapService() string
- func (t *Map) ReceiverJSONHandler(w http.ResponseWriter, r *http.Request)
- func (t *Map) RegisterRoutes(r *mux.Router) error
- func (t *Map) UpdateHistory(projNames []string) error
- type ProjectHistory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type History ¶
type History struct {
// contains filtered or unexported fields
}
History contains ProjectHistory structures for all projects
func NewHistory ¶
NewHistory returns a History initialized to store maxHistory files per project.
func (*History) GetHistoryCount ¶
GetHistoryCount returns the number of history files the project currently has, or returns an error if the project is unknown.
func (*History) GetHistoryFile ¶
GetHistoryFile returns n'th history file for project, or returns an error if the project is unknown or the history file is invalid.
type Map ¶
type Map struct {
// contains filtered or unexported fields
}
Map - provides the tar1090 map. Implements MapService.
func NewTar1090Map ¶
NewTar1090Map returns a new Map.
func (*Map) AircraftJSONHandler ¶
func (t *Map) AircraftJSONHandler(w http.ResponseWriter, r *http.Request)
AircraftJSONHandler implements the HTTP handler for aircraft.json
func (*Map) HistoryJSONHandler ¶
func (t *Map) HistoryJSONHandler(w http.ResponseWriter, r *http.Request)
HistoryJSONHandler implements the HTTP handler for history_%n.json
func (*Map) MapService ¶
MapService returns the name of the map service. See MapService.MapService.
func (*Map) ReceiverJSONHandler ¶
func (t *Map) ReceiverJSONHandler(w http.ResponseWriter, r *http.Request)
ReceiverJSONHandler implements the HTTP handler for receiver.json
func (*Map) RegisterRoutes ¶
RegisterRoutes registers handler functions for tar1090 routes on r.
func (*Map) UpdateHistory ¶
UpdateHistory generates a new history file for each project in projNames. See MapService.UpdateHistory.
type ProjectHistory ¶
type ProjectHistory struct {
// contains filtered or unexported fields
}
ProjectHistory contains an in-memory store of history files for a particular project.
func (*ProjectHistory) AddNextFile ¶
func (ph *ProjectHistory) AddNextFile(maxHistory int, data []byte) error
AddNextFile takes a new history data and adds it to the store.