Documentation ¶
Index ¶
- type CallTracker
- type Parrot
- func (p *Parrot) GetStream(ctx context.Context, streamID uint) []models.Packet
- func (p *Parrot) IsStarted(ctx context.Context, streamID uint) bool
- func (p *Parrot) RecordPacket(ctx context.Context, streamID uint, packet models.Packet)
- func (p *Parrot) StartStream(ctx context.Context, streamID uint, repeaterID uint) bool
- func (p *Parrot) StopStream(ctx context.Context, streamID uint)
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CallTracker ¶
type CallTracker struct { DB *gorm.DB Redis *redis.Client CallEndTimers map[uint]*time.Timer InFlightCalls map[uint]*models.Call }
CallTracker is a struct that holds the state of the calls that are currently in progress
func NewCallTracker ¶
func NewCallTracker(db *gorm.DB, redis *redis.Client) *CallTracker
NewCallTracker creates a new CallTracker
func (*CallTracker) EndCall ¶
func (c *CallTracker) EndCall(ctx context.Context, packet models.Packet)
EndCall ends a call
func (*CallTracker) IsCallActive ¶
func (c *CallTracker) IsCallActive(packet models.Packet) bool
IsCallActive checks if a call is active
func (*CallTracker) ProcessCallPacket ¶
func (c *CallTracker) ProcessCallPacket(ctx context.Context, packet models.Packet)
ProcessCallPacket processes a packet and updates the call
type Parrot ¶
type Parrot struct {
Redis redisParrotStorage
}
Parrot is a struct that stores packets and repeats them back to the repeater
func NewParrot ¶
func NewParrot(redis *redis.Client) *Parrot
NewParrot creates a new parrot instance
func (*Parrot) RecordPacket ¶
RecordPacket records a packet from the stream
func (*Parrot) StartStream ¶
StartStream starts a new stream
type Server ¶ added in v1.0.8
type Server struct { Buffer []byte SocketAddress net.UDPAddr Server *net.UDPConn Started bool Parrot *Parrot DB *gorm.DB Redis redisRepeaterStorage CallTracker *CallTracker }
Server is the DMR server
func MakeServer ¶
MakeServer creates a new DMR server
Click to show internal directories.
Click to hide internal directories.