Fix godoc style comments (#356)

This commit is contained in:
Christian Muehlhaeuser
2020-11-13 00:14:59 +01:00
committed by GitHub
parent 8f921fbfde
commit 2e1f8d29b5
59 changed files with 147 additions and 147 deletions

View File

@@ -6,7 +6,7 @@ import (
"github.com/owncast/owncast/core/rtmp"
)
// DisconnectInboundConnection will force-disconnect an inbound stream
// DisconnectInboundConnection will force-disconnect an inbound stream.
func DisconnectInboundConnection(w http.ResponseWriter, r *http.Request) {
rtmp.Disconnect()
w.WriteHeader(http.StatusOK)

View File

@@ -10,7 +10,7 @@ import (
log "github.com/sirupsen/logrus"
)
// ChangeExtraPageContent will change the optional page content
// ChangeExtraPageContent will change the optional page content.
func ChangeExtraPageContent(w http.ResponseWriter, r *http.Request) {
if r.Method != "POST" {
controllers.WriteSimpleResponse(w, false, r.Method+" not supported")

View File

@@ -10,7 +10,7 @@ import (
log "github.com/sirupsen/logrus"
)
// ChangeStreamKey will change the stream key (in memory)
// ChangeStreamKey will change the stream key (in memory).
func ChangeStreamKey(w http.ResponseWriter, r *http.Request) {
if r.Method != "POST" {
controllers.WriteSimpleResponse(w, false, r.Method+" not supported")

View File

@@ -9,7 +9,7 @@ import (
"github.com/owncast/owncast/core/rtmp"
)
// DisconnectInboundConnection will force-disconnect an inbound stream
// DisconnectInboundConnection will force-disconnect an inbound stream.
func DisconnectInboundConnection(w http.ResponseWriter, r *http.Request) {
if !core.GetStatus().Online {
controllers.WriteSimpleResponse(w, false, "no inbound stream connected")

View File

@@ -7,7 +7,7 @@ import (
"github.com/owncast/owncast/metrics"
)
// GetHardwareStats will return hardware utilization over time
// GetHardwareStats will return hardware utilization over time.
func GetHardwareStats(w http.ResponseWriter, r *http.Request) {
m := metrics.Metrics

View File

@@ -11,7 +11,7 @@ import (
log "github.com/sirupsen/logrus"
)
// ServeAdmin will return admin web assets
// ServeAdmin will return admin web assets.
func ServeAdmin(w http.ResponseWriter, r *http.Request) {
// Set a cache control max-age header
middleware.SetCachingHeaders(w, r)

View File

@@ -9,7 +9,7 @@ import (
"github.com/sirupsen/logrus"
)
// GetLogs will return all logs
// GetLogs will return all logs.
func GetLogs(w http.ResponseWriter, r *http.Request) {
logs := logging.Logger.AllEntries()
response := make([]logsResponse, 0)
@@ -22,7 +22,7 @@ func GetLogs(w http.ResponseWriter, r *http.Request) {
json.NewEncoder(w).Encode(response)
}
// GetWarnings will return only warning and error logs
// GetWarnings will return only warning and error logs.
func GetWarnings(w http.ResponseWriter, r *http.Request) {
logs := logging.Logger.WarningEntries()
response := make([]logsResponse, 0)

View File

@@ -7,7 +7,7 @@ import (
"github.com/owncast/owncast/config"
)
// GetServerConfig gets the config details of the server
// GetServerConfig gets the config details of the server.
func GetServerConfig(w http.ResponseWriter, r *http.Request) {
var videoQualityVariants = make([]config.StreamQuality, 0)
for _, variant := range config.Config.GetVideoStreamQualities() {

View File

@@ -9,7 +9,7 @@ import (
"github.com/owncast/owncast/models"
)
// Status gets the details of the inbound broadcaster
// Status gets the details of the inbound broadcaster.
func Status(w http.ResponseWriter, r *http.Request) {
broadcaster := core.GetBroadcaster()
status := core.GetStatus()

View File

@@ -7,7 +7,7 @@ import (
"github.com/owncast/owncast/metrics"
)
// GetViewersOverTime will return the number of viewers at points in time
// GetViewersOverTime will return the number of viewers at points in time.
func GetViewersOverTime(w http.ResponseWriter, r *http.Request) {
viewersOverTime := metrics.Metrics.Viewers
w.Header().Set("Content-Type", "application/json")

View File

@@ -9,7 +9,7 @@ import (
"github.com/owncast/owncast/router/middleware"
)
//GetChatMessages gets all of the chat messages
// GetChatMessages gets all of the chat messages.
func GetChatMessages(w http.ResponseWriter, r *http.Request) {
middleware.EnableCors(&w)

View File

@@ -8,7 +8,7 @@ import (
"github.com/owncast/owncast/router/middleware"
)
//GetWebConfig gets the status of the server
// GetWebConfig gets the status of the server.
func GetWebConfig(w http.ResponseWriter, r *http.Request) {
middleware.EnableCors(&w)

View File

@@ -7,7 +7,7 @@ import (
"github.com/owncast/owncast/core"
)
// GetConnectedClients returns currently connected clients
// GetConnectedClients returns currently connected clients.
func GetConnectedClients(w http.ResponseWriter, r *http.Request) {
clients := core.GetClients()
w.Header().Set("Content-Type", "application/json")

View File

@@ -4,12 +4,12 @@ import (
"net/http"
)
//GetChatEmbed gets the embed for chat
// GetChatEmbed gets the embed for chat.
func GetChatEmbed(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, "/index-standalone-chat.html", http.StatusMovedPermanently)
}
//GetVideoEmbed gets the embed for video
// GetVideoEmbed gets the embed for video.
func GetVideoEmbed(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, "/index-video-only.html", http.StatusMovedPermanently)
}

View File

@@ -17,7 +17,7 @@ import (
// to need it to be. The config is getting a bit bloated.
const emojiDir = "/img/emoji" // Relative to webroot
//GetCustomEmoji returns a list of custom emoji via the API
// GetCustomEmoji returns a list of custom emoji via the API.
func GetCustomEmoji(w http.ResponseWriter, r *http.Request) {
emojiList := make([]models.CustomEmoji, 0)

View File

@@ -25,7 +25,7 @@ type MetadataPage struct {
TagsString string
}
//IndexHandler handles the default index route
// IndexHandler handles the default index route.
func IndexHandler(w http.ResponseWriter, r *http.Request) {
middleware.EnableCors(&w)
isIndexRequest := r.URL.Path == "/" || filepath.Base(r.URL.Path) == "index.html" || filepath.Base(r.URL.Path) == ""

View File

@@ -8,7 +8,7 @@ import (
"github.com/owncast/owncast/router/middleware"
)
//GetStatus gets the status of the server
// GetStatus gets the status of the server.
func GetStatus(w http.ResponseWriter, r *http.Request) {
middleware.EnableCors(&w)