當前位置: 首頁>>代碼示例>>Golang>>正文


Golang Route.Subrouter方法代碼示例

本文整理匯總了Golang中github.com/gorilla/mux.Route.Subrouter方法的典型用法代碼示例。如果您正苦於以下問題:Golang Route.Subrouter方法的具體用法?Golang Route.Subrouter怎麽用?Golang Route.Subrouter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在github.com/gorilla/mux.Route的用法示例。


在下文中一共展示了Route.Subrouter方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: BuildEndpoint

func BuildEndpoint(route *mux.Route, modelName string, jsEngine *js.JSEngine, db *leveldb.DB) {
	router := route.Subrouter()
	router.StrictSlash(true)
	router.HandleFunc("/{id:.+}", buildGetOneHandler(modelName, jsEngine)).Methods("GET")
	router.HandleFunc("/{id:.+}", buildPutOneHandler(modelName, jsEngine)).Methods("PUT")
	router.HandleFunc("/{id:.+}", buildDeleteOneHandler(modelName, jsEngine)).Methods("DELETE")
	router.HandleFunc("/", buildGetAllHandler(modelName, db)).Methods("GET")
	router.HandleFunc("/", buildPostHandler(modelName, jsEngine)).Methods("POST")
}
開發者ID:trusch,項目名稱:restless,代碼行數:9,代碼來源:api.go

示例2: InitEndpointsHandlers

// Init - Initialize application
func InitEndpointsHandlers(globals *config.Globals, parentRotuer *mux.Route) {
	router := parentRotuer.Subrouter()
	router.HandleFunc("/", SecurityContextHandler(endpointsPageHandler, globals, "ADMIN"))
	router.HandleFunc("/{name}", SecurityContextHandler(endpointPageHandler, globals, "ADMIN"))
	router.HandleFunc("/{name}/{action}", SecurityContextHandler(endpointActionPageHandler, globals, "ADMIN"))
}
開發者ID:KarolBedkowski,項目名稱:secproxy,代碼行數:7,代碼來源:endpoints.go

示例3: InitUsersHandlers

// Init - Initialize application
func InitUsersHandlers(globals *config.Globals, parentRotuer *mux.Route) {
	router := parentRotuer.Subrouter()
	router.HandleFunc("/{login}", SecurityContextHandler(userPageHandler, globals, "ADMIN"))
	router.HandleFunc("/", SecurityContextHandler(usersPageHandler, globals, "ADMIN"))
}
開發者ID:KarolBedkowski,項目名稱:secproxy,代碼行數:6,代碼來源:users.go

示例4: InitCertsHandlers

// Init - Initialize application
func InitCertsHandlers(globals *config.Globals, parentRotuer *mux.Route) {
	router := parentRotuer.Subrouter()
	router.HandleFunc("/", SecurityContextHandler(certsPageHandler, globals, "ADMIN"))
	router.HandleFunc("/upload", SecurityContextHandler(certUploadPageHandler, globals, "ADMIN")).Methods("POST")
	router.HandleFunc("/delete", SecurityContextHandler(certDeletePageHandler, globals, "ADMIN"))
}
開發者ID:KarolBedkowski,項目名稱:secproxy,代碼行數:7,代碼來源:certs.go

示例5: InitStatsHandlers

// Init - Initialize application
func InitStatsHandlers(globals *config.Globals, parentRotuer *mux.Route) {
	router := parentRotuer.Subrouter()
	router.HandleFunc("/", SecurityContextHandler(statsPageHandler, globals, ""))
	router.HandleFunc("/server", ContextHandler(statsServerPageHandler, globals))
	router.HandleFunc("/admin", ContextHandler(statsAdminPageHandler, globals))
}
開發者ID:KarolBedkowski,項目名稱:secproxy,代碼行數:7,代碼來源:stats.go

示例6: InitSettingsHandlers

// Init - Initialize application
func InitSettingsHandlers(globals *config.Globals, parentRotuer *mux.Route) {
	router := parentRotuer.Subrouter()
	router.HandleFunc("/", SecurityContextHandler(settingsPageHandler, globals, "ADMIN"))
	router.HandleFunc("/setdebug", SecurityContextHandler(setdebugPageHandler, globals, "ADMIN"))
	router.HandleFunc("/confreload", SecurityContextHandler(confReloadPageHandler, globals, "ADMIN"))
}
開發者ID:KarolBedkowski,項目名稱:secproxy,代碼行數:7,代碼來源:settings.go


注:本文中的github.com/gorilla/mux.Route.Subrouter方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。