Documentation
¶
Overview ¶
SPDX-License-Identifier: AGPL-3.0-or-later DMRHub - Run a DMR network server in a single binary Copyright (C) 2023-2026 Jacob McSwain
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
The source code is available at <https://github.com/USA-RedDragon/DMRHub>
SPDX-License-Identifier: AGPL-3.0-or-later DMRHub - Run a DMR network server in a single binary Copyright (C) 2023-2026 Jacob McSwain
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
The source code is available at <https://github.com/USA-RedDragon/DMRHub>
Index ¶
- type AuthLogin
- type ConfigResponse
- type NetCheckInResponse
- type NetPatch
- type NetResponse
- type NetStartPost
- type POSTConfig
- type PeerPatch
- type PeerPost
- type PeerRulePost
- type RepeaterPatch
- type RepeaterPost
- type RepeaterTalkgroupsPost
- type ScheduledNetPatch
- type ScheduledNetPost
- type ScheduledNetResponse
- type SecretStatus
- type TalkgroupAdminAction
- type TalkgroupPatch
- type TalkgroupPost
- type UserPatch
- type UserRegistration
- type WSCallResponse
- type WSCallResponseRepeater
- type WSCallResponseTalkgroup
- type WSCallResponseUser
- type WSNetCheckInResponse
- type WSNetEventResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigResponse ¶ added in v1.2.8
type ConfigResponse struct {
config.Config
Secrets SecretStatus `json:"secrets"`
}
type NetCheckInResponse ¶ added in v1.2.36
type NetCheckInResponse struct {
CallID uint `json:"call_id"`
User WSCallResponseUser `json:"user"`
RepeaterID uint `json:"repeater_id"`
StartTime time.Time `json:"start_time"`
}
NetCheckInResponse represents a single check-in (call) during a net.
func NewNetCheckInResponseFromCall ¶ added in v1.2.36
func NewNetCheckInResponseFromCall(call *models.Call) NetCheckInResponse
NewNetCheckInResponseFromCall builds a NetCheckInResponse from a models.Call.
type NetPatch ¶ added in v1.2.36
type NetPatch struct {
Showcase *bool `json:"showcase,omitempty"`
}
NetPatch is the request body for updating a net (admin only).
type NetResponse ¶ added in v1.2.36
type NetResponse struct {
ID uint `json:"id"`
TalkgroupID uint `json:"talkgroup_id"`
Talkgroup WSCallResponseTalkgroup `json:"talkgroup"`
StartedByUser WSCallResponseUser `json:"started_by_user"`
ScheduledNetID *uint `json:"scheduled_net_id,omitempty"`
StartTime time.Time `json:"start_time"`
EndTime *time.Time `json:"end_time,omitempty"`
DurationMinutes *uint `json:"duration_minutes,omitempty"`
Description string `json:"description"`
Active bool `json:"active"`
Showcase bool `json:"showcase"`
CheckInCount int `json:"check_in_count"`
}
NetResponse is the API response for a net session.
func NewNetResponseFromNet ¶ added in v1.2.36
func NewNetResponseFromNet(net *models.Net, checkInCount int) NetResponse
NewNetResponseFromNet converts a models.Net into a NetResponse.
type NetStartPost ¶ added in v1.2.36
type NetStartPost struct {
TalkgroupID uint `json:"talkgroup_id" binding:"required"`
Description string `json:"description"`
DurationMinutes *uint `json:"duration_minutes,omitempty"`
}
NetStartPost is the request body for starting an ad-hoc net.
type POSTConfig ¶ added in v1.0.66
type POSTConfig struct {
config.Config
Secret *string `json:"secret,omitempty"`
PasswordSalt *string `json:"password-salt,omitempty"`
HIBPAPIKey *string `json:"hibp-api-key,omitempty"`
SMTP struct {
config.SMTP
Password *string `json:"password,omitempty"`
}
Database struct {
config.Database
Password *string `json:"password,omitempty"`
}
Redis struct {
config.Redis
Password *string `json:"password,omitempty"`
}
}
type PeerRulePost ¶ added in v1.2.36
type RepeaterPatch ¶ added in v1.2.22
type RepeaterPatch struct {
SimplexRepeater *bool `json:"simplex_repeater"`
}
type RepeaterPost ¶
type RepeaterTalkgroupsPost ¶
type RepeaterTalkgroupsPost struct {
TS1StaticTalkgroups []models.Talkgroup `json:"ts1_static_talkgroups"`
TS2StaticTalkgroups []models.Talkgroup `json:"ts2_static_talkgroups"`
TS1DynamicTalkgroup models.Talkgroup `json:"ts1_dynamic_talkgroup"`
TS2DynamicTalkgroup models.Talkgroup `json:"ts2_dynamic_talkgroup"`
}
type ScheduledNetPatch ¶ added in v1.2.36
type ScheduledNetPatch struct {
Name *string `json:"name,omitempty"`
Description *string `json:"description,omitempty"`
DayOfWeek *int `json:"day_of_week,omitempty"`
TimeOfDay *string `json:"time_of_day,omitempty"`
Timezone *string `json:"timezone,omitempty"`
DurationMinutes *uint `json:"duration_minutes,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
Showcase *bool `json:"showcase,omitempty"`
}
ScheduledNetPatch is the request body for updating a scheduled net.
type ScheduledNetPost ¶ added in v1.2.36
type ScheduledNetPost struct {
TalkgroupID uint `json:"talkgroup_id" binding:"required"`
Name string `json:"name" binding:"required"`
Description string `json:"description"`
DayOfWeek int `json:"day_of_week" binding:"min=0,max=6"`
TimeOfDay string `json:"time_of_day" binding:"required"`
Timezone string `json:"timezone" binding:"required"`
DurationMinutes *uint `json:"duration_minutes,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
Showcase *bool `json:"showcase,omitempty"`
}
ScheduledNetPost is the request body for creating a scheduled net.
type ScheduledNetResponse ¶ added in v1.2.36
type ScheduledNetResponse struct {
ID uint `json:"id"`
TalkgroupID uint `json:"talkgroup_id"`
Talkgroup WSCallResponseTalkgroup `json:"talkgroup"`
CreatedByUser WSCallResponseUser `json:"created_by_user"`
Name string `json:"name"`
Description string `json:"description"`
CronExpression string `json:"cron_expression"`
DayOfWeek int `json:"day_of_week"`
TimeOfDay string `json:"time_of_day"`
Timezone string `json:"timezone"`
DurationMinutes *uint `json:"duration_minutes,omitempty"`
Enabled bool `json:"enabled"`
Showcase bool `json:"showcase"`
NextRun *time.Time `json:"next_run,omitempty"`
CreatedAt time.Time `json:"created_at"`
}
ScheduledNetResponse is the API response for a scheduled net.
func NewScheduledNetResponseFromScheduledNet ¶ added in v1.2.36
func NewScheduledNetResponseFromScheduledNet(sn *models.ScheduledNet) ScheduledNetResponse
NewScheduledNetResponseFromScheduledNet converts a models.ScheduledNet into a ScheduledNetResponse.
type SecretStatus ¶ added in v1.2.8
type TalkgroupAdminAction ¶
type TalkgroupAdminAction struct {
UserIDs []uint `json:"user_ids"`
}
type TalkgroupPatch ¶
type TalkgroupPost ¶
type UserRegistration ¶
type UserRegistration struct {
DMRId uint `json:"id" binding:"required"`
Callsign string `json:"callsign" binding:"required"`
Username string `json:"username" binding:"required"`
Password string `json:"password" binding:"required"`
}
func (*UserRegistration) IsValidUsername ¶
func (r *UserRegistration) IsValidUsername() (bool, string)
type WSCallResponse ¶ added in v1.0.15
type WSCallResponse struct {
ID uint `json:"id"`
User WSCallResponseUser `json:"user"`
StartTime time.Time `json:"start_time"`
Duration time.Duration `json:"duration"`
Active bool `json:"active"`
TimeSlot bool `json:"time_slot"`
GroupCall bool `json:"group_call"`
RepeaterID uint `json:"repeater_id"`
IsToTalkgroup bool `json:"is_to_talkgroup"`
ToTalkgroup WSCallResponseTalkgroup `json:"to_talkgroup"`
IsToUser bool `json:"is_to_user"`
ToUser WSCallResponseUser `json:"to_user"`
IsToRepeater bool `json:"is_to_repeater"`
ToRepeater WSCallResponseRepeater `json:"to_repeater"`
Loss float32 `json:"loss"`
Jitter float32 `json:"jitter"`
BER float32 `json:"ber"`
RSSI float32 `json:"rssi"`
}
func NewWSCallResponseFromCall ¶ added in v1.2.27
func NewWSCallResponseFromCall(call *models.Call) WSCallResponse
NewWSCallResponseFromCall converts a models.Call into a WSCallResponse suitable for JSON serialisation over WebSocket or pubsub channels.
type WSCallResponseRepeater ¶ added in v1.0.15
type WSCallResponseTalkgroup ¶ added in v1.0.15
type WSCallResponseUser ¶ added in v1.0.15
type WSNetCheckInResponse ¶ added in v1.2.36
type WSNetCheckInResponse struct {
NetID uint `json:"net_id"`
CallID uint `json:"call_id"`
User WSCallResponseUser `json:"user"`
StartTime time.Time `json:"start_time"`
Duration time.Duration `json:"duration"`
}
WSNetCheckInResponse is sent over WebSocket when a check-in occurs during an active net.
type WSNetEventResponse ¶ added in v1.2.36
type WSNetEventResponse struct {
NetID uint `json:"net_id"`
TalkgroupID uint `json:"talkgroup_id"`
Talkgroup WSCallResponseTalkgroup `json:"talkgroup"`
Event string `json:"event"` // "started" or "stopped"
Active bool `json:"active"`
StartTime time.Time `json:"start_time"`
EndTime *time.Time `json:"end_time,omitempty"`
}
WSNetEventResponse is sent over WebSocket when a net starts or stops.