mirror of
https://github.com/rancher/steve.git
synced 2025-09-09 11:19:12 +00:00
Refactor
This commit is contained in:
23
pkg/schemaserver/parse/mux.go
Normal file
23
pkg/schemaserver/parse/mux.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package parse
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/rancher/steve/pkg/schemaserver/types"
|
||||
)
|
||||
|
||||
func MuxURLParser(rw http.ResponseWriter, req *http.Request, schemas *types.APISchemas) (ParsedURL, error) {
|
||||
vars := mux.Vars(req)
|
||||
url := ParsedURL{
|
||||
Type: vars["type"],
|
||||
Name: vars["name"],
|
||||
Link: vars["link"],
|
||||
Prefix: vars["prefix"],
|
||||
Method: req.Method,
|
||||
Action: vars["action"],
|
||||
Query: req.URL.Query(),
|
||||
}
|
||||
|
||||
return url, nil
|
||||
}
|
Reference in New Issue
Block a user