tar1090

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 16, 2020 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

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

func NewHistory(maxHistory int) *History

NewHistory returns a History initialized to store maxHistory files per project.

func (*History) GetHistoryCount

func (h *History) GetHistoryCount(project string) (int, error)

GetHistoryCount returns the number of history files the project currently has, or returns an error if the project is unknown.

func (*History) GetHistoryFile

func (h *History) GetHistoryFile(project string, n int64) ([]byte, error)

GetHistoryFile returns n'th history file for project, or returns an error if the project is unknown or the history file is invalid.

func (*History) SaveAircraftFile

func (h *History) SaveAircraftFile(project string, data []byte) error

SaveAircraftFile takes a new history data and adds it to the projects history.

type Map

type Map struct {
	// contains filtered or unexported fields
}

Map - provides the tar1090 map. Implements MapService.

func NewTar1090Map

func NewTar1090Map(ma tracker.MapAccess, maxHistory int) *Map

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

func (t *Map) MapService() string

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

func (t *Map) RegisterRoutes(r *mux.Router) error

RegisterRoutes registers handler functions for tar1090 routes on r.

func (*Map) UpdateHistory

func (t *Map) UpdateHistory(projNames []string) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL