mirror of
https://github.com/owncast/owncast.git
synced 2024-11-29 11:39:08 +03:00
32 lines
836 B
Go
32 lines
836 B
Go
package core
|
|
|
|
import (
|
|
"github.com/owncast/owncast/config"
|
|
"github.com/owncast/owncast/models"
|
|
)
|
|
|
|
// GetStatus gets the status of the system.
|
|
func GetStatus() models.Status {
|
|
if _stats == nil {
|
|
return models.Status{}
|
|
}
|
|
|
|
return models.Status{
|
|
Online: IsStreamConnected(),
|
|
ViewerCount: len(_stats.Clients),
|
|
OverallMaxViewerCount: _stats.OverallMaxViewerCount,
|
|
SessionMaxViewerCount: _stats.SessionMaxViewerCount,
|
|
LastDisconnectTime: _stats.LastDisconnectTime,
|
|
LastConnectTime: _stats.LastConnectTime,
|
|
VersionNumber: config.Config.VersionNumber,
|
|
}
|
|
}
|
|
|
|
// setBroadcaster will store the current inbound broadcasting details.
|
|
func setBroadcaster(broadcaster models.Broadcaster) {
|
|
_broadcaster = &broadcaster
|
|
}
|
|
|
|
func GetBroadcaster() *models.Broadcaster {
|
|
return _broadcaster
|
|
}
|