Documentation
¶
Index ¶
Constants ¶
View Source
const (
ServiceName = types.HamNutLookupServiceName
)
Variables ¶
This section is empty.
Functions ¶
func IsNetworkError ¶
IsNetworkError checks if the error is network-related
Types ¶
type PrefixLookupResponse ¶
type PrefixLookupResponse struct {
Status string `json:"status"`
Found bool `json:"found"`
Timestamp string `json:"_t"`
Continent string `json:"continent"`
CountryName string `json:"countryName"`
CQZone int `json:"cqZone"`
ITUZone int `json:"ituZone"`
Prefix string `json:"prefix"`
PrimaryDXCCPrefix string `json:"primaryDXCCPrefix"`
// Optional/forward-compatible fields.
CountryCode string `json:"countryCode,omitempty"`
TimeOffset string `json:"timeOffset,omitempty"`
LocalTime string `json:"localTime,omitempty"`
}
PrefixLookupResponse models the successful JSON response from the Hamnut /v1/call-signs/prefixes endpoint.
type Service ¶
type Service struct {
ConfigService *config.Service `di.inject:"configservice"`
LoggerService *logging.Service `di.inject:"loggingservice"`
Config *types.LookupConfig
// contains filtered or unexported fields
}
func NewService ¶
func NewService(logger *logging.Service, cfgSvc *config.Service, cfg *types.LookupConfig, client *http.Client) *Service
NewService returns a Hamnut lookup service with the provided dependencies. The lookup.ConfigService is optional if you supply Config directly. The client can be overridden for testing; otherwise it will be created during Initialize.
func (*Service) Initialize ¶
Initialize initializes the Service instance by setting up required dependencies and configurations.
Click to show internal directories.
Click to hide internal directories.