Documentation ¶
Index ¶
- Constants
- func ActiveCallExists(db *gorm.DB, streamID uint, src uint, dst uint, slot bool, groupCall bool) bool
- func CountCalls(db *gorm.DB) int
- func CountRepeaterCalls(db *gorm.DB, repeaterID uint) int
- func CountRepeaters(db *gorm.DB) int
- func CountTalkgroupCalls(db *gorm.DB, talkgroupID uint) int
- func CountTalkgroups(db *gorm.DB) int
- func CountTalkgroupsByOwnerID(db *gorm.DB, ownerID uint) int
- func CountUserAdmins(db *gorm.DB) int
- func CountUserCalls(db *gorm.DB, userID uint) int
- func CountUserRepeaters(db *gorm.DB, id uint) int
- func CountUserSuspended(db *gorm.DB) int
- func CountUserUnapproved(db *gorm.DB) int
- func CountUsers(db *gorm.DB) int
- func DeleteRepeater(db *gorm.DB, id uint)
- func DeleteTalkgroup(db *gorm.DB, id uint)
- func DeleteUser(db *gorm.DB, id uint)
- func RepeaterExists(db *gorm.DB, repeater Repeater) bool
- func RepeaterIDExists(db *gorm.DB, id uint) bool
- func TalkgroupIDExists(db *gorm.DB, id uint) bool
- func UserExists(db *gorm.DB, user User) bool
- func UserIDExists(db *gorm.DB, id uint) bool
- type AppSettings
- type Call
- func FindActiveCall(db *gorm.DB, streamID uint, src uint, dst uint, slot bool, groupCall bool) (Call, error)
- func FindCalls(db *gorm.DB) []Call
- func FindRepeaterCalls(db *gorm.DB, repeaterID uint) []Call
- func FindTalkgroupCalls(db *gorm.DB, talkgroupID uint) []Call
- func FindUserCalls(db *gorm.DB, userID uint) []Call
- type Packet
- type RawDMRPacket
- type Repeater
- type Talkgroup
- type TalkgroupsSeeder
- type User
- type UsersSeeder
Constants ¶
View Source
const TalkgroupSeederRows = 1
View Source
const UserSeederRows = 2
Variables ¶
This section is empty.
Functions ¶
func ActiveCallExists ¶
func CountCalls ¶
func CountRepeaters ¶
func CountTalkgroups ¶
func CountUserAdmins ¶
func CountUserSuspended ¶
func CountUserUnapproved ¶
func CountUsers ¶
func DeleteRepeater ¶
func DeleteTalkgroup ¶
func DeleteUser ¶
Types ¶
type AppSettings ¶
type Call ¶
type Call struct { ID uint `json:"id" gorm:"primarykey"` StreamID uint `json:"-"` StartTime time.Time `json:"start_time"` Duration time.Duration `json:"duration"` Active bool `json:"active"` User User `json:"user" gorm:"foreignKey:UserID"` UserID uint `json:"-"` Repeater Repeater `json:"repeater" gorm:"foreignKey:RepeaterID"` RepeaterID uint `json:"-"` TimeSlot bool `json:"time_slot"` GroupCall bool `json:"group_call"` IsToTalkgroup bool `json:"is_to_talkgroup"` ToTalkgroupID *uint `json:"-"` ToTalkgroup Talkgroup `json:"to_talkgroup" gorm:"foreignKey:ToTalkgroupID"` IsToUser bool `json:"is_to_user"` ToUserID *uint `json:"-"` ToUser User `json:"to_user" gorm:"foreignKey:ToUserID"` IsToRepeater bool `json:"is_to_repeater"` ToRepeaterID *uint `json:"-"` ToRepeater Repeater `json:"to_repeater" gorm:"foreignKey:ToRepeaterID"` DestinationID uint `json:"destination_id"` TotalPackets uint `json:"-"` LostSequences uint `json:"-"` Loss float32 `json:"loss"` Jitter float32 `json:"jitter"` LastFrameNum uint `json:"-"` BER float32 `json:"ber"` RSSI float32 `json:"rssi"` TotalBits uint `json:"-"` LastPacketTime time.Time `json:"-"` HasHeader bool `json:"-"` HasTerm bool `json:"-"` CreatedAt time.Time `json:"-"` UpdatedAt time.Time `json:"-"` DeletedAt gorm.DeletedAt `json:"-" gorm:"index"` }
func FindActiveCall ¶
type Packet ¶
type Packet struct { Signature string `msg:"signature"` Seq uint `msg:"seq"` Src uint `msg:"src"` Dst uint `msg:"dst"` Repeater uint `msg:"repeater"` Slot bool `msg:"slot"` GroupCall bool `msg:"groupCall"` FrameType dmrconst.FrameType `msg:"frameType,extension"` DTypeOrVSeq uint `msg:"dtypeOrVSeq"` StreamID uint `msg:"streamID"` DMRData [33]byte `msg:"dmrData"` // The next two are technically unsigned, but the data type is 1 byte // We also want to be able to represent -1 as a null, so we use int BER int `msg:"ber"` RSSI int `msg:"rssi"` }
Packet is a DMR packet
func UnpackPacket ¶
type RawDMRPacket ¶
type RawDMRPacket struct { Data []byte `msg:"data"` RemoteIP string `msg:"remote_ip"` RemotePort int `msg:"remote_port"` }
RawDMRPacket is a raw DMR packet
type Repeater ¶
type Repeater struct { RadioID uint `json:"id" gorm:"primaryKey" msg:"radio_id"` Connection string `json:"-" gorm:"-" msg:"connection"` Connected time.Time `json:"connected_time" msg:"connected"` PingsReceived uint `json:"-" gorm:"-" msg:"pings_received"` LastPing time.Time `json:"last_ping_time" msg:"last_ping"` IP string `json:"-" gorm:"-" msg:"ip"` Port int `json:"-" gorm:"-" msg:"port"` Salt uint32 `json:"-" gorm:"-" msg:"salt"` Callsign string `json:"callsign" msg:"callsign"` RXFrequency uint `json:"rx_frequency" msg:"rx_frequency"` TXFrequency uint `json:"tx_frequency" msg:"tx_frequency"` TXPower uint `json:"tx_power" msg:"tx_power"` ColorCode uint `json:"color_code" msg:"color_code"` Latitude float32 `json:"latitude" msg:"latitude"` Longitude float32 `json:"longitude" msg:"longitude"` Height int `json:"height" msg:"height"` Location string `json:"location" msg:"location"` Description string `json:"description" msg:"description"` Slots uint `json:"slots" msg:"slots"` URL string `json:"url" msg:"url"` SoftwareID string `json:"software_id" msg:"software_id"` PackageID string `json:"package_id" msg:"package_id"` Password string `json:"-" msg:"-"` TS1StaticTalkgroups []Talkgroup `json:"ts1_static_talkgroups" gorm:"many2many:repeater_ts1_static_talkgroups;" msg:"-"` TS2StaticTalkgroups []Talkgroup `json:"ts2_static_talkgroups" gorm:"many2many:repeater_ts2_static_talkgroups;" msg:"-"` TS1DynamicTalkgroupID *uint `json:"-" msg:"-"` TS2DynamicTalkgroupID *uint `json:"-" msg:"-"` TS1DynamicTalkgroup Talkgroup `json:"ts1_dynamic_talkgroup" gorm:"foreignKey:TS1DynamicTalkgroupID" msg:"-"` TS2DynamicTalkgroup Talkgroup `json:"ts2_dynamic_talkgroup" gorm:"foreignKey:TS2DynamicTalkgroupID" msg:"-"` Owner User `json:"owner" gorm:"foreignKey:OwnerID" msg:"-"` OwnerID uint `json:"-" msg:"-"` Hotspot bool `json:"hotspot" msg:"hotspot"` CreatedAt time.Time `json:"created_at" msg:"-"` UpdatedAt time.Time `json:"-" msg:"-"` DeletedAt gorm.DeletedAt `json:"-" gorm:"index" msg:"-"` }
Repeater is the model for a DMR repeater
func ListRepeaters ¶
func (*Repeater) InTS1StaticTalkgroups ¶
func (*Repeater) InTS2StaticTalkgroups ¶
type Talkgroup ¶
type Talkgroup struct { ID uint `json:"id" gorm:"primaryKey"` Name string `json:"name"` Description string `json:"description"` Admins []User `json:"admins" gorm:"many2many:talkgroup_admins;"` NCOs []User `json:"ncos" gorm:"many2many:talkgroup_ncos;"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"-"` DeletedAt gorm.DeletedAt `json:"-" gorm:"index"` }
func FindTalkgroupsByOwnerID ¶
func ListTalkgroups ¶
type TalkgroupsSeeder ¶
type TalkgroupsSeeder struct {
gorm_seeder.SeederAbstract
}
func NewTalkgroupsSeeder ¶
func NewTalkgroupsSeeder(cfg gorm_seeder.SeederConfiguration) TalkgroupsSeeder
type User ¶
type User struct { ID uint `json:"id" gorm:"primaryKey" binding:"required"` Callsign string `json:"callsign" gorm:"uniqueIndex" binding:"required"` Username string `json:"username" gorm:"uniqueIndex" binding:"required"` Password string `json:"-"` Admin bool `json:"admin"` Approved bool `json:"approved" binding:"required"` Suspended bool `json:"suspended"` Repeaters []Repeater `json:"repeaters" gorm:"foreignKey:OwnerID"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"-"` DeletedAt gorm.DeletedAt `json:"-" gorm:"index"` }
func FindUserAdmins ¶
func FindUserSuspended ¶
func FindUserUnapproved ¶
type UsersSeeder ¶
type UsersSeeder struct {
gorm_seeder.SeederAbstract
}
func NewUsersSeeder ¶
func NewUsersSeeder(cfg gorm_seeder.SeederConfiguration) UsersSeeder
Click to show internal directories.
Click to hide internal directories.