cfg

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const Filename = "hellocontest.json"

Variables

View Source
var Default = Data{
	Station: pb.Station{
		Callsign: "DL0ABC",
		Operator: "DL1ABC",
		Locator:  "AA00zz",
	},
	Contest: pb.Contest{
		Name:                    "Default",
		EnterTheirNumber:        true,
		EnterTheirXchange:       true,
		RequireTheirXchange:     true,
		AllowMultiBand:          true,
		AllowMultiMode:          true,
		SameCountryPoints:       1,
		SameContinentPoints:     3,
		SpecificCountryPoints:   10,
		SpecificCountryPrefixes: []string{"DL"},
		OtherPoints:             5,
		Multis: &pb.Multis{
			Dxcc:    true,
			Wpx:     true,
			Xchange: true,
		},
		XchangeMultiPattern: "\\d+",
		CountPerBand:        true,
	},
	Keyer: pb.Keyer{
		Wpm: 25,
		SpMacros: []string{
			"{{.MyCall}}",
			"rr {{.MyReport}} {{.MyNumber}} {{.MyXchange}}",
			"tu gl",
			"nr {{.MyNumber}} {{.MyXchange}} {{.MyNumber}} {{.MyXchange}}",
		},
		RunMacros: []string{
			"cq {{.MyCall}} test",
			"{{.TheirCall}} {{.MyReport}} {{.MyNumber}} {{.MyXchange}}",
			"tu {{.MyCall}} test",
			"nr {{.MyNumber}} {{.MyXchange}} {{.MyNumber}} {{.MyXchange}}",
		},
	},
	CabrilloQSOTemplate: "{{.QRG}} {{.Mode}} {{.Date}} {{.Time}} {{.MyCall}} {{.MyReport}} {{.MyNumber}} {{.MyXchange}} {{.TheirCall}} {{.TheirReport}} {{.TheirNumber}} {{.TheirXchange}}",
	HamlibAddress:       "localhost:4532",
	KeyerHost:           "localhost",
	KeyerPort:           6789,
}

Functions

func AbsoluteFilename added in v0.3.0

func AbsoluteFilename() string

func Directory

func Directory() string

Directory returns the configuration directory. It panics if the directory could not be determined.

Types

type Data

type Data struct {
	Station             pb.Station
	Contest             pb.Contest
	Keyer               pb.Keyer
	CabrilloQSOTemplate string `json:"cabrillo_qso"`
	KeyerHost           string `json:"keyer_host"`
	KeyerPort           int    `json:"keyer_port"`
	HamlibAddress       string `json:"hamlib_address"`
}

type LoadedConfiguration

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

func Load

func Load() (*LoadedConfiguration, error)

Load loads the configuration from the default location (see github.com/ftl/cfg/LoadJSON()).

func (*LoadedConfiguration) Cabrillo added in v0.6.0

func (c *LoadedConfiguration) Cabrillo() core.Cabrillo

func (*LoadedConfiguration) CabrilloQSOTemplate

func (c *LoadedConfiguration) CabrilloQSOTemplate() string

func (*LoadedConfiguration) Contest added in v0.6.0

func (c *LoadedConfiguration) Contest() core.Contest

func (*LoadedConfiguration) HamlibAddress

func (c *LoadedConfiguration) HamlibAddress() string

func (*LoadedConfiguration) Keyer added in v0.6.0

func (c *LoadedConfiguration) Keyer() core.Keyer

func (*LoadedConfiguration) KeyerHost

func (c *LoadedConfiguration) KeyerHost() string

func (*LoadedConfiguration) KeyerPort

func (c *LoadedConfiguration) KeyerPort() int

func (*LoadedConfiguration) Station added in v0.6.0

func (c *LoadedConfiguration) Station() core.Station

Jump to

Keyboard shortcuts

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