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

Cracking the Coding Interview

Cracking the Coding Interview

Gayle Laakmann McDowell / CareerCup / 2015-7-1 / USD 39.95

Cracking the Coding Interview, 6th Edition is here to help you through this process, teaching you what you need to know and enabling you to perform at your very best. I've coached and interviewed hund......一起来看看 《Cracking the Coding Interview》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试