コード例 #1
0
ファイル: mux.go プロジェクト: JeanLebrument/TDApiTest
// CurrentRoute returns the matched route for the current request, if any.
func CurrentRoute(r *http.Request) *Route {
	if rv := context.Get(r, routeKey); rv != nil {
		return rv.(*Route)
	}
	return nil
}
コード例 #2
0
ファイル: mux.go プロジェクト: JeanLebrument/TDApiTest
// Vars returns the route variables for the current request, if any.
func Vars(r *http.Request) map[string]string {
	if rv := context.Get(r, varsKey); rv != nil {
		return rv.(map[string]string)
	}
	return nil
}