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

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.

主站蜘蛛池模板: 库尔勒市| 如东县| 九龙坡区| 涪陵区| 黄石市| 东海县| 龙陵县| 竹北市| 兴宁市| 文水县| 千阳县| 定州市| 昌吉市| 夏邑县| 黔东| 洪洞县| 正安县| 尚志市| 昌图县| 古蔺县| 永安市| 江永县| 望谟县| 博白县| 富阳市| 油尖旺区| 望都县| 麦盖提县| 民乐县| 扎囊县| 陇南市| 濮阳县| 宝山区| 阿图什市| 盐津县| 砀山县| 临泉县| 班戈县| 闸北区| 松滋市| 英超|