Giter VIP home page Giter VIP logo

xiusin / pine Goto Github PK

View Code? Open in Web Editor NEW
11.0 1.0 4.0 3.04 MB

轻量级高性能GO语言开发框架。支持MVC、依赖注入、动态返回值、中间件、 路由分组、子域名路由注册管理。 组件基于接口实现,可以自行实现或定义组件。

Home Page: https://xiusin.github.io/pine/

License: MIT License

Go 14.75% HTML 1.42% CSS 17.93% JavaScript 65.89%
router framework goweb pine

pine's Introduction

pine

PineFramework 一个轻量级高性能GO语言开发框架。支持MVC、依赖注入、动态返回值、中间件、 路由分组、子域名路由注册管理。 组件基于接口实现,可以自行实现或定义组件。

动态返回值

此功能只能用于mvc模式,根据方法自动兼容显示内容

  1. 如果没有返回值,并且没有渲染过模板,会自动调用模板渲染方法. 查找路径为 ControllerName/MethodName
  2. 如果返回inerface{} ,会自动打印部分能兼容的数据,返回结果为字符串类型 text/html
  3. 如果返回一个非nil的错误,会直接panic(不包括复合类型里的error)
  4. 如果返回 string,int 等类型,显示为text
  5. 实现controller的结构属性全局静态变量共享(加锁/引用),需要共享的参数(名称以share切为引用类型)

di

(发现有些数据无法解析出来pkgPath,现在只有类型名称)服务注册名称更为interface{}, 如果注册服务类型实例,自动绑定字符串文件路径和pkgPathcontroller自动解析参数是对比参数pkgPath,以确定是否为真实参数类型。

路由

  • 可打印路由如下

$ go run main.go
METHOD | PATH | ALIASES | NAME     | HANDLE
------ | ---- | ------- | ----     | -------
GET    | /    |         | rootPath | path/to/routes_error/actions.HomeHandler

TODO

  • 支持非Post或Get开始的方法名称,支持任何方式请求
  • 自动反射出来的路由需要修改成小驼峰名称
  • 细化input(参照laravel), 抽象convert结构体, 处理各种数据转换.
  • 模板引擎支持传入文件系统对象
  • 实现路由占位符用于自定义路由替换规则
  • 缓存驱动github.com/syndtr/goleveldb/leveldb

pine's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

pine's Issues

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.