本文整理匯總了Golang中github.com/gorilla/pat.Router.Get方法的典型用法代碼示例。如果您正苦於以下問題:Golang Router.Get方法的具體用法?Golang Router.Get怎麽用?Golang Router.Get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/gorilla/pat.Router
的用法示例。
在下文中一共展示了Router.Get方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: addDashboardRoutes
func addDashboardRoutes(router *pat.Router) {
router.Get("/dashboard/progress", serve(
dashboardAuth,
getDashboardProgress,
toJson,
))
router.Get("/dashboard/clues", serve(
dashboardAuth,
getDashboardClues,
toJson,
))
router.Put("/dashboard/start_times", serve(
parseRequest(new(setStartTimesReq)),
dashboardAuth,
setStartTimes,
noResponse,
))
router.Put("/dashboard", serve(
parseRequest(new(_DashboardAuthReq)),
dashboardAuth,
))
}
示例2: addClueRoutes
func addClueRoutes(router *pat.Router) {
router.Get("/clue/{clue_id}/hint", serve(
Authenticate(true),
parseFromUrl(urlParams{
"clue_id": parseParamToInt64,
"lat": parseParamToFloat64,
"lng": parseParamToFloat64,
}),
takeHint,
toJson,
))
router.Get("/clue", serve(
Authenticate(true),
parseFromUrl(urlParams{"clue_id": parseParamToInt64}),
currentClue,
toJson,
))
router.Post("/clue/{clue_id}", serve(
Authenticate(true),
parseFromUrl(urlParams{
"clue_id": parseParamToInt64,
}),
parseRequest(new(_SolveClueReq)),
solveClue,
toJson,
))
router.Put("/clue/{clue_id}", serve(
dashboardAuth,
parseRequest(new(record.Clue)),
updateClue,
toJson,
))
}
示例3: addTwilioRoutes
func addTwilioRoutes(router *pat.Router) {
router.Get("/twilio/call", serve(
parseFromUrl(urlParams{"From": parseParamToString}),
handleTwilio,
toXml,
))
}
示例4: addTrackRoutes
func addTrackRoutes(router *pat.Router) {
router.Get("/tracks", serve(
dashboardAuth,
allTracks,
toJson,
))
router.Put("/track/{track_id}/toggle", serve(
dashboardAuth,
parseFromUrl(urlParams{
"track_id": parseParamToInt64,
}),
toggleTrackActivation,
noResponse,
))
}
示例5: normalPing
func normalPing(mux *pat.Router) {
mux.Get("/ping", func(res http.ResponseWriter, req *http.Request) {
res.Write([]byte("pong"))
})
}
示例6: addProgressRoutes
func addProgressRoutes(router *pat.Router) {
router.Get("/progress", getProgress)
}