- 授权协议: MIT
- 开发语言: Google Go
- 操作系统: 跨平台
- 软件首页: https://github.com/issue9/mux
- 软件文档: https://godoc.org/github.com/issue9/mux
软件介绍
mux 是对 http.ServeMux 的扩展,添加正则路由等功能。
相对于 http.ServeMux 提供了以下功能:
-
正则路由;
-
自动生成 OPTIONS;
通过与 handlers 还可以实现诸如按域名过滤等功能。
m := mux.NewServerMux(false).
Get("/user/1", h). // GET /user/1
Post("/api/login", h). // POST /api/login
Get("/blog/post/{id:\\d+}", h). // GET /blog/post/{id:\d+} 正则路由
Options("/user/1", "GET") // OPTIONS /user/1 手动指定该路由项的 OPTIONS 请求方法返回内容
// 统一前缀名称的路由
p := m.Prefix("/api")
p.Get("/logout", h) // 相当于m.Get("/api/logout", h)
p.Post("/login", h) // 相当于m.Get("/api/login", h)
http.ListenAndServe("8080", m)
安装
go get github.com/issue9/mux
Effective Objective-C 2.0
Matt Galloway / 爱飞翔 / 机械工业出版社 / 2014-1 / 69.00元
《effective objective-c 2.0:编写高质量ios与os x代码的52个有效方法》是世界级c++开发大师scott meyers亲自担当顾问编辑的“effective software development series”系列丛书中的新作,amazon全五星评价。从语法、接口与api设计、内存管理、框架等7大方面总结和探讨了objective-c编程中52个鲜为人知和容易被忽......一起来看看 《Effective Objective-C 2.0》 这本书的介绍吧!
