Documentation
¶
Overview ¶
Package app implements the core functionality shared by cli and api.
Index ¶
- Constants
- Variables
- func AddAttachment(msg *fbb.Message, filename string, contentType string, r io.Reader) error
- func DoIfElapsed(callsign, name string, t time.Duration, fn func() error) error
- func LoadConfig(cfgPath string, fallback cfg.Config) (config cfg.Config, err error)
- func ReadConfig(path string) (config cfg.Config, err error)
- func SetFreq(rig hamlib.VFO, freq string) (newFreq, oldFreq int, err error)
- func SplitFunc(c rune) bool
- func WriteConfig(config cfg.Config, filePath string) error
- type ARDOPListener
- type AX25AGWPEListener
- type AX25LinuxListener
- type App
- func (a *App) AGWPE() (*agwpe.TNCPort, error)
- func (a *App) ARDOP() (*ardop.TNC, error)
- func (a *App) AbortActiveConnection(dirty bool) (ok bool)
- func (a *App) ActiveListeners() []string
- func (a *App) Close()
- func (a *App) Config() cfg.Config
- func (a *App) Connect(connectStr string) (success bool)
- func (a *App) EnableWebSocket(ctx context.Context, wsHub WSHub) error
- func (a *App) Env() []string
- func (a *App) FormsManager() *forms.Manager
- func (a *App) GetStatus() types.Status
- func (a *App) Heard() map[string][]Heard
- func (a *App) Listen(listenStr string)
- func (a *App) Locator() string
- func (a *App) Mailbox() *mailbox.DirHandler
- func (a *App) Options() Options
- func (a *App) PromptHub() *PromptHub
- func (a *App) ReadRMSList(ctx context.Context, forceDownload bool, filterFn func(rms RMS) (keep bool)) ([]RMS, error)
- func (a *App) Reload() error
- func (a *App) Run(ctx context.Context, cmd Command, args []string)
- func (a *App) SetConnectAliases(aliases map[string]string) error
- func (a *App) Unlisten(param string)
- func (a *App) VARAFM() (*vara.Modem, error)
- func (a *App) VARAHF() (*vara.Modem, error)
- func (a *App) VFOForRig(rig string) (hamlib.VFO, bool)
- func (a *App) VFOForTransport(transport string) (vfo hamlib.VFO, rigName string, ok bool, err error)
- type Band
- type Beaconer
- type ByDist
- type ByLinkQuality
- type Command
- type EventLogger
- type Frequency
- type Heard
- type JSONFloat64
- type JSONURL
- type Listener
- type ListenerHub
- type NotifyMBox
- type Options
- type Prediction
- type Prompt
- type PromptHub
- type PromptKind
- type PromptOption
- type PromptResponse
- type Prompter
- type RMS
- type RemoteCaller
- type StatusUpdate
- type TelnetListener
- type TransportListener
- type VaraFMListener
- type VaraHFListener
- type WSHub
Constants ¶
View Source
const ( MethodArdop = "ardop" MethodTelnet = "telnet" MethodPactor = "pactor" MethodVaraHF = "varahf" MethodVaraFM = "varafm" MethodAX25 = "ax25" MethodAX25AGWPE = MethodAX25 + "+agwpe" MethodAX25Linux = MethodAX25 + "+linux" MethodAX25SerialTNC = MethodAX25 + "+serial-tnc" // TODO: Remove after some release cycles (2023-05-21) MethodSerialTNCDeprecated = "serial-tnc" )
View Source
const ( PromptKindBusyChannel = types.PromptKindBusyChannel PromptKindMultiSelect = types.PromptKindMultiSelect PromptKindPassword = types.PromptKindPassword PromptKindPreAccountActivation = types.PromptKindPreAccountActivation PromptKindAccountActivation = types.PromptKindAccountActivation )
Variables ¶
View Source
var ErrNoCmd = fmt.Errorf("no cmd")
View Source
var ErrRateLimited error = errors.New("call was rate-limited")
Functions ¶
func AddAttachment ¶
func DoIfElapsed ¶
DoIfElapsed implements a per-callsign rate limited function.
func LoadConfig ¶
Types ¶
type ARDOPListener ¶
type ARDOPListener struct {
// contains filtered or unexported fields
}
func (*ARDOPListener) BeaconStart ¶
func (l *ARDOPListener) BeaconStart() error
func (ARDOPListener) BeaconStop ¶
func (l ARDOPListener) BeaconStop()
func (ARDOPListener) CurrentFreq ¶
func (l ARDOPListener) CurrentFreq() (Frequency, bool)
func (ARDOPListener) Name ¶
func (l ARDOPListener) Name() string
type AX25AGWPEListener ¶
type AX25AGWPEListener struct {
// contains filtered or unexported fields
}
func (*AX25AGWPEListener) BeaconStart ¶
func (l *AX25AGWPEListener) BeaconStart() error
func (AX25AGWPEListener) BeaconStop ¶
func (l AX25AGWPEListener) BeaconStop()
func (*AX25AGWPEListener) CurrentFreq ¶
func (l *AX25AGWPEListener) CurrentFreq() (Frequency, bool)
func (*AX25AGWPEListener) Name ¶
func (l *AX25AGWPEListener) Name() string
type AX25LinuxListener ¶
type AX25LinuxListener struct {
// contains filtered or unexported fields
}
func (*AX25LinuxListener) BeaconStart ¶
func (l *AX25LinuxListener) BeaconStart() error
func (*AX25LinuxListener) BeaconStop ¶
func (l *AX25LinuxListener) BeaconStop()
func (*AX25LinuxListener) CurrentFreq ¶
func (l *AX25LinuxListener) CurrentFreq() (Frequency, bool)
func (*AX25LinuxListener) Name ¶
func (l *AX25LinuxListener) Name() string
type App ¶
type App struct {
OnReload func() error
// contains filtered or unexported fields
}
func (*App) AbortActiveConnection ¶
func (*App) ActiveListeners ¶
func (*App) FormsManager ¶
func (*App) Mailbox ¶
func (a *App) Mailbox() *mailbox.DirHandler
func (*App) ReadRMSList ¶
func (*App) SetConnectAliases ¶ added in v0.19.0
type ByLinkQuality ¶ added in v0.19.0
type ByLinkQuality []RMS
func (ByLinkQuality) Len ¶ added in v0.19.0
func (r ByLinkQuality) Len() int
func (ByLinkQuality) Less ¶ added in v0.19.0
func (r ByLinkQuality) Less(i, j int) bool
func (ByLinkQuality) Swap ¶ added in v0.19.0
func (r ByLinkQuality) Swap(i, j int)
type Command ¶
type Command struct {
Str string
Aliases []string
Desc string
HandleFunc func(ctx context.Context, app *App, args []string)
Usage string
Options map[string]string
Example string
LongLived bool
MayConnect bool
}
func (Command) PrintUsage ¶
func (cmd Command) PrintUsage()
type EventLogger ¶
type EventLogger struct {
// contains filtered or unexported fields
}
func NewEventLogger ¶
func NewEventLogger(path string) (*EventLogger, error)
func (*EventLogger) Close ¶
func (l *EventLogger) Close() error
func (*EventLogger) Log ¶
func (l *EventLogger) Log(what string, event map[string]interface{})
type JSONFloat64 ¶
type JSONFloat64 float64
JSONFloat64 is a float64 which serializes NaN and Inf(+-) as JSON value null
func (JSONFloat64) MarshalJSON ¶
func (f JSONFloat64) MarshalJSON() ([]byte, error)
type JSONURL ¶
func (JSONURL) MarshalJSON ¶
type ListenerHub ¶
type ListenerHub struct {
*App
// contains filtered or unexported fields
}
func NewListenerHub ¶
func NewListenerHub(a *App) *ListenerHub
func (*ListenerHub) Active ¶
func (h *ListenerHub) Active() []TransportListener
func (*ListenerHub) Close ¶
func (h *ListenerHub) Close() error
func (*ListenerHub) Enable ¶
func (h *ListenerHub) Enable(t TransportListener)
func (*ListenerHub) NewListener ¶
func (h *ListenerHub) NewListener(t TransportListener) *Listener
type NotifyMBox ¶
type NotifyMBox struct {
fbb.MBoxHandler
*App
}
func (NotifyMBox) GetInboundAnswers ¶
func (m NotifyMBox) GetInboundAnswers(p []fbb.Proposal) []fbb.ProposalAnswer
func (NotifyMBox) ProcessInbound ¶
func (m NotifyMBox) ProcessInbound(msgs ...*fbb.Message) error
type Prediction ¶ added in v0.19.0
type PromptHub ¶
type PromptHub struct {
// contains filtered or unexported fields
}
func NewPromptHub ¶
func NewPromptHub() *PromptHub
func (*PromptHub) AddPrompter ¶
func (*PromptHub) Prompt ¶
func (p *PromptHub) Prompt(ctx context.Context, timeout time.Duration, kind PromptKind, message string, options ...PromptOption) <-chan PromptResponse
type PromptKind ¶
type PromptKind = types.PromptKind
type PromptOption ¶
type PromptOption = types.PromptOption
type PromptResponse ¶
type PromptResponse = types.PromptResponse
type RMS ¶
type RMS struct {
Callsign string `json:"callsign"`
Gridsquare string `json:"gridsquare"`
Distance JSONFloat64 `json:"distance"`
Azimuth JSONFloat64 `json:"azimuth"`
Modes string `json:"modes"`
Freq Frequency `json:"freq"`
Dial Frequency `json:"dial"`
URL *JSONURL `json:"url"`
Prediction *Prediction `json:"prediction"`
}
type RemoteCaller ¶
type RemoteCaller interface {
RemoteCall() string
}
type StatusUpdate ¶
type StatusUpdate struct{ WSHub }
func (StatusUpdate) UpdateStatus ¶
func (s StatusUpdate) UpdateStatus(stat fbb.Status)
type TelnetListener ¶
type TelnetListener struct {
// contains filtered or unexported fields
}
func (TelnetListener) CurrentFreq ¶
func (l TelnetListener) CurrentFreq() (Frequency, bool)
func (TelnetListener) Name ¶
func (l TelnetListener) Name() string
type TransportListener ¶
type VaraFMListener ¶
type VaraFMListener struct {
// contains filtered or unexported fields
}
func (VaraFMListener) CurrentFreq ¶
func (l VaraFMListener) CurrentFreq() (Frequency, bool)
func (VaraFMListener) Name ¶
func (l VaraFMListener) Name() string
type VaraHFListener ¶
type VaraHFListener struct {
// contains filtered or unexported fields
}
func (VaraHFListener) CurrentFreq ¶
func (l VaraHFListener) CurrentFreq() (Frequency, bool)
func (VaraHFListener) Name ¶
func (l VaraHFListener) Name() string
Click to show internal directories.
Click to hide internal directories.