aircraft

package
v0.0.0-...-9524c35 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Directory  string `yaml:"directory"`
	BoltDbFile string `yaml:"db_file"`
	URL        string `yaml:"url"`
}

func (*Config) RegisterFlags

func (c *Config) RegisterFlags(f *flag.FlagSet)

type CsvParser

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

CsvParser is built to parse the CSV file at github.com/wiedehopf/tar1090-db/raw/csv/aircraft.csv.gz It's also built to do this while minimizing allocations and as such does some risky slice->string conversions The custome CsvParser was built to work around the non-standard CSV format created by this python spamwriter = csv.writer(csvfile,

delimiter=';', escapechar='\\',
quoting=csv.QUOTE_NONE, quotechar=None,
lineterminator='\n')

Which is semicolon delimited, no header, non quoted and uses backslashes to escape There currently aren't any lines in the file that use the escape char so I'm not 100% sure the code here handles that correctly.

func NewCsvParser

func NewCsvParser(r io.Reader) *CsvParser

func (*CsvParser) Details

func (j *CsvParser) Details() (string, *model.Details)

Details returns a pointer to the current details NOTE everything about the returned object is UNSAFE it is intended that this object be serialized to a string immediately before calling Next()

func (*CsvParser) Next

func (j *CsvParser) Next() bool

type Manager

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

func NewAircraftManager

func NewAircraftManager(logger log.Logger, config Config) (*Manager, error)

func (*Manager) Lookup

func (m *Manager) Lookup(hex string) *model.Details

func (*Manager) Run

func (m *Manager) Run()

func (*Manager) Stop

func (m *Manager) Stop()

Jump to

Keyboard shortcuts

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