This is a creation in Article, where the information may have evolved or changed.
The title is completely translated, Gorilla/mux is a powerful URL router and dispatcher, but personally feel that translation is not in place, look.
The Gorilla/mux package is a layer structure that configures the various parameters required for client access in this structure and then passes it to HTTP. The Handle () function. If you have a look at my blog, you will understand its structural composition. Let's take a look at one of its examples:
func Main () {r: = Mux. Newrouter () r.handlefunc ( / Span style= "color: #800000;" > " , Homehandler) R.handlefunc ( " /products " , Productshandler) R.handlefunc ( " /articles /
As can be seen, its structure is similar to the structure of Uniqush. However, the Gorilla/mux package takes into account most of the actions required for URL parsing, including methods of Access, fields accessed, matching fields through regular expressions, setting site names, and so on. With the Gorilla/mux package, you can configure our own Web pages before publishing the Web page, and many of the actions are integrated into the package, such as regular matches, without having to write the matching operation ourselves, just need to know the pattern to match. In the implementation of some Web page field parsing, you can refer to this package. If you want to know how this package works, it is best to look at its usage first, and then look at its code implementation, so that the effect is much better, the Web page here.
Posted please specify from: Geton