Documentation
¶
Overview ¶
+build srs
+build srs
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // GRWLock 数据库全局读写锁 GRWLock *sync.RWMutex )
Functions ¶
Types ¶
type Device ¶
type Device struct { ID string `json:"ID"` Name string `json:"Name"` Manufacturer string `json:"Manufacturer"` Type string `json:"Type"` Password string `json:"Password"` MediaTransport string `json:"MediaTransport"` MediaTransportMode string `json:"MediaTransportMode"` CommandTransport string `json:"CommandTransport"` RemoteIP string `json:"RemoteIP"` RemotePort int `json:"RemotePort"` Online bool `json:"Online"` RecordCenter bool `json:"RecordCenter"` RecordIndistinct bool `json:"RecordIndistinct"` CivilCodeFirst bool `json:"CivilCodeFirst"` ChannelCount int `json:"ChannelCount"` RecvStreamIP string `json:"RecvStreamIP"` SMSID string `json:"SMSID"` ContactIP string `json:"ContactIP"` Charset string `json:"Charset"` CatalogInterval int `json:"CatalogInterval"` SubscribeInterval int `json:"SubscribeInterval"` Longitude int `json:"Longitude"` Latitude int `json:"Latitude"` LastRegisterAt MyTime `json:"LastRegisterAt" gorm:"type:datetime"` LastKeepaliveAt MyTime `json:"LastKeepaliveAt" gorm:"type:datetime"` CreatedAt MyTime `json:"CreatedAt" gorm:"type:datetime"` UpdatedAt MyTime `json:"UpdatedAt" gorm:"type:datetime"` }
Device 设备字段
func (*Device) ChannelList ¶
func (d *Device) ChannelList() ([]*DeviceChannel, error)
ChannelList 查询设备通道列表
type DeviceChannel ¶
type DeviceChannel struct { ID string `json:"ID"` //通道编号 DeviceID string `json:"DeviceID"` //设备编号 DeviceName string `json:"DeviceName"` //设备名称 DeviceOnline bool `json:"DeviceOnline"` //设备在线状态 Channel int `json:"Channel"` //通道序号 Name string `json:"Name"` //通道名称 Address string `json:"Address"` Altitude int `json:"Altitude"` AudioEnable bool `json:"AudioEnable"` BatteryLevel int `json:"BatteryLevel"` Block string `json:"Block"` CivilCode string `json:"CivilCode"` CloudRecord bool `json:"CloudRecord"` CreatedAt string `json:"CreatedAt"` Custom bool `json:"Custom"` CustomName string `json:"CustomName"` CustomPTZType int `json:"CustomPTZType"` CustomParentID string `json:"CustomParentID"` Direction int `json:"Direction,omitempty"` DownloadSpeed string `json:"DownloadSpeed"` Latitude int `json:"Latitude"` Longitude int `json:"Longitude"` Manufacturer string `json:"Manufacturer"` Model string `json:"Model"` NumOutputs int `json:"NumOutputs"` Ondemand bool `json:"Ondemand"` Owner string `json:"Owner"` PTZType int `json:"PTZType"` ParentID string `json:"ParentID"` Parental int `json:"Parental"` Quality string `json:"Quality"` RegisterWay int `json:"RegisterWay"` Secrecy int `json:"Secrecy"` SignalLevel int `json:"SignalLevel"` SnapURL string `json:"SnapURL,omitempty"` //通道快照链接 Speed int `json:"Speed"` Status string `json:"Status"` StreamID string `json:"StreamID,omitempty"` //直播流ID, 有值表示正在直播 SubCount int `json:"SubCount"` //子节点数, SubCount > 0 表示该通道为子目录 UpdatedAt string `json:"UpdatedAt"` }
type DiskInfo ¶
type DiskInfo struct { Name string `json:"Name"` Unit string `json:"Unit"` Size string `json:"Size"` FreeSpace string `json:"FreeSpace"` Used string `json:"Used"` Percent string `json:"Percent"` Threshold string `json:"Threshold"` }
DiskInfo 存储使用
type MyTime ¶
MyTime 自定义时间格式
func (MyTime) MarshalJSON ¶
MarshalJSON implements the json Valuer interface
func (*MyTime) UnmarshalJSON ¶
UnmarshalJSON implements the Json interface
type ResourceUsage ¶
ResourceUsage CPU OR Memory
type Stream ¶
type Stream struct { DeviceID string `json:"DeviceID"` //设备编号 ChannelID string `json:"ChannelID"` //通道编号 AudioEnable bool `json:"AudioEnable"` CDN string `json:"CDN"` CascadeSize int `json:"CascadeSize"` ChannelCustomName string `json:"ChannelCustomName"` ChannelName string `json:"ChannelName"` ChannelPTZType int `json:"ChannelPTZType"` Duration int `json:"Duration"` FLV string `json:"FLV"` HLS string `json:"HLS"` InBitRate int `json:"InBitRate"` InBytes int `json:"InBytes"` NumOutputs int `json:"NumOutputs"` Ondemand bool `json:"Ondemand"` OutBytes int `json:"OutBytes"` RTMP string `json:"RTMP"` RTSP string `json:"RTSP"` RecordStartAt string `json:"RecordStartAt"` RelaySize int `json:"RelaySize"` SnapURL string `json:"SnapURL"` SourceAudioCodecName string `json:"SourceAudioCodecName"` SourceAudioSampleRate int `json:"SourceAudioSampleRate"` SourceVideoCodecName string `json:"SourceVideoCodecName"` SourceVideoFrameRate int `json:"SourceVideoFrameRate"` SourceVideoHeight int `json:"SourceVideoHeight"` SourceVideoWidth int `json:"SourceVideoWidth"` StartAt string `json:"StartAt"` StreamID string `json:"StreamID"` Transport string `json:"Transport"` WSFLV string `json:"WS_FLV"` }
type User ¶
type User struct { gorm.Model Username string `form:"username" gorm:"type:varchar(255);unique_index" binding:"required" ` Password string `form:"password" gorm:"type:varchar(255)" binding:"required" ` Role string `form:"-" gorm:"type:varchar(255)"` Enable bool `form:"-" gorm:"DEFAULT:true"` HasAllChannel bool `form:"-" ` Creator string `form:"-" gorm:"type:varchar(255)"` LastLoginAt time.Time `form:"-" ` URLTokenOnly bool `form:"url_token_only" gorm:"-"` }
User 用户信息
Click to show internal directories.
Click to hide internal directories.