cfg

package
v0.22.2 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultSpotLifetime = 10 * time.Minute
View Source
const Filename = "hellocontest.json"

Variables

View Source
var Default = &Data{
	LogDirectory: "$HOME/",
	HamDXMapPort: 17300,
	Station: &pb.Station{
		Callsign: "DL0ABC",
		Operator: "DL1ABC",
		Locator:  "AA00xx",
	},
	Contest: &pb.Contest{
		Name:       "Default",
		QsosGoal:   48,
		PointsGoal: 60,
		MultisGoal: 12,
	},
	Radios: []core.Radio{
		{
			Name:    "Hamlib Radio",
			Type:    "hamlib",
			Address: "localhost:4532",
			Keyer:   "local cwdaemon",
		},
		{
			Name:    "TCI Radio",
			Type:    "tci",
			Address: "localhost:40001",
			Keyer:   "radio",
		},
	},
	Keyers: []core.Keyer{
		{
			Name:    "Local CWDaemon",
			Type:    "cwdaemon",
			Address: "localhost:6789",
		},
	},
	KeyerSettings: core.KeyerSettings{
		WPM:    25,
		Preset: "Default",
	},
	KeyerPresets: []core.KeyerPreset{
		{
			Name: "Default",
			SPMacros: []string{
				"{{.MyCall}}",
				"rr {{.MyReport}} {{.MyNumber}} {{.MyXchange}}",
				"tu gl",
				"nr {{.MyNumber}} {{.MyXchange}} {{.MyNumber}} {{.MyXchange}}",
			},
			SPLabels: []string{"MyCall", "R Exch", "TU GL", "Exch AGN"},
			RunMacros: []string{
				"cq {{.MyCall}} test",
				"{{.TheirCall}} {{.MyReport}} {{.MyNumber}} {{.MyXchange}}",
				"tu {{.MyCall}} test",
				"nr {{.MyNumber}} {{.MyXchange}} {{.MyNumber}} {{.MyXchange}}",
			},
			RunLabels: []string{"CQ", "Exch", "TU QRZ?", "Exch AGN"},
		},
	},
	SpotLifetime: "10m",
	SpotSources: []core.SpotSource{
		{
			Name:        "Skimmer",
			Username:    "dl0abc",
			HostAddress: "localhost:7373",
			Type:        core.SkimmerSpot,
		},
		{
			Name:        "W3LPL",
			Username:    "dl0abc",
			HostAddress: "w3lpl.net:7373",
			Type:        core.RBNSpot,
			Filter:      core.OwnContinentSpotsOnly,
		},
	},
}

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 {
	LogDirectory  string             `json:"log_directory"`
	HamDXMapPort  int                `json:"ham_dx_map_port"`
	Station       *pb.Station        `json:"station"`
	Contest       *pb.Contest        `json:"contest"`
	Radios        []core.Radio       `json:"radios"`
	Keyers        []core.Keyer       `json:"keyers"`
	KeyerSettings core.KeyerSettings `json:"keyer_settings"`
	KeyerPresets  []core.KeyerPreset `json:"keyer_presets"`
	SpotLifetime  string             `json:"spot_lifetime"`
	SpotSources   []core.SpotSource  `json:"spot_sources"`
}

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) Contest added in v0.6.0

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

func (*LoadedConfiguration) HamDXMapPort added in v0.20.0

func (c *LoadedConfiguration) HamDXMapPort() int

func (*LoadedConfiguration) KeyerPresets added in v0.12.0

func (c *LoadedConfiguration) KeyerPresets() []core.KeyerPreset

func (*LoadedConfiguration) KeyerSettings added in v0.15.0

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

func (*LoadedConfiguration) Keyers added in v0.15.0

func (c *LoadedConfiguration) Keyers() []core.Keyer

func (*LoadedConfiguration) LogDirectory added in v0.14.0

func (c *LoadedConfiguration) LogDirectory() string

func (*LoadedConfiguration) Radios added in v0.15.0

func (c *LoadedConfiguration) Radios() []core.Radio

func (*LoadedConfiguration) SpotLifetime added in v0.14.0

func (c *LoadedConfiguration) SpotLifetime() time.Duration

func (*LoadedConfiguration) SpotSources added in v0.13.0

func (c *LoadedConfiguration) SpotSources() []core.SpotSource

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