add patch method to router.

This commit is contained in:
Maksim Dorokhin 2022-04-14 08:47:47 +00:00
parent 149d74150b
commit f447cabe2e
2 changed files with 5 additions and 0 deletions

View File

@ -48,6 +48,10 @@ func (r *router) Put(pattern string, fn types.RouterHandler) {
r.chi.Put(pattern, routeHandler(fn)) r.chi.Put(pattern, routeHandler(fn))
} }
func (r *router) Patch(pattern string, fn types.RouterHandler) {
r.chi.Patch(pattern, routeHandler(fn))
}
func (r *router) Delete(pattern string, fn types.RouterHandler) { func (r *router) Delete(pattern string, fn types.RouterHandler) {
r.chi.Delete(pattern, routeHandler(fn)) r.chi.Delete(pattern, routeHandler(fn))
} }

View File

@ -14,6 +14,7 @@ type Router interface {
Get(pattern string, fn RouterHandler) Get(pattern string, fn RouterHandler)
Post(pattern string, fn RouterHandler) Post(pattern string, fn RouterHandler)
Put(pattern string, fn RouterHandler) Put(pattern string, fn RouterHandler)
Patch(pattern string, fn RouterHandler)
Delete(pattern string, fn RouterHandler) Delete(pattern string, fn RouterHandler)
With(fn MiddlewareHandler) Router With(fn MiddlewareHandler) Router
WithBypass(fn func(next http.Handler) http.Handler) Router WithBypass(fn func(next http.Handler) http.Handler) Router