data

package
v0.0.0-...-ab5289d Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DAO

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

func New

func New(db *sqlx.DB) *DAO

func (*DAO) GetFlight

func (d *DAO) GetFlight(id int) (Flight, error)

func (*DAO) GetFlightsActive

func (d *DAO) GetFlightsActive() ([]Flight, error)

func (*DAO) GetFlightsForAirframe

func (d *DAO) GetFlightsForAirframe(icao string) ([]Flight, error)

func (*DAO) GetFlightsForDateRange

func (d *DAO) GetFlightsForDateRange(start, end time.Time) ([]Flight, error)

func (*DAO) GetRegistration

func (d *DAO) GetRegistration(icao string) (Registration, error)

func (*DAO) GetTableSizes

func (d *DAO) GetTableSizes() ([]TableSize, error)

func (*DAO) GetTrackLog

func (d *DAO) GetTrackLog(flightID int) ([]TrackLog, error)

func (*DAO) SearchRegistration

func (d *DAO) SearchRegistration(query string) (string, error)

SearchRegistration searches for the given registration (query) and, if found, returns the ICAO ID of the registration record. If not found, returns empty string. Error is non-nil only for database errors, NOT for no record found.

type Flight

type Flight struct {
	ID             int            `db:"id"`
	Icao           string         `db:"icao"`
	Callsign       sql.NullString `db:"callsign"`
	FirstSeen      time.Time      `db:"first_seen"`
	LastSeen       pq.NullTime    `db:"last_seen"`
	MsgCount       sql.NullInt64  `db:"msg_count"`
	Registration   sql.NullString
	Owner          sql.NullString
	Airline        sql.NullString `db:"airline"`
	TypeCode       sql.NullString `db:"typecode"`
	MfgYear        sql.NullInt64  `db:"year"`
	Mfg            sql.NullString
	Model          sql.NullString
	Icon           string
	IconX          int
	IconY          int
	Category       sql.NullInt64 `db:"category"`
	CategoryString string
}

type Registration

type Registration struct {
	Icao, Source string
	Registration sql.NullString
	Typecode     sql.NullString
	Mfg          sql.NullString
	Model        sql.NullString
	Owner        sql.NullString
	City         sql.NullString
	State        sql.NullString
	Country      sql.NullString
	Year         sql.NullInt64
}

type TableSize

type TableSize struct {
	TableName  string `db:"table_name"`
	SizeTable  string `db:"table_size"`
	SizeIndex  string `db:"indexes_size"`
	SizeTotal  string `db:"total_size"`
	ApproxRows int64  `db:"rowcount"`
}

type TrackLog

type TrackLog struct {
	ID                           int `db:"id"`
	Time                         time.Time
	Latitude, Longitude          sql.NullFloat64
	Heading, Speed, Altitude, Vs sql.NullInt64
	Callsign                     sql.NullString
}

Jump to

Keyboard shortcuts

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