1
0
mirror of https://github.com/rancher/steve.git synced 2025-04-27 19:05:09 +00:00
steve/pkg/schemaserver/parse/mux.go

24 lines
464 B
Go
Raw Normal View History

2020-01-31 05:37:59 +00:00
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
}