fcc

package module
v0.0.0-...-546a39e Latest Latest
Warning

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

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

README

fcc

The root fcc package provides the data structures necessary for parsing the amateur-relevant portion of the FCC license database that is provided as a 1GB+ csv file.

cmd/fcc2bolt is a console application that reads the zipfile of the FCC dump, parses it, and inserts active amateur licenses into a boltDB store.

cmd/fccdb is a console application for doing name and address lookups of FCC-issued amateur callsigns.

Installation

The fcc package can be used as-is. To download and ingest the FCC database, this software requires wget, make, and the go toolchain.

make help provides all options in the Makefile.

make will build the cmd binaries, download the FCC dataset, and perform the boltdb ingestion.

sudo make install will copy fccdb and fccd to /usr/local/bin/ and the fcc.db database to /usr/share/fccdb.

fccd

fccd listens on port 8080, and picks up a non-default DB location from the FCCDB environment variable.

Lookups against the fccd API can be made in the format: /license/<FCC CALLSIGN>

From the console: curl http://localhost:8080/license/kj6cbe

The expected result:

{ "Name": "Lehtonen, Lars A", "Address": "1727 Glendale Blvd", "City": "Los Angeles", "State": "CA", "ZIP": "90026" }

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type License

type License struct {
	LicenseID          uint32
	SourceSystem       string
	Callsign           string
	FacilityID         *uint32
	FRN                *uint64
	LicName            string
	CommonName         string
	RadioServiceCode   string
	RadioServiceDesc   string
	RollupCategoryCode string
	RollupCategoryDesc string
	GrantDate          *time.Time
	ExpiredDate        *time.Time
	CancellationDate   *time.Time
	LastActionDate     *time.Time
	LicStatusCode      string
	LicStatusDesc      string
	RollupStatusCode   string
	RollupStatusDesc   string
	EntityTypeCode     string
	EntityTypeDesc     string
	RollupEntityCode   string
	RollupEntityDesc   string
	LicAddress         string
	LicCity            string
	LicState           string
	LicZipCode         string
}

License is a struct representing fields of the FCC license database dump of interest to amateur radio operators.

func ParseLicense

func ParseLicense(line []string) (*License, error)

ParseLicense takes a license CSV parsed into a string and generates an *fcc.License{}.

func (*License) Minimal

func (l *License) Minimal() MinimalLicense

Minimal returns a MinimalLicense.

type MinimalLicense

type MinimalLicense struct {
	Name    string
	Address string
	City    string
	State   string
	ZIP     string
}

MinimalLicense is a struct that represents the subset of license data stored to database for fast lookups.

func ReadRecord

func ReadRecord(record []byte) MinimalLicense

ReadRecord reads a database record from boltdb and returns a MinimalLicense.

func (*MinimalLicense) DiskFormat

func (m *MinimalLicense) DiskFormat() []byte

DiskFormat converts a MinimalLicense to its on-disk format.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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