owncast/core/status.go

33 lines
836 B
Go
Raw Normal View History

package core
import (
2020-11-04 04:34:25 +03:00
"github.com/owncast/owncast/config"
"github.com/owncast/owncast/models"
)
2020-11-13 02:14:59 +03:00
// 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,
2020-11-04 04:34:25 +03:00
VersionNumber: config.Config.VersionNumber,
}
}
2020-11-13 02:14:59 +03:00
// setBroadcaster will store the current inbound broadcasting details.
func setBroadcaster(broadcaster models.Broadcaster) {
_broadcaster = &broadcaster
}
func GetBroadcaster() *models.Broadcaster {
return _broadcaster
}