// 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)
}
Exemple #2
0
func (m *Mux) Patch(pattern string, handler goji.Handler, doc *Doc) {
	muxMap(m, "patch", pattern, handler, doc)
	m.webmux.HandleC(pat.Patch(pattern), handler)
}