mirror of
https://github.com/rancher/steve.git
synced 2025-04-27 19:05:09 +00:00
24 lines
464 B
Go
24 lines
464 B
Go
|
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
|
||
|
}
|