feat: 重建 MediaMTX 生命周期与状态对账 (#67)
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
package media
|
||||
|
||||
import "time"
|
||||
|
||||
const (
|
||||
DesiredRunning = "running"
|
||||
DesiredStopped = "stopped"
|
||||
)
|
||||
|
||||
type Route struct {
|
||||
ID string `gorm:"size:96;primaryKey"`
|
||||
DeviceID string `gorm:"size:36;not null;uniqueIndex:media_device_profile"`
|
||||
ProfileToken string `gorm:"size:255;not null;uniqueIndex:media_device_profile"`
|
||||
Path string `gorm:"size:96;not null;uniqueIndex"`
|
||||
Desired string `gorm:"size:16;not null;index"`
|
||||
Actual string `gorm:"size:32;not null;index"`
|
||||
Readers int `gorm:"not null"`
|
||||
SourceReady bool `gorm:"not null"`
|
||||
FailureCount int `gorm:"not null"`
|
||||
NextRetryAt *time.Time `gorm:"index"`
|
||||
LastErrorCode string `gorm:"size:64;not null"`
|
||||
Detail string `gorm:"size:512;not null"`
|
||||
Version int64 `gorm:"not null"`
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
|
||||
func (Route) TableName() string { return "sense_media_routes" }
|
||||
|
||||
// admissionProfile intentionally maps only non-secret fields from #66.
|
||||
type admissionProfile struct {
|
||||
DeviceID string `gorm:"column:device_id"`
|
||||
Token string `gorm:"column:token"`
|
||||
StreamURI string `gorm:"column:stream_uri"`
|
||||
VerificationStatus string `gorm:"column:verification_status"`
|
||||
}
|
||||
|
||||
func (admissionProfile) TableName() string { return "sense_admission_profiles" }
|
||||
Reference in New Issue
Block a user