// Patch registers a `PATCH /resource/:id` handler for the resource
func (res *Resource) Patch(storage store.Update) {
	res.HandleFuncC(
		pat.Patch(patID),
		func(ctx context.Context, w http.ResponseWriter, r *http.Request) {
			res.patchHandler(ctx, w, r, storage)
		},
	)

	res.addRoute(patch, patID)
}
示例#2
0
文件: webdoc.go 项目: donseba/webdoc
func (m *Mux) Patch(pattern string, handler goji.Handler, doc *Doc) {
	muxMap(m, "patch", pattern, handler, doc)
	m.webmux.HandleC(pat.Patch(pattern), handler)
}