Skip to content

Commit 2573e6c

Browse files
authored
refactor(ipc)!: convert restful api from camel case to kebab case (#47)
Signed-off-by: Kevin Cui <[email protected]>
1 parent 32d8ddc commit 2573e6c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/ipc/restful/restful.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func (s *Restful) mux() *http.ServeMux {
8484
http.Error(w, err.Error(), http.StatusInternalServerError)
8585
}
8686
})
87-
mux.HandleFunc("/requestStop", func(w http.ResponseWriter, r *http.Request) {
87+
mux.HandleFunc("/request-stop", func(w http.ResponseWriter, r *http.Request) {
8888
if r.Method != http.MethodPost {
8989
http.Error(w, "post only", http.StatusBadRequest)
9090
return
@@ -104,15 +104,15 @@ func (s *Restful) mux() *http.ServeMux {
104104
http.Error(w, err.Error(), http.StatusInternalServerError)
105105
}
106106
})
107-
mux.HandleFunc("/startPowerSaveMode", func(w http.ResponseWriter, r *http.Request) {
107+
mux.HandleFunc("/start-power-save-mode", func(w http.ResponseWriter, r *http.Request) {
108108
if r.Method != http.MethodPut {
109109
http.Error(w, "put only", http.StatusBadRequest)
110110
return
111111
}
112112

113113
s.startPowerSaveMode()
114114
})
115-
mux.HandleFunc("/stopPowerSaveMode", func(w http.ResponseWriter, r *http.Request) {
115+
mux.HandleFunc("/stop-power-save-mode", func(w http.ResponseWriter, r *http.Request) {
116116
if r.Method != http.MethodPut {
117117
http.Error(w, "put only", http.StatusBadRequest)
118118
return

0 commit comments

Comments
 (0)