forked from mirrors/homebox
feat: debug-endpoints (#110)
* reorg + pprof endpoints * fix spacing issue * fix generation directory
This commit is contained in:
parent
a4b4fe3454
commit
d151d42081
20 changed files with 105 additions and 61 deletions
21
backend/app/api/handlers/v1/partials.go
Normal file
21
backend/app/api/handlers/v1/partials.go
Normal file
|
@ -0,0 +1,21 @@
|
|||
package v1
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/go-chi/chi/v5"
|
||||
"github.com/google/uuid"
|
||||
"github.com/hay-kot/homebox/backend/pkgs/server"
|
||||
"github.com/rs/zerolog/log"
|
||||
)
|
||||
|
||||
func (ctrl *V1Controller) routeID(w http.ResponseWriter, r *http.Request) (uuid.UUID, error) {
|
||||
ID, err := uuid.Parse(chi.URLParam(r, "id"))
|
||||
if err != nil {
|
||||
log.Err(err).Msg("failed to parse id")
|
||||
server.RespondError(w, http.StatusBadRequest, err)
|
||||
return uuid.Nil, err
|
||||
}
|
||||
|
||||
return ID, nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue