<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                Router ====== WEB 開發離不開 Router. 通常 Router 負責對 HTTP Request URL 進行分析, 匹配到對應的處理對象. URL 可以分為三部分 Host, Path, QueryParams. 在官方包提供的 http.Request 對象中有對應的字段. 以前作者沒有關注路由具體實現, 只是拿來用. 很偶然發現一個路由評測項目 [go-http-routing-benchmark][]. 盡管路由的開銷很低, 仍舊很驚異不同路由有這么大差異, 那自己也實現一個吧. Rivet ===== 于是 [Rivet][] 誕生了. Rivet 學習了 [httprouter][] 的方法, 用前綴樹(Trie)管理路由節點, 這是提高匹配速度的關鍵. 另外作者發現事實上: * 帶參數的 URL.Path 很普遍, 字符串參數可能被轉換類型. * 路由處在處理請求的前端, 這期間應用應該有機會拒絕請求. * Host 路由應當被支持. * Martini 的注入方式確實方便. * 路由應該可被獨立使用, 而不是和框架強耦合 Rivet 滿足了這些需求, 而且性能非常可觀. Module ====== 既然 Rivet 采用了注入方式, 那應該可以開發只使用 Go 自帶 pkg 與框架無關的獨立模塊, 以便應用選取不同的框架. 當然事實上選用支持注入的框架是最方便的. [mod][] 就是這樣的嘗試. 目前, 作者也不知道能有多少模塊可以采用這種開發方式, 我會繼續嘗試. [go-http-routing-benchmark]: https://github.com/julienschmidt/go-http-routing-benchmark [Rivet]: https://github.com/typepress/rivet [httprouter]: https://github.com/julienschmidt/httprouter [mod]: https://github.com/typepress/mod
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看