本文整理匯總了Golang中github.com/julienschmidt/httprouter.Router.PATCH方法的典型用法代碼示例。如果您正苦於以下問題:Golang Router.PATCH方法的具體用法?Golang Router.PATCH怎麽用?Golang Router.PATCH使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/julienschmidt/httprouter.Router
的用法示例。
在下文中一共展示了Router.PATCH方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: setup
func setup(router *httprouter.Router) {
router.GET("/api/user", controller.UserGet)
router.GET("/api/user/:id", controller.UserGet)
router.GET("/api/redis/user/:id", controller.RedisUserGet)
router.GET("/api/redis/user", controller.RedisUserGet)
router.PUT("/api/user", controller.UserUpsert)
router.PUT("/api/user/:id", controller.UserUpsert)
router.PUT("/api/redis/user/:id", controller.RedisUserWrite)
router.DELETE("/api/user", controller.UserDelete)
router.DELETE("/api/user/:id", controller.UserDelete)
router.PATCH("/api/user/:id", controller.UserUpdate)
// TOTEC
router.GET("/api/musics", controller.MusicGet)
router.GET("/api/musics/:id", controller.MusicGet)
router.POST("/api/musics", controller.MusicUpsert)
router.PUT("/api/musics/:id", controller.MusicUpsert)
router.DELETE("/api/musics/:id", controller.MusicDelete)
router.POST("/api/musics/:id/play", controller.HistoryUpsert)
}
示例2: PATCH
func PATCH(r *httprouter.Router, path string, handler Handler) {
r.PATCH(path, handle(handler))
}