本文整理汇总了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))
}