GithubHelp home page GithubHelp logo

go-7's Introduction

基于net/http库的Gout框架

时间有点不够,7号合作了结束然后开始军训,然后每天就是早训->躺尸一下午->晚训->看代码看到昏迷

gin的路由树的构建和匹配没有完全搞懂,特别是统配符部分,15、16号有个小周末看看能不能搞明白重写一遍

实现思路

1.在engine中存一个http.Server,直接调用func (srv *Server) ListenAndServe(),来启动服务

2.直接使用map[string]MethodList map+切片的形式存储路由,key设置为GET、POST、PUT和DELETE,接收到请求后,直接遍历MethodList找到相同的路径。(因为gin的路由树没搞懂,所以也没有弄通配符的解析,就是param)

3.和gin一样,在engine中弄一个Pool存context的对象池,处理请求直接用context里的数据

4.支持中间件、解释query,form-data,x-www-form-urlencoded数据(直接用net/http库的方法)

net/http库的学习笔记也上传一下(gin 其实也写了,卡在路由树的通配符那边)

go-7's People

Contributors

jiuxia211 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.