ccode

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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CountryAllocationSearcher

type CountryAllocationSearcher interface {
	// DetermineCountryCode returns the AlphaTwoCountryCode for the country
	// the hex ICAO belongs to, or returns an error
	DetermineCountryCode(icao string) (*iso3166.AlphaTwoCountryCode, error)
}

CountryAllocationSearcher exposes methods for associating a HEX ICAO with a country

func LoadCountryAllocations

func LoadCountryAllocations(r io.Reader, store *iso3166.Store) (CountryAllocationSearcher, error)

LoadCountryAllocations takes a reader r containing a CSV file with country codes, and attempts to extract and register each country to store Returns the CountryAllocationSearcher if successful, otherwise an error

type RadixCountryAllocationSearcher

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

RadixCountryAllocationSearcher - Implements CountryAllocationSearcher using a radix tree to optimize searches.

func (*RadixCountryAllocationSearcher) DetermineCountryCode

func (cc *RadixCountryAllocationSearcher) DetermineCountryCode(k string) (*iso3166.AlphaTwoCountryCode, error)

DetermineCountryCode - see CountryAllocationSearcher.DetermineCountryCode

Jump to

Keyboard shortcuts

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