官术网_书友最值得收藏!

Gorilla web toolkit

Now that we have covered how web Restful APIs work, it's time to understand how to best implement them in Go. The Go language comes with a very powerful web package in the standard library; Go also enjoys the support of numerous third-party packages. In this book, we will use a very popular Go web third-party toolkit called Gorilla web toolkit. The Gorilla web toolkit consists of a collection of Go packages that together helps build powerful web applications quickly and efficiently.

The key package in the Gorilla web toolkit ecosystem is called gorilla/mux. The mux package is described in the package documentation as a request router and dispatcher. This is basically a software component that accepts an incoming HTTP request, then decides what to do based on the nature of the request. For example, let's assume that a client sends an HTTP request to our web server. The HTTP router dispatcher component in our web server can then detect that the incoming request includes a GET method with a relative URL of ../events/id/1345. It will then retrieve the information of the event ID 1345 and send it back to the client.

主站蜘蛛池模板: 阿克苏市| 安阳市| 广南县| 台中县| 凌云县| 吉林省| 衡山县| 西乡县| 沙河市| 闸北区| 友谊县| 丽水市| 隆化县| 永春县| 湛江市| 涟源市| 平邑县| 于都县| 保靖县| 柘荣县| 衡阳县| 兴安县| 宜黄县| 怀来县| 东乡| 泽库县| 日喀则市| 山阴县| 都匀市| 化州市| 明水县| 怀安县| 开平市| 如皋市| 元谋县| 灌云县| 团风县| 怀来县| 建瓯市| 周宁县| 菏泽市|