ADIF 3.1.5 Specification Library for Go
![License](https://img.shields.io/github/license/hamradiolog-net/adif-spec)
Overview
This repository contains the ADIF specification for Go.
It is generated from the export published by the ADIF Workgroup
Using The Library
- Import any of the packages in the
src/pkg
directory that you wish to use.
- Each package has constants related to the ADIF specification.
- They use init() to create three package level variables with the following suffixes:
- *.
Map
Suffix - A map of the ADIF specification for quick lookups.
- *.
List
Suffix - A list of values that are current.
- *.
ListAll
Suffix - A list of all values, including deprecated ones.
For example, to lookup information about a band, we can use the band
package (Run in Go Playground):
package main
import (
"fmt"
"github.com/hamradiolog-net/adif-spec/src/pkg/enum/band"
)
func main() {
forty := band.EnumBandMap[band.Band40m]
fmt.Printf("The 40m band is between %f and %f MHz\n", forty.LowerFreqMHz, forty.UpperFreqMHz)
fmt.Println("Current Bands")
for _, band := range band.EnumBandList {
fmt.Printf("%s: %f - %f\n", band.ID, band.LowerFreqMHz, band.UpperFreqMHz)
}
fmt.Println("All Bands Including Import-Only and Unreleased (usually this is the same as EnumBandList)")
for _, band := range band.EnumBandListAll {
fmt.Printf("%s: %f - %f\n", band.ID, band.LowerFreqMHz, band.UpperFreqMHz)
}
}
Maintenance
The following steps are required to update the specification to the latest version.
-
Download the latest ADIF TSV file exports from the ADIF Workgroup. The current ADIF 3.1.5 spec is kept in the src/spec/315
directory of this repository. You should rename the folder to match the new ADIF version number.
-
Update cmd/specgen/main.go
and related code to use the new TSV folder.
-
Add code for any new enumerations to the src/pkg folder being careful to follow the existing style.
-
Run go generate ./...
to re-generate the Go code.
go generate ./...
Testing
go test ./...
If you found this library useful, you may also be interested in the following projects: