{"id":371012,"date":"2024-05-21T04:38:31","date_gmt":"2024-05-21T04:38:31","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=371012"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=371012","title":{"rendered":"<span>\u041f\u0440\u043e\u0441\u0442\u043e\u0439 CRUD \u043d\u0430 chi. \u0427\u0430\u0441\u0442\u044c 1<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e <a href=\"https:\/\/go-chi.io\/#\/README\" rel=\"noopener noreferrer nofollow\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0441\u0430\u0439\u0442\u0443<\/a>,  chi  \u2014 \u044d\u0442\u043e \u043b\u0435\u0433\u043a\u043e\u0432\u0435\u0441\u043d\u044b\u0439, \u0438\u0434\u0438\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0438 \u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f HTTP-\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u043d\u0430 Go. \u041e\u043d \u043d\u0430 100% \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c \u0441 <code>net\/http<\/code> \u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043b\u0435\u0433\u043e\u043a \u0432 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438, \u043e\u0434\u043d\u0430\u043a\u043e \u0435\u0433\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0430 \u0441\u043a\u043e\u0440\u0435\u0435 \u0434\u043b\u044f \u043e\u043f\u044b\u0442\u043d\u044b\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432, \u0447\u0435\u043c \u0434\u043b\u044f \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0440\u0435\u0448\u0438\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0435\u0440\u0438\u044e \u0441\u0442\u0430\u0442\u0435\u0439, \u0432 \u0445\u043e\u0434\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0442\u044c \u0438 \u043f\u0435\u0440\u0435\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 CRUD, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 chi.<\/p>\n<p>\u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u0434\u0430\u043d\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043b\u044f\u0436\u0435\u0442 \u0432 \u043e\u0441\u043d\u043e\u0432\u0443 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0445 \u0441\u0442\u0430\u0442\u0435\u0439. \u042d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u0432 \u0447\u0435\u043c-\u0442\u043e \u0434\u0430\u0436\u0435 \u0433\u0440\u044f\u0437\u043d\u044b\u0439 \u043a\u043e\u0434, \u043d\u043e \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0430\u0432\u0442\u043e\u0440 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0435\u043c \u043c\u043e\u0433 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0442 \u0447\u0430\u0441\u0442\u0438 \u043a \u0447\u0430\u0441\u0442\u0438. \u041a\u043e\u0434 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043f\u043e \u043c\u0435\u0440\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0432 <a href=\"https:\/\/github.com\/Brom95\/chi-crud\/\" rel=\"noopener noreferrer nofollow\">\u044d\u0442\u043e\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438<\/a> \u0438  \u043f\u043e\u043c\u0435\u0449\u0430\u0442\u044c\u0441\u044f \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0432\u0435\u0442\u043a\u0443, \u0430 \u0432\u0435\u0441\u044c \u043a\u043e\u0434, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438, \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 <a href=\"https:\/\/github.com\/Brom95\/chi-crud\/tree\/1-simple\" rel=\"noopener noreferrer nofollow\">\u044d\u0442\u043e\u0439 \u0432\u0435\u0442\u043a\u0435<\/a>.<\/p>\n<h2>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430<\/h2>\n<p>\u041d\u0430\u0448 CRUD \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0442\u044c \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b:<\/p>\n<pre><code class=\"go\">type CrudItem struct { \u00a0 \u00a0 Id \u00a0 \u00a0 \u00a0 \u00a0 \u00a0int \u00a0 \u00a0 Name \u00a0 \u00a0 \u00a0 \u00a0string \u00a0 \u00a0 Description string \u00a0 \u00a0 internal \u00a0 \u00a0string } <\/code><\/pre>\n<p>\u0417\u0430 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u0432\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435:<\/p>\n<pre><code class=\"go\">currentId := 1 storage := make(map[int]CrudItem) <\/code><\/pre>\n<p>\u0421\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0432 \u043a\u0430\u0440\u0442\u0435\/\u0441\u043b\u043e\u0432\u0430\u0440\u0435 (\u0432\u0430\u043c \u043a\u0430\u043a \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f?). \u041f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435, \u043e\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e \u043a\u043b\u044e\u0447\u0443 <code>currentId<\/code>. \u042f \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0447\u0435\u0440\u043a\u043d\u0443\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441 \u0437\u0430\u043f\u0430\u0445\u043e\u043c \u0438 \u043d\u0435 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043e \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0447\u0430\u0441\u0442\u044f\u0445 \u043c\u044b \u043e\u0442\u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f, \u0432\u044b\u043d\u0435\u0441\u0435\u043c \u0435\u0433\u043e \u0437\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0438 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0435\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u043c (\u043d\u043e \u043d\u0435 \u0441\u0435\u0433\u043e\u0434\u043d\u044f).<\/p>\n<h2>CRUD<\/h2>\n<p>\u041f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c chi \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"go\">package main import ( \u00a0 \u00a0 \"net\/http\" \u00a0 \u00a0 \"github.com\/go-chi\/chi\/v5\" )    func main() { \u00a0 \u00a0 r := chi.NewRouter() \u00a0 \u00a0 http.ListenAndServe(\":3000\", r) } <\/code><\/pre>\n<p>\u041e\u043d\u0430 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u0442, \u043a\u0440\u043e\u043c\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0435\u0433\u043e \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u043d\u0430 \u0442\u0440\u0435\u0445\u0442\u044b\u0441\u044f\u0447\u043d\u043e\u043c \u043f\u043e\u0440\u0442\u0443.<br \/> \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0435\u0433\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0438 \u043d\u0430\u0432\u0435\u0448\u0438\u0432\u0430\u043d\u0438\u0435 \u0435\u0433\u043e \u043d\u0430 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u043f\u0443\u0442\u0438 \u0432 chi \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<ol>\n<li>\n<p>\u0412\u044b\u0431\u0440\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 \u043c\u0430\u0440\u0448\u0442\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440\u0430, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u043c\u0443 HTTP-\u043c\u0435\u0442\u043e\u0434\u0443<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0432 \u043d\u0435\u0433\u043e \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u043f\u0443\u0442\u0438 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a <code>http.HandlerFunc<\/code> (\u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0441 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u043e\u0439 <code>\u00a0func(w http.ResponseWriter, r *http.Request)<\/code>). \u0418\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u043d\u0430\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 HTTP-\u043c\u0435\u0442\u043e\u0434\u044b:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"go\">Connect(pattern string, h http.HandlerFunc) Delete(pattern string, h http.HandlerFunc) Get(pattern string, h http.HandlerFunc) Head(pattern string, h http.HandlerFunc) Options(pattern string, h http.HandlerFunc) Patch(pattern string, h http.HandlerFunc) Post(pattern string, h http.HandlerFunc) Put(pattern string, h http.HandlerFunc) Trace(pattern string, h http.HandlerFunc) <\/code><\/pre>\n<p>\u042d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e CRUD-\u0430, \u043d\u043e \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u0433\u043e HTTP-\u043c\u0435\u0442\u043e\u0434\u0430, \u0442\u043e \u0432\u0430\u043c \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e  <code>chi.RegisterMethod(\"JELLO\")<\/code>, \u0430 \u0437\u0430\u0442\u0435\u043c \u043d\u0430\u0432\u0435\u0441\u0438\u0442\u044c \u043d\u0430 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u043f\u0443\u0442\u0438 \u0432 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>r.Method(\"JELLO\", \"\/path\", myJelloMethodHandler)<\/code>.<\/p>\n<h3>Create<\/h3>\n<p>\u041a\u043e\u0434 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e <code>CrudItem<\/code> \u0432 \u043d\u0430\u0448\u0435 \u0438\u043c\u043f\u0440\u043e\u0432\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"go\">r.Post(\"\/crud-items\/\", func(w http.ResponseWriter, r *http.Request) { \u00a0 \u00a0 \u00a0 \u00a0 var item CrudItem \u00a0 \u00a0 \u00a0 \u00a0 err := json.NewDecoder(r.Body).Decode(&amp;item) \u00a0 \u00a0 \u00a0 \u00a0 if err != nil { \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 w.WriteHeader(http.StatusBadRequest) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 w.Write([]byte(err.Error())) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 return \u00a0 \u00a0 \u00a0 \u00a0 } \u00a0 \u00a0 \u00a0 \u00a0 item.Id = currentId \u00a0 \u00a0 \u00a0 \u00a0 storage[currentId] = item \u00a0 \u00a0 \u00a0 \u00a0 jsonItem, err := json.Marshal(item) \u00a0 \u00a0 \u00a0 \u00a0 if err != nil { \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 w.WriteHeader(http.StatusInternalServerError) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 w.Write([]byte(err.Error())) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 return \u00a0 \u00a0 \u00a0 \u00a0 } \u00a0 \u00a0 \u00a0 \u00a0 w.Write(jsonItem) \u00a0 \u00a0 \u00a0 \u00a0 currentId += 1 \u00a0 \u00a0 }) <\/code><\/pre>\n<p>\u0427\u0442\u043e \u0438\u0437 \u0441\u0435\u0431\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u0448\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430:<\/p>\n<ol>\n<li>\n<p>\u041f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0438\u0437 \u0442\u0435\u043b\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 json \u0438 \u0434\u0435\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 <code>CrudItem<\/code>. \u0412\u0430\u043b\u0438\u0434\u043d\u044b\u0439 JSON \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"json\">{ \"name\": \"New name\", \"description\": \"New description\" } <\/code><\/pre>\n<ol start=\"2\">\n<li>\n<p>\u0415\u0441\u043b\u0438 \u043f\u043e \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u043d\u0430\u043c \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u043c\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0441 \u0435\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c \u0447\u0442\u043e-\u0442\u043e \u043d\u0435 \u0442\u0430\u043a \u0438 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0443.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u043c \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 <code>Id<\/code> \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0432 \u043d\u0430\u0448\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435. \u0425\u043e\u0434\u044f\u0442 \u043b\u0435\u0433\u0435\u043d\u0434\u044b, \u0447\u0442\u043e \u0432 \u0445\u043e\u0440\u043e\u0448\u0438\u0445 CRUD-\u0430\u0445 \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u043d\u044b\u043c\u0438 \u0435\u043c\u0443 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430\u043c\u0438, \u0438 \u043c\u044b \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u0435\u043c \u0442\u0430\u043a \u0436\u0435:<\/p>\n<\/li>\n<li>\n<p>\u0421\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 <code>CrudItem<\/code> \u0432 json;<\/p>\n<\/li>\n<li>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u043e\u0432\u0430\u043b\u0430 \u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e, \u0447\u0442\u043e \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0448\u043b\u043e \u043d\u0435 \u0442\u0430\u043a \u043f\u043e \u043d\u0430\u0448\u0435\u0439 \u0432\u0438\u043d\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u0441\u043f\u0435\u0445\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e json \u0438 \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u043c \u0442\u0435\u043a\u0443\u0449\u0438\u0439 <code>Id<\/code>.<\/p>\n<\/li>\n<\/ol>\n<h3>Read<\/h3>\n<p>\u0427\u0442\u0435\u043d\u0438\u0435 \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0434\u0432\u0443\u043c\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438:<\/p>\n<ul>\n<li>\n<p>\u041f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432\u0441\u0435 \u0437\u0430\u043f\u0438\u0441\u0438;<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439, \u043d\u043e \u043f\u043e\u043a\u0430 \u043e\u043d \u043d\u0430\u043c \u043d\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0435\u043d &#8212; \u043e\u043d \u043d\u0443\u0436\u0435\u043d \u043d\u0430\u043c \u0434\u043b\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0447\u0430\u0441\u0442\u0435\u0439:<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"go\">r.Get(\"\/crud-items\/\", func(w http.ResponseWriter, r *http.Request) { \u00a0 \u00a0 \u00a0 \u00a0 result := make([]CrudItem, 0, len(storage)) \u00a0 \u00a0 \u00a0 \u00a0 for _, item := range storage { \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 result = append(result, item) \u00a0 \u00a0 \u00a0 \u00a0 } \u00a0 \u00a0 \u00a0 \u00a0 resultJson, err := json.Marshal(result) \u00a0 \u00a0 \u00a0 \u00a0 if err != nil { \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 w.WriteHeader(http.StatusInternalServerError) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 w.Write([]byte(err.Error())) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 return \u00a0 \u00a0 \u00a0 \u00a0 } \u00a0 \u00a0 \u00a0 \u00a0 w.Write(resultJson) \u00a0 \u00a0 }) <\/code><\/pre>\n<p>\u0413\u043e\u0440\u0430\u0437\u0434\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u043f\u043e <code>Id<\/code>:<\/p>\n<pre><code class=\"go\">r.Get(\"\/crud-items\/{id}\", func(w http.ResponseWriter, r *http.Request) { \u00a0 \u00a0 \u00a0 \u00a0 idStr := chi.URLParam(r, \"id\") \u00a0 \u00a0 \u00a0 \u00a0 id, err := strconv.Atoi(idStr) \u00a0 \u00a0 \u00a0 \u00a0 if err != nil { \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 w.WriteHeader(http.StatusBadRequest) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 w.Write([]byte(err.Error())) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 return \u00a0 \u00a0 \u00a0 \u00a0 } \u00a0 \u00a0 \u00a0 \u00a0 if _, ok := storage[id]; !ok { \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 w.WriteHeader(http.StatusNotFound) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 return \u00a0 \u00a0 \u00a0 \u00a0 } \u00a0 \u00a0 \u00a0 \u00a0 resultJson, err := json.Marshal(storage[id]) \u00a0 \u00a0 \u00a0 \u00a0 if err != nil { \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 w.WriteHeader(http.StatusInternalServerError) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 w.Write([]byte(err.Error())) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 return \u00a0 \u00a0 \u00a0 \u00a0 } \u00a0 \u00a0 \u00a0 \u00a0 w.Write(resultJson) \u00a0 \u00a0 }) <\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435\u043c <code>id<\/code>  \u0437\u0430\u043f\u0438\u0441\u0438 \u0438\u0437 URL. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b:<\/p>\n<ol>\n<li>\n<p>\u0417\u0430\u0434\u0430\u043b\u0438 \u0432 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0435 \u043f\u0443\u0442\u0438 \u0438\u043c\u0435\u043d\u043d\u043e\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>id<\/code> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>{id}<\/code>;<\/p>\n<\/li>\n<li>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>chi.URLParam(r, \"id\")<\/code> \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 <code>id<\/code>;<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b\u0438 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>id<\/code> \u043a \u0446\u0435\u043b\u043e\u043c\u0443 \u0447\u0438\u0441\u043b\u0443 \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u043e\u0432\u0430\u043b\u0430 \u0441\u043e\u043e\u0431\u0449\u0438\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e, \u0447\u0442\u043e \u0441 \u0435\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c \u0447\u0442\u043e-\u0442\u043e \u043d\u0435 \u0442\u0430\u043a.<\/p>\n<\/li>\n<\/ol>\n<h3>Update<\/h3>\n<p>\u041e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u043f\u043e <code>id<\/code> \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u043e\u0440\u0443\u0434\u0438\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0438\u0441\u0438:<\/p>\n<pre><code class=\"go\">r.Put(\"\/crud-items\/{id}\", func(w http.ResponseWriter, r *http.Request) { \u00a0 \u00a0 \u00a0 \u00a0 idStr := chi.URLParam(r, \"id\") \u00a0 \u00a0 \u00a0 \u00a0 id, err := strconv.Atoi(idStr) \u00a0 \u00a0 \u00a0 \u00a0 if err != nil { \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 w.WriteHeader(http.StatusBadRequest) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 w.Write([]byte(err.Error())) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 return \u00a0 \u00a0 \u00a0 \u00a0 } \u00a0 \u00a0 \u00a0 \u00a0 if _, ok := storage[id]; !ok { \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 w.WriteHeader(http.StatusNotFound) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 return \u00a0 \u00a0 \u00a0 \u00a0 } \u00a0 \u00a0 \u00a0 \u00a0 var item CrudItem \u00a0 \u00a0 \u00a0 \u00a0 err = json.NewDecoder(r.Body).Decode(&amp;item) \u00a0 \u00a0 \u00a0 \u00a0 if err != nil { \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 w.WriteHeader(http.StatusBadRequest) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 w.Write([]byte(err.Error())) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 return \u00a0 \u00a0 \u00a0 \u00a0 } \u00a0 \u00a0 \u00a0 \u00a0 item.Id = id \u00a0 \u00a0 \u00a0 \u00a0 storage[id] = item \u00a0 \u00a0 \u00a0 \u00a0 jsonItem, err := json.Marshal(item) \u00a0 \u00a0 \u00a0 \u00a0 if err != nil { \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 w.WriteHeader(http.StatusInternalServerError) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 w.Write([]byte(err.Error())) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 return \u00a0 \u00a0 \u00a0 \u00a0 } \u00a0 \u00a0 \u00a0 \u00a0 w.Write(jsonItem) \u00a0 \u00a0 }) <\/code><\/pre>\n<h3>Delete<\/h3>\n<p>\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0438\u0437 \u043d\u0430\u0448\u0435\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"go\">r.Delete(\"\/crud-items\/{id}\", func(w http.ResponseWriter, r *http.Request) { \u00a0 \u00a0 \u00a0 \u00a0 idStr := chi.URLParam(r, \"id\") \u00a0 \u00a0 \u00a0 \u00a0 id, err := strconv.Atoi(idStr) \u00a0 \u00a0 \u00a0 \u00a0 if err != nil { \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 w.WriteHeader(http.StatusBadRequest) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 w.Write([]byte(err.Error())) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 return \u00a0 \u00a0 \u00a0 \u00a0 } \u00a0 \u00a0 \u00a0 \u00a0  \u00a0 \u00a0 \u00a0 \u00a0 if _, ok := storage[id]; !ok { \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 w.WriteHeader(http.StatusNotFound) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 return \u00a0 \u00a0 \u00a0 \u00a0 } \u00a0 \u00a0 \u00a0 \u00a0 delete(storage, id) \u00a0 \u00a0 }) <\/code><\/pre>\n<p>\u041f\u043e \u0441\u0443\u0442\u0438, \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u044d\u0442\u043e \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0441\u043b\u043e\u0432\u0430\u0440\u044f \u0441 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430.<\/p>\n<h2>\u0427\u0442\u043e \u0434\u0430\u043b\u044c\u0448\u0435?<\/h2>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0438 CRUD \u0441 5-\u044e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440 chi, \u043d\u0430\u0443\u0447\u0438\u043b\u0438\u0441\u044c \u0447\u0438\u0442\u0430\u0442\u044c json \u0438\u0437 \u0442\u0435\u043b\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0435\u0433\u043e \u0432 \u043e\u0442\u0432\u0435\u0442 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 \u043f\u0443\u0442\u0438.<br \/> \u0427\u0435\u043c\u0443 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0442\u0430\u0442\u044c\u0438:<\/p>\n<ul>\n<li>\n<p>\u0420\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \u0438 \u0432\u044b\u043d\u043e\u0441 \u0435\u0433\u043e \u0437\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441;<\/p>\n<\/li>\n<li>\n<p>\u041f\u0430\u0433\u0438\u043d\u0430\u0446\u0438\u044f \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c middleware;<\/p>\n<\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 <code>Renderer<\/code> \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0445 DTO;<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f;<\/p>\n<\/li>\n<li>\n<p>\u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f;<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 prometeus (\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 middleware \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u043f\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c). <\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u0432\u043e\u0438 \u0438\u0434\u0435\u0438, \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0438\u043b\u0438 \u043c\u043d\u0435 \u0432 <a href=\"https:\/\/t.me\/brom_samedi\" rel=\"noopener noreferrer nofollow\">\u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c<\/a>.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/800787\/\"> https:\/\/habr.com\/ru\/articles\/800787\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e <a href=\"https:\/\/go-chi.io\/#\/README\" rel=\"noopener noreferrer nofollow\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0441\u0430\u0439\u0442\u0443<\/a>,  chi  \u2014 \u044d\u0442\u043e \u043b\u0435\u0433\u043a\u043e\u0432\u0435\u0441\u043d\u044b\u0439, \u0438\u0434\u0438\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0438 \u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f HTTP-\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u043d\u0430 Go. \u041e\u043d \u043d\u0430 100% \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c \u0441 <code>net\/http<\/code> \u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043b\u0435\u0433\u043e\u043a \u0432 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438, \u043e\u0434\u043d\u0430\u043a\u043e \u0435\u0433\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0430 \u0441\u043a\u043e\u0440\u0435\u0435 \u0434\u043b\u044f \u043e\u043f\u044b\u0442\u043d\u044b\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432, \u0447\u0435\u043c \u0434\u043b\u044f \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0440\u0435\u0448\u0438\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0435\u0440\u0438\u044e \u0441\u0442\u0430\u0442\u0435\u0439, \u0432 \u0445\u043e\u0434\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0442\u044c \u0438 \u043f\u0435\u0440\u0435\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 CRUD, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 chi.<\/p>\n<p>\u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u0434\u0430\u043d\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043b\u044f\u0436\u0435\u0442 \u0432 \u043e\u0441\u043d\u043e\u0432\u0443 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0445 \u0441\u0442\u0430\u0442\u0435\u0439. \u042d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u0432 \u0447\u0435\u043c-\u0442\u043e \u0434\u0430\u0436\u0435 \u0433\u0440\u044f\u0437\u043d\u044b\u0439 \u043a\u043e\u0434, \u043d\u043e \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0430\u0432\u0442\u043e\u0440 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0435\u043c \u043c\u043e\u0433 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0442 \u0447\u0430\u0441\u0442\u0438 \u043a \u0447\u0430\u0441\u0442\u0438. \u041a\u043e\u0434 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043f\u043e \u043c\u0435\u0440\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0432 <a href=\"https:\/\/github.com\/Brom95\/chi-crud\/\" rel=\"noopener noreferrer nofollow\">\u044d\u0442\u043e\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438<\/a> \u0438  \u043f\u043e\u043c\u0435\u0449\u0430\u0442\u044c\u0441\u044f \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0432\u0435\u0442\u043a\u0443, \u0430 \u0432\u0435\u0441\u044c \u043a\u043e\u0434, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438, \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 <a href=\"https:\/\/github.com\/Brom95\/chi-crud\/tree\/1-simple\" rel=\"noopener noreferrer nofollow\">\u044d\u0442\u043e\u0439 \u0432\u0435\u0442\u043a\u0435<\/a>.<\/p>\n<h2>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430<\/h2>\n<p>\u041d\u0430\u0448 CRUD \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0442\u044c \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b:<\/p>\n<pre><code class=\"go\">type CrudItem struct { \u00a0 \u00a0 Id \u00a0 \u00a0 \u00a0 \u00a0 \u00a0int \u00a0 \u00a0 Name \u00a0 \u00a0 \u00a0 \u00a0string \u00a0 \u00a0 Description string \u00a0 \u00a0 internal \u00a0 \u00a0string } <\/code><\/pre>\n<p>\u0417\u0430 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u0432\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435:<\/p>\n<pre><code class=\"go\">currentId := 1 storage := make(map[int]CrudItem) <\/code><\/pre>\n<p>\u0421\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0432 \u043a\u0430\u0440\u0442\u0435\/\u0441\u043b\u043e\u0432\u0430\u0440\u0435 (\u0432\u0430\u043c \u043a\u0430\u043a \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f?). \u041f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435, \u043e\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e \u043a\u043b\u044e\u0447\u0443 <code>currentId<\/code>. \u042f \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0447\u0435\u0440\u043a\u043d\u0443\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441 \u0437\u0430\u043f\u0430\u0445\u043e\u043c \u0438 \u043d\u0435 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043e \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0447\u0430\u0441\u0442\u044f\u0445 \u043c\u044b \u043e\u0442\u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f, \u0432\u044b\u043d\u0435\u0441\u0435\u043c \u0435\u0433\u043e \u0437\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0438 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0435\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u043c (\u043d\u043e \u043d\u0435 \u0441\u0435\u0433\u043e\u0434\u043d\u044f).<\/p>\n<h2>CRUD<\/h2>\n<p>\u041f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c chi \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"go\">package main import ( \u00a0 \u00a0 \"net\/http\" \u00a0 \u00a0 \"github.com\/go-chi\/chi\/v5\" )    func main() { \u00a0 \u00a0 r := chi.NewRouter() \u00a0 \u00a0 http.ListenAndServe(\":3000\", r) } <\/code><\/pre>\n<p>\u041e\u043d\u0430 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u0442, \u043a\u0440\u043e\u043c\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0435\u0433\u043e \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u043d\u0430 \u0442\u0440\u0435\u0445\u0442\u044b\u0441\u044f\u0447\u043d\u043e\u043c \u043f\u043e\u0440\u0442\u0443.<br \/> \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0435\u0433\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0438 \u043d\u0430\u0432\u0435\u0448\u0438\u0432\u0430\u043d\u0438\u0435 \u0435\u0433\u043e \u043d\u0430 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u043f\u0443\u0442\u0438 \u0432 chi \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<ol>\n<li>\n<p>\u0412\u044b\u0431\u0440\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 \u043c\u0430\u0440\u0448\u0442\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440\u0430, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u043c\u0443 HTTP-\u043c\u0435\u0442\u043e\u0434\u0443<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0432 \u043d\u0435\u0433\u043e \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u043f\u0443\u0442\u0438 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a <code>http.HandlerFunc<\/code> (\u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0441 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u043e\u0439 <code>\u00a0func(w http.ResponseWriter, r *http.Request)<\/code>). \u0418\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u043d\u0430\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 HTTP-\u043c\u0435\u0442\u043e\u0434\u044b:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"go\">Connect(pattern string, h http.HandlerFunc) Delete(pattern string, h http.HandlerFunc) Get(pattern string, h http.HandlerFunc) Head(pattern string, h http.HandlerFunc) Options(pattern string, h http.HandlerFunc) Patch(pattern string, h http.HandlerFunc) Post(pattern string, h http.HandlerFunc) Put(pattern string, h http.HandlerFunc) Trace(pattern string, h http.HandlerFunc) <\/code><\/pre>\n<p>\u042d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e CRUD-\u0430, \u043d\u043e \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u0433\u043e HTTP-\u043c\u0435\u0442\u043e\u0434\u0430, \u0442\u043e \u0432\u0430\u043c \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e  <code>chi.RegisterMethod(\"JELLO\")<\/code>, \u0430 \u0437\u0430\u0442\u0435\u043c \u043d\u0430\u0432\u0435\u0441\u0438\u0442\u044c \u043d\u0430 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u043f\u0443\u0442\u0438 \u0432 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>r.Method(\"JELLO\", \"\/path\", myJelloMethodHandler)<\/code>.<\/p>\n<h3>Create<\/h3>\n<p>\u041a\u043e\u0434 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e <code>CrudItem<\/code> \u0432 \u043d\u0430\u0448\u0435 \u0438\u043c\u043f\u0440\u043e\u0432\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"go\">r.Post(\"\/crud-items\/\", func(w http.ResponseWriter, r *http.Request) { \u00a0 \u00a0 \u00a0 \u00a0 var item CrudItem \u00a0 \u00a0 \u00a0 \u00a0 err := json.NewDecoder(r.Body).Decode(&amp;item) \u00a0 \u00a0 \u00a0 \u00a0 if err != nil { \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 w.WriteHeader(http.StatusBadRequest) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 w.Write([]byte(err.Error())) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 return \u00a0 \u00a0 \u00a0 \u00a0 } \u00a0 \u00a0 \u00a0 \u00a0 item.Id = currentId \u00a0 \u00a0 \u00a0 \u00a0 storage[currentId] = item \u00a0 \u00a0 \u00a0 \u00a0 jsonItem, err := json.Marshal(item) \u00a0 \u00a0 \u00a0 \u00a0 if err != nil { \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 w.WriteHeader(http.StatusInternalServerError) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 w.Write([]byte(err.Error())) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 return \u00a0 \u00a0 \u00a0 \u00a0 } \u00a0 \u00a0 \u00a0 \u00a0 w.Write(jsonItem) \u00a0 \u00a0 \u00a0 \u00a0 currentId += 1 \u00a0 \u00a0 }) <\/code><\/pre>\n<p>\u0427\u0442\u043e \u0438\u0437 \u0441\u0435\u0431\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u0448\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430:<\/p>\n<ol>\n<li>\n<p>\u041f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0438\u0437 \u0442\u0435\u043b\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 json \u0438 \u0434\u0435\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 <code>CrudItem<\/code>. \u0412\u0430\u043b\u0438\u0434\u043d\u044b\u0439 JSON \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"json\">{ \"name\": \"New name\", \"description\": \"New description\" } <\/code><\/pre>\n<ol start=\"2\">\n<li>\n<p>\u0415\u0441\u043b\u0438 \u043f\u043e \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u043d\u0430\u043c \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u043c\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0441 \u0435\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c \u0447\u0442\u043e-\u0442\u043e \u043d\u0435 \u0442\u0430\u043a \u0438 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0443.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u043c \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 <code>Id<\/code> \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0432 \u043d\u0430\u0448\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435. \u0425\u043e\u0434\u044f\u0442 \u043b\u0435\u0433\u0435\u043d\u0434\u044b, \u0447\u0442\u043e \u0432 \u0445\u043e\u0440\u043e\u0448\u0438\u0445 CRUD-\u0430\u0445 \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u043d\u044b\u043c\u0438 \u0435\u043c\u0443 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430\u043c\u0438, \u0438 \u043c\u044b \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u0435\u043c \u0442\u0430\u043a \u0436\u0435:<\/p>\n<\/li>\n<li>\n<p>\u0421\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 <code>CrudItem<\/code> \u0432 json;<\/p>\n<\/li>\n<li>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u043e\u0432\u0430\u043b\u0430 \u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e, \u0447\u0442\u043e \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0448\u043b\u043e \u043d\u0435 \u0442\u0430\u043a \u043f\u043e \u043d\u0430\u0448\u0435\u0439 \u0432\u0438\u043d\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u0441\u043f\u0435\u0445\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e json \u0438 \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u043c \u0442\u0435\u043a\u0443\u0449\u0438\u0439 <code>Id<\/code>.<\/p>\n<\/li>\n<\/ol>\n<h3>Read<\/h3>\n<p>\u0427\u0442\u0435\u043d\u0438\u0435 \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0434\u0432\u0443\u043c\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438:<\/p>\n<ul>\n<li>\n<p>\u041f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432\u0441\u0435 \u0437\u0430\u043f\u0438\u0441\u0438;<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439, \u043d\u043e \u043f\u043e\u043a\u0430 \u043e\u043d \u043d\u0430\u043c \u043d\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0435\u043d &#8212; \u043e\u043d \u043d\u0443\u0436\u0435\u043d \u043d\u0430\u043c \u0434\u043b\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0447\u0430\u0441\u0442\u0435\u0439:<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"go\">r.Get(\"\/crud-items\/\", func(w http.ResponseWriter, r *http.Request) { \u00a0 \u00a0 \u00a0 \u00a0 result := make([]CrudItem, 0, len(storage)) \u00a0 \u00a0 \u00a0 \u00a0 for _, item := range storage { \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 result = append(result, item) \u00a0 \u00a0 \u00a0 \u00a0 } \u00a0 \u00a0 \u00a0 \u00a0 resultJson, err := json.Marshal(result) \u00a0 \u00a0 \u00a0 \u00a0 if err != nil { \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 w.WriteHeader(http.StatusInternalServerError) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 w.Write([]byte(err.Error())) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 return \u00a0 \u00a0 \u00a0 \u00a0 } \u00a0 \u00a0 \u00a0 \u00a0 w.Write(resultJson) \u00a0 \u00a0 }) <\/code><\/pre>\n<p>\u0413\u043e\u0440\u0430\u0437\u0434\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u043f\u043e <code>Id<\/code>:<\/p>\n<pre><code class=\"go\">r.Get(\"\/crud-items\/{id}\", func(w http.ResponseWriter, r *http.Request) { \u00a0 \u00a0 \u00a0 \u00a0 idStr := chi.URLParam(r, \"id\") \u00a0 \u00a0 \u00a0 \u00a0 id, err := strconv.Atoi(idStr) \u00a0 \u00a0 \u00a0 \u00a0 if err != nil { \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 w.WriteHeader(http.StatusBadRequest) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 w.Write([]byte(err.Error())) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 return \u00a0 \u00a0 \u00a0 \u00a0 } \u00a0 \u00a0 \u00a0 \u00a0 if _, ok := storage[id]; !ok { \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 w.WriteHeader(http.StatusNotFound) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 return \u00a0 \u00a0 \u00a0 \u00a0 } \u00a0 \u00a0 \u00a0 \u00a0 resultJson, err := json.Marshal(storage[id]) \u00a0 \u00a0 \u00a0 \u00a0 if err != nil { \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 w.WriteHeader(http.StatusInternalServerError) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 w.Write([]byte(err.Error())) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 return \u00a0 \u00a0 \u00a0 \u00a0 } \u00a0 \u00a0 \u00a0 \u00a0 w.Write(resultJson) \u00a0 \u00a0 }) <\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435\u043c <code>id<\/code>  \u0437\u0430\u043f\u0438\u0441\u0438 \u0438\u0437 URL. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b:<\/p>\n<ol>\n<li>\n<p>\u0417\u0430\u0434\u0430\u043b\u0438 \u0432 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0435 \u043f\u0443\u0442\u0438 \u0438\u043c\u0435\u043d\u043d\u043e\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>id<\/code> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>{id}<\/code>;<\/p>\n<\/li>\n<li>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>chi.URLParam(r, \"id\")<\/code> \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 <code>id<\/code>;<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b\u0438 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>id<\/code> \u043a \u0446\u0435\u043b\u043e\u043c\u0443 \u0447\u0438\u0441\u043b\u0443 \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u043e\u0432\u0430\u043b\u0430 \u0441\u043e\u043e\u0431\u0449\u0438\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e, \u0447\u0442\u043e \u0441 \u0435\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c \u0447\u0442\u043e-\u0442\u043e \u043d\u0435 \u0442\u0430\u043a.<\/p>\n<\/li>\n<\/ol>\n<h3>Update<\/h3>\n<p>\u041e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u043f\u043e <code>id<\/code> \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u043e\u0440\u0443\u0434\u0438\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0438\u0441\u0438:<\/p>\n<pre><code class=\"go\">r.Put(\"\/crud-items\/{id}\", func(w http.ResponseWriter, r *http.Request) { \u00a0 \u00a0 \u00a0 \u00a0 idStr := chi.URLParam(r, \"id\") \u00a0 \u00a0 \u00a0 \u00a0 id, err := strconv.Atoi(idStr) \u00a0 \u00a0 \u00a0 \u00a0 if err != nil { \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 w.WriteHeader(http.StatusBadRequest) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 w.Write([]byte(err.Error())) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 return \u00a0 \u00a0 \u00a0 \u00a0 } \u00a0 \u00a0 \u00a0 \u00a0 if _, ok := storage[id]; !ok { \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 w.WriteHeader(http.StatusNotFound) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 return \u00a0 \u00a0 \u00a0 \u00a0 } \u00a0 \u00a0 \u00a0 \u00a0 var item CrudItem \u00a0 \u00a0 \u00a0 \u00a0 err = json.NewDecoder(r.Body).Decode(&amp;item) \u00a0 \u00a0 \u00a0 \u00a0 if err != nil { \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 w.WriteHeader(http.StatusBadRequest) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 w.Write([]byte(err.Error())) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 return \u00a0 \u00a0 \u00a0 \u00a0 } \u00a0 \u00a0 \u00a0 \u00a0 item.Id = id \u00a0 \u00a0 \u00a0 \u00a0 storage[id] = item \u00a0 \u00a0 \u00a0 \u00a0 jsonItem, err := json.Marshal(item) \u00a0 \u00a0 \u00a0 \u00a0 if err != nil { \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 w.WriteHeader(http.StatusInternalServerError) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 w.Write([]byte(err.Error())) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 return \u00a0 \u00a0 \u00a0 \u00a0 } \u00a0 \u00a0 \u00a0 \u00a0 w.Write(jsonItem) \u00a0 \u00a0 }) <\/code><\/pre>\n<h3>Delete<\/h3>\n<p>\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0438\u0437 \u043d\u0430\u0448\u0435\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"go\">r.Delete(\"\/crud-items\/{id}\", func(w http.ResponseWriter, r *http.Request) { \u00a0 \u00a0 \u00a0 \u00a0 idStr := chi.URLParam(r, \"id\") \u00a0 \u00a0 \u00a0 \u00a0 id, err := strconv.Atoi(idStr) \u00a0 \u00a0 \u00a0 \u00a0 if err != nil { \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 w.WriteHeader(http.StatusBadRequest) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 w.Write([]byte(err.Error())) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 return \u00a0 \u00a0 \u00a0 \u00a0 } \u00a0 \u00a0 \u00a0 \u00a0  \u00a0 \u00a0 \u00a0 \u00a0 if _, ok := storage[id]; !ok { \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 w.WriteHeader(http.StatusNotFound) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 return \u00a0 \u00a0 \u00a0 \u00a0 } \u00a0 \u00a0 \u00a0 \u00a0 delete(storage, id) \u00a0 \u00a0 }) <\/code><\/pre>\n<p>\u041f\u043e \u0441\u0443\u0442\u0438, \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u044d\u0442\u043e \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0441\u043b\u043e\u0432\u0430\u0440\u044f \u0441 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430.<\/p>\n<h2>\u0427\u0442\u043e \u0434\u0430\u043b\u044c\u0448\u0435?<\/h2>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0438 CRUD \u0441 5-\u044e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440 chi, \u043d\u0430\u0443\u0447\u0438\u043b\u0438\u0441\u044c \u0447\u0438\u0442\u0430\u0442\u044c json \u0438\u0437 \u0442\u0435\u043b\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0435\u0433\u043e \u0432 \u043e\u0442\u0432\u0435\u0442 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 \u043f\u0443\u0442\u0438.<br \/> \u0427\u0435\u043c\u0443 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0442\u0430\u0442\u044c\u0438:<\/p>\n<ul>\n<li>\n<p>\u0420\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \u0438 \u0432\u044b\u043d\u043e\u0441 \u0435\u0433\u043e \u0437\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441;<\/p>\n<\/li>\n<li>\n<p>\u041f\u0430\u0433\u0438\u043d\u0430\u0446\u0438\u044f \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c middleware;<\/p>\n<\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 <code>Renderer<\/code> \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0445 DTO;<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f;<\/p>\n<\/li>\n<li>\n<p>\u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f;<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 prometeus (\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 middleware \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u043f\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c). <\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u0432\u043e\u0438 \u0438\u0434\u0435\u0438, \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0438\u043b\u0438 \u043c\u043d\u0435 \u0432 <a href=\"https:\/\/t.me\/brom_samedi\" rel=\"noopener noreferrer nofollow\">\u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c<\/a>.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/800787\/\"> https:\/\/habr.com\/ru\/articles\/800787\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-371012","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/371012","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=371012"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/371012\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=371012"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=371012"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=371012"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}