Skip to content

Commit 922b9fe

Browse files
committed
Remove admin package name stutter from handlers
1 parent 8589ec5 commit 922b9fe

5 files changed

Lines changed: 14 additions & 14 deletions

File tree

internal/server/handlers/admin/admin_logging.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"github.com/glimesh/broadcast-box/internal/server/helpers"
1010
)
1111

12-
func AdminLoggingHandler(responseWriter http.ResponseWriter, request *http.Request) {
12+
func LoggingHandler(responseWriter http.ResponseWriter, request *http.Request) {
1313
if isValidMethod := verifyValidMethod("GET", responseWriter, request); !isValidMethod {
1414
return
1515
}

internal/server/handlers/admin/admin_login.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"github.com/glimesh/broadcast-box/internal/server/helpers"
99
)
1010

11-
func AdminLoginHandler(responseWriter http.ResponseWriter, request *http.Request) {
11+
func LoginHandler(responseWriter http.ResponseWriter, request *http.Request) {
1212
if isValidMethod := verifyValidMethod("POST", responseWriter, request); !isValidMethod {
1313
return
1414
}

internal/server/handlers/admin/admin_profiles.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
)
1111

1212
// Retrieve all existing profiles
13-
func AdminProfilesHandler(responseWriter http.ResponseWriter, request *http.Request) {
13+
func ProfilesHandler(responseWriter http.ResponseWriter, request *http.Request) {
1414
if isValidMethod := verifyValidMethod("GET", responseWriter, request); !isValidMethod {
1515
return
1616
}
@@ -39,7 +39,7 @@ type adminTokenResetPayload struct {
3939
}
4040

4141
// Reset the token of an existing stream profile
42-
func AdminProfilesResetTokenHandler(responseWriter http.ResponseWriter, request *http.Request) {
42+
func ProfilesResetTokenHandler(responseWriter http.ResponseWriter, request *http.Request) {
4343
if isValidMethod := verifyValidMethod("POST", responseWriter, request); !isValidMethod {
4444
return
4545
}
@@ -70,7 +70,7 @@ type adminAddStreamPayload struct {
7070
}
7171

7272
// Reset the token of an existing stream profile
73-
func AdminProfileAddHandler(responseWriter http.ResponseWriter, request *http.Request) {
73+
func ProfileAddHandler(responseWriter http.ResponseWriter, request *http.Request) {
7474
if isValidMethod := verifyValidMethod("POST", responseWriter, request); !isValidMethod {
7575
return
7676
}
@@ -101,7 +101,7 @@ type adminRemoveStreamPayload struct {
101101
}
102102

103103
// Reset the token of an existing stream profile
104-
func AdminProfileRemoveHandler(responseWriter http.ResponseWriter, request *http.Request) {
104+
func ProfileRemoveHandler(responseWriter http.ResponseWriter, request *http.Request) {
105105
if isValidMethod := verifyValidMethod("POST", responseWriter, request); !isValidMethod {
106106
return
107107
}

internal/server/handlers/admin/admin_status.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"github.com/glimesh/broadcast-box/internal/webrtc/sessions/manager"
1010
)
1111

12-
func AdminStatusHandler(responseWriter http.ResponseWriter, request *http.Request) {
12+
func StatusHandler(responseWriter http.ResponseWriter, request *http.Request) {
1313
if isValidMethod := verifyValidMethod("GET", responseWriter, request); !isValidMethod {
1414
return
1515
}

internal/server/handlers/handlers.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ func GetServeMuxHandler() http.HandlerFunc {
3939
serverMux.HandleFunc("/api/status", corsHandler(statusHandler))
4040

4141
// Admin endpoints
42-
serverMux.HandleFunc("/api/admin/login", corsHandler(adminHandlers.AdminLoginHandler))
43-
serverMux.HandleFunc("/api/admin/status", corsHandler(adminHandlers.AdminStatusHandler))
44-
serverMux.HandleFunc("/api/admin/logging", corsHandler(adminHandlers.AdminLoggingHandler))
45-
serverMux.HandleFunc("/api/admin/profiles", corsHandler(adminHandlers.AdminProfilesHandler))
46-
serverMux.HandleFunc("/api/admin/profiles/reset-token", corsHandler(adminHandlers.AdminProfilesResetTokenHandler))
47-
serverMux.HandleFunc("/api/admin/profiles/add-profile", corsHandler(adminHandlers.AdminProfileAddHandler))
48-
serverMux.HandleFunc("/api/admin/profiles/remove-profile", corsHandler(adminHandlers.AdminProfileRemoveHandler))
42+
serverMux.HandleFunc("/api/admin/login", corsHandler(adminHandlers.LoginHandler))
43+
serverMux.HandleFunc("/api/admin/status", corsHandler(adminHandlers.StatusHandler))
44+
serverMux.HandleFunc("/api/admin/logging", corsHandler(adminHandlers.LoggingHandler))
45+
serverMux.HandleFunc("/api/admin/profiles", corsHandler(adminHandlers.ProfilesHandler))
46+
serverMux.HandleFunc("/api/admin/profiles/reset-token", corsHandler(adminHandlers.ProfilesResetTokenHandler))
47+
serverMux.HandleFunc("/api/admin/profiles/add-profile", corsHandler(adminHandlers.ProfileAddHandler))
48+
serverMux.HandleFunc("/api/admin/profiles/remove-profile", corsHandler(adminHandlers.ProfileRemoveHandler))
4949

5050
// Path middleware
5151
debugOutputWebRequests := os.Getenv(environment.DEBUG_INCOMING_API_REQUEST)

0 commit comments

Comments
 (0)