生命不止,继续 go go go !!!
博客《Go实战–通过gin-gonic框架搭建restful api服务(github.com/gin-gonic/gin)》跟大家介绍了使用gin+mysql搭建一个restful api服务,今天主要介绍的是httprouter+redis搭建restful api服务。
httprouter
HttpRouter is a lightweight high performance HTTP request router (also called multiplexer or just mux for short) for Go.
github地址:
https://github.com/julienschmidt/httprouter
获取:
go get github.com/julienschmidt/httprouter
应用:
本文介绍了如何利用Go的httprouter和redigo/redis库来搭建高性能的RESTful API服务。内容涵盖httprouter的特性、redigo的使用以及如何构建包括欢迎消息、显示所有posts和按ID获取post等功能的简单博客系统。涉及到的Go语言知识包括struct、ioutil、log、strconv、json和time包的使用。
订阅专栏 解锁全文
596

被折叠的 条评论
为什么被折叠?



