0
owncast/core/status.go
Gabe Kangas 3963568951
Stop rtmp from reaching back into core (#290)
* Stop rtmp from reaching back into core.

* Un-export since these functions no longer need to be public
2020-10-29 14:09:28 -07:00

31 lines
742 B
Go

package core
import (
"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,
}
}
// setBroadcaster will store the current inbound broadcasting details
func setBroadcaster(broadcaster models.Broadcaster) {
_broadcaster = &broadcaster
}
func GetBroadcaster() *models.Broadcaster {
return _broadcaster
}