HTTP 多路复用器 Bone

码农软件 · 软件分类 · 网络工具包 · 2019-02-26 14:57:56

软件介绍

Bone 是一个轻量级、非常快速的 HTTP 多路复用器,支持 URL 变量、HTTP 方法声明和自定义 NotFound 处理器。

alt tag

Speed

- BenchmarkBoneMux        10000000               118 ns/op
- BenchmarkZeusMux          100000             54813 ns/op
- BenchmarkHttpRouterMux  10000000               143 ns/op
- BenchmarkNetHttpMux      3000000               548 ns/op
- BenchmarkGorillaMux       300000              3333 ns/op
- BenchmarkGorillaPatMux   1000000              1889 ns/op

[ These test are just for fun, all these router are great and really efficient. ]

Example

package main

import(
  "net/http"

  "github.com/squiidz/bone"
)

func main () {
  mux := bone.New()

  // Method takes http.HandlerFunc
  mux.Get("/home/:id", HomeHandler)
  mux.Post("/data", DataHandler)

  // Handle take http.Handler
  mux.Handle("/", http.HandlerFunc(RootHandler))

  http.ListenAndServe(":8080", mux)
}

本文地址:https://codercto.com/soft/d/180.html

Python 3学习笔记(上卷)

Python 3学习笔记(上卷)

雨痕 / 电子工业出版社 / 2018-1 / 89

经过9 年的发展,Python 3 生态已相当成熟。无论是语言进化、解释器性能提升,还是第三方支持,都是如此。随着Python 2.7 EOF 日趋临近,迁移到Python 3 的各种障碍也被逐一剔除。是时候在新环境下学习或工作了。 人们常说Python 简单易学,但这是以封装和隐藏复杂体系为代价的。仅阅读语言规范很难深入,亦无从发挥其应有能力,易学难精才是常态。《Python 3学习笔记(......一起来看看 《Python 3学习笔记(上卷)》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具