cfg

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const Filename = "hellocontest.json"

Variables

View Source
var Default = Data{
	MyCall:              "DL0ABC",
	MyLocator:           "AA00zz",
	EnterTheirNumber:    true,
	EnterTheirXchange:   true,
	AllowMultiBand:      true,
	AllowMultiMode:      true,
	CabrilloQSOTemplate: "{{.QRG}} {{.Mode}} {{.Date}} {{.Time}} {{.MyCall}} {{.MyReport}} {{.MyNumber}} {{.MyXchange}} {{.TheirCall}} {{.TheirReport}} {{.TheirNumber}} {{.TheirXchange}}",
	HamlibAddress:       "localhost:4532",
	KeyerHost:           "localhost",
	KeyerPort:           6789,
	KeyerWPM:            20,
	KeyerSPMacros: []string{
		"{{.MyCall}}",
		"rr {{.MyReport}} {{.MyNumber}} {{.MyXchange}}",
		"tu gl",
		"nr {{.MyNumber}} {{.MyXchange}} {{.MyNumber}} {{.MyXchange}}",
	},
	KeyerRunMacros: []string{
		"cq {{.MyCall}} test",
		"{{.TheirCall}} {{.MyReport}} {{.MyNumber}} {{.MyXchange}}",
		"tu {{.MyCall}} test",
		"nr {{.MyNumber}} {{.MyXchange}} {{.MyNumber}} {{.MyXchange}}",
	},
}

Functions

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 {
	MyCall              string   `json:"mycall"`
	MyLocator           string   `json:"locator"`
	EnterTheirNumber    bool     `json:"enter_their_number"`
	EnterTheirXchange   bool     `json:"enter_their_xchange"`
	AllowMultiBand      bool     `json:"allow_multi_band"`
	AllowMultiMode      bool     `json:"allow_multi_mode"`
	CabrilloQSOTemplate string   `json:"cabrillo_qso"`
	KeyerHost           string   `json:"keyer_host"`
	KeyerPort           int      `json:"keyer_port"`
	KeyerWPM            int      `json:"keyer_wpm"`
	KeyerSPMacros       []string `json:"keyer_sp_macros"`
	KeyerRunMacros      []string `json:"keyer_run_macros"`
	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) AllowMultiBand

func (l *LoadedConfiguration) AllowMultiBand() bool

func (*LoadedConfiguration) AllowMultiMode

func (l *LoadedConfiguration) AllowMultiMode() bool

func (*LoadedConfiguration) CabrilloQSOTemplate

func (l *LoadedConfiguration) CabrilloQSOTemplate() string

func (*LoadedConfiguration) EnterTheirNumber

func (l *LoadedConfiguration) EnterTheirNumber() bool

func (*LoadedConfiguration) EnterTheirXchange

func (l *LoadedConfiguration) EnterTheirXchange() bool

func (*LoadedConfiguration) HamlibAddress

func (l *LoadedConfiguration) HamlibAddress() string

func (*LoadedConfiguration) KeyerHost

func (l *LoadedConfiguration) KeyerHost() string

func (*LoadedConfiguration) KeyerPort

func (l *LoadedConfiguration) KeyerPort() int

func (*LoadedConfiguration) KeyerRunMacros

func (l *LoadedConfiguration) KeyerRunMacros() []string

func (*LoadedConfiguration) KeyerSPMacros

func (l *LoadedConfiguration) KeyerSPMacros() []string

func (*LoadedConfiguration) KeyerWPM

func (l *LoadedConfiguration) KeyerWPM() int

func (*LoadedConfiguration) MyCall

func (*LoadedConfiguration) MyLocator

func (l *LoadedConfiguration) MyLocator() locator.Locator

type StaticConfiguration

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

func Static

func Static(myCall callsign.Callsign, myLocator locator.Locator) *StaticConfiguration

Static creates a static configuration instance with the given data.

func (*StaticConfiguration) AllowMultiBand

func (s *StaticConfiguration) AllowMultiBand() bool

func (*StaticConfiguration) AllowMultiMode

func (s *StaticConfiguration) AllowMultiMode() bool

func (*StaticConfiguration) CabrilloQSOTemplate

func (s *StaticConfiguration) CabrilloQSOTemplate() string

func (*StaticConfiguration) EnterTheirNumber

func (s *StaticConfiguration) EnterTheirNumber() bool

func (*StaticConfiguration) EnterTheirXchange

func (s *StaticConfiguration) EnterTheirXchange() bool

func (*StaticConfiguration) HamlibAddress

func (s *StaticConfiguration) HamlibAddress() string

func (*StaticConfiguration) KeyerHost

func (s *StaticConfiguration) KeyerHost() string

func (*StaticConfiguration) KeyerPort

func (s *StaticConfiguration) KeyerPort() int

func (*StaticConfiguration) KeyerRunMacros

func (s *StaticConfiguration) KeyerRunMacros() []string

func (*StaticConfiguration) KeyerSPMacros

func (s *StaticConfiguration) KeyerSPMacros() []string

func (*StaticConfiguration) KeyerWPM

func (s *StaticConfiguration) KeyerWPM() int

func (*StaticConfiguration) MyCall

func (*StaticConfiguration) MyLocator

func (s *StaticConfiguration) MyLocator() locator.Locator

Jump to

Keyboard shortcuts

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