cmsapi

package
v0.19.2 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RootURL              = "https://api.winlink.org"
	PathVersionAdd       = "/version/add"
	PathGatewayStatus    = "/gateway/status.json"
	PathAccountExists    = "/account/exists"
	PathPasswordValidate = "/account/password/validate"
	PathAccountAdd       = "/account/add"

	// AccessKey issued December 2017 by the WDT for use with Pat
	AccessKey = "1880278F11684B358F36845615BD039A"
)
View Source
const (
	PathMPSAdd    = "/mps/add"
	PathMPSDelete = "/mps/delete"
	PathMPSGet    = "/mps/get"
	PathMPSList   = "/mps/list"
)
View Source
const (
	PathAccountPasswordRecoveryEmailGet = "/account/password/recovery/email/get"
	PathAccountPasswordRecoveryEmailSet = "/account/password/recovery/email/set"
)
View Source
const PathHybridStationList = "/hybridStation/list"

Variables

This section is empty.

Functions

func AccountAdd added in v0.18.0

func AccountAdd(ctx context.Context, callsign, password, recoveryEmail string) error

func AccountExists added in v0.11.0

func AccountExists(ctx context.Context, callsign string) (bool, error)

func GetGatewayStatus added in v0.5.1

func GetGatewayStatus(ctx context.Context, mode string, historyHours int, serviceCodes ...string) (io.ReadCloser, error)

GetGatewayStatus fetches the gateway status list returned by GatewayStatusUrl

mode can be any of [packet, pactor, robustpacket, allhf or anyall]. Empty is AnyAll. historyHours is the number of hours of history to include (maximum: 48). If < 1, then API default is used. serviceCodes defaults to "PUBLIC".

func GetGatewayStatusCached added in v0.5.1

func GetGatewayStatusCached(ctx context.Context, cacheFile string, forceDownload bool, serviceCodes ...string) (io.ReadCloser, error)

GetGatewayStatusCached fetches the gateway status list, either from a cache file or by downloading it.

If error occurs while downloading, it will fall back to the embedded gateway status information.

func MPSAdd added in v0.18.0

func MPSAdd(ctx context.Context, requester, callsign, password, mpsCallsign string) error

MPSAdd adds an entry to the MPS table

func MPSDelete added in v0.18.0

func MPSDelete(ctx context.Context, requester, callsign, password string) error

MPSDelete deletes all MPS records for the specified callsign

func PasswordRecoveryEmailGet added in v0.16.0

func PasswordRecoveryEmailGet(ctx context.Context, callsign, password string) (string, error)

func PasswordRecoveryEmailSet added in v0.16.0

func PasswordRecoveryEmailSet(ctx context.Context, callsign, password, email string) error

func ValidatePassword added in v0.18.0

func ValidatePassword(ctx context.Context, callsign, password string) (bool, error)

Types

type AccountAddRequest added in v0.18.0

type AccountAddRequest struct {
	Callsign      string `json:"Callsign"`
	Password      string `json:"Password"`
	RecoveryEmail string `json:"RecoveryEmail,omitempty"`
}

type AccountAddResponse added in v0.18.0

type AccountAddResponse struct {
	ResponseStatus responseStatus `json:"ResponseStatus"`
}

type DotNetTime added in v0.18.0

type DotNetTime struct{ time.Time }

DotNetTime handles .NET-style JSON date serialization

func (*DotNetTime) UnmarshalJSON added in v0.18.0

func (t *DotNetTime) UnmarshalJSON(b []byte) error

UnmarshalJSON implements custom JSON unmarshaling for .NET date format

type Gateway added in v0.5.1

type Gateway struct {
	Callsign      string
	BaseCallsign  string
	RequestedMode string
	Comments      string
	LastStatus    RFC1123Time
	Latitude      float64
	Longitude     float64

	Channels []GatewayChannel `json:"GatewayChannels"`
}

type GatewayChannel added in v0.5.1

type GatewayChannel struct {
	OperatingHours string
	SupportedModes string
	Frequency      float64
	ServiceCode    string
	Baud           string
	RadioRange     string
	Mode           int
	Gridsquare     string
	Antenna        string
}

type GatewayStatus added in v0.5.1

type GatewayStatus struct {
	ServerName string    `json:"ServerName"`
	ErrorCode  int       `json:"ErrorCode"`
	Gateways   []Gateway `json:"Gateways"`
}

type HybridStation added in v0.18.0

type HybridStation struct {
	Callsign            string
	AutomaticForwarding bool
	ManualForwarding    bool
}

func HybridStationList added in v0.18.0

func HybridStationList(ctx context.Context) ([]HybridStation, error)

type MessagePickupStationRecord added in v0.18.0

type MessagePickupStationRecord struct {
	Callsign    string     `json:"callsign"`
	MpsCallsign string     `json:"mpsCallsign"`
	Timestamp   DotNetTime `json:"timestamp"`
}

MessagePickupStationRecord represents an MPS record

func MPSGet added in v0.18.0

func MPSGet(ctx context.Context, requester, callsign string) ([]MessagePickupStationRecord, error)

MPSGet returns all MPS records for the specified callsign

type PasswordValidateRequest added in v0.18.0

type PasswordValidateRequest struct {
	Callsign string `json:"Callsign"`
	Password string `json:"Password"`
}

type PasswordValidateResponse added in v0.18.0

type PasswordValidateResponse struct {
	IsValid        bool           `json:"IsValid"`
	ResponseStatus responseStatus `json:"ResponseStatus"`
}

type RFC1123Time added in v0.5.1

type RFC1123Time struct{ time.Time }

func (*RFC1123Time) UnmarshalJSON added in v0.5.1

func (t *RFC1123Time) UnmarshalJSON(b []byte) (err error)

type VersionAdd

type VersionAdd struct {
	Callsign string `json:"callsign"`
	Program  string `json:"program"`
	Version  string `json:"version"`
	Comments string `json:"comments,omitempty"`
}

func (VersionAdd) Post

func (v VersionAdd) Post() error

Jump to

Keyboard shortcuts

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