Code Monkey home page Code Monkey logo

go-spring's Introduction

Go-Spring

[小喇叭]招募开发者!

由于 Go-Spring 是由我个人发起的项目,还不是团队作战,而且我在公司的主业务也很忙,所以基本上处于我有时间了就会更新的情况,但长此下去对 Go-Spring 的发展极为不利,也满足不了大家对 Go-Spring 的期待,所以欢迎对 Go-Spring 感兴趣的开发者参与到 Go-Spring 的日常开发和运营中来!

Go-Spring 核心特性

我个人认为目前 Go-Spring 实现了两个非常核心的特性:IoC 容器和开箱即用。

  1. IoC 容器可以满足对依赖注入、属性绑定、对象初始化的需求;
  2. 开箱即用可以满足对自动配置、依赖管理、第三方类库集成的需求。

有了这两大基本功能,GoLang 开发基本上算是摆脱了茹毛饮血的初级阶段。随着项目的不断完善,后面 GoLang 开发肯定会进入更高级的层次。

Go-Spring 编程**

Go-Spring 主推两种编程**:面向接口编程和面向模块编程。

  1. Go-Spring 为常见的业务领域提供了一个抽象层,通过抽象层可以屏蔽底层的实现细节,可以灵活的切换底层方案。
  2. Go-Spring 将不同的业务领域封装成模块,在内部注册模块所需的对象,通过 Starter 机制实现开箱即用的能力。

Go-Spring 项目仓库

Go-Spring 有两个仓库,一个是实现 IoC 容器特性的主项目所在的 didi 仓库,另一个是实现开箱即用特性的 Starters 项目所在的 go-spring仓库。

Go-Spring 1.0 目标

实现完善的 IoC 容器功能,支持数组对象注入,支持更多类型的属性绑定;

TODO


Go-Spring 项目简介

Go-Spring 是模仿 Java 的 Spring 全家桶实现的一套 GoLang 的应用程序框架,遵循“习惯优于配置”的原则,提供了依赖注入、自动配置、开箱即用、丰富的第三方类库集成等功能,能够让程序员少写很多的样板代码。

完整的 go-spring 项目一共包含 6 个模块,当前模块仅实现了基础的 IOC 容器的能力,该模块可以独立使用,但是配合其他模块才能使得效率最大化。其他模块发布在 https://github.com/go-spring 仓库下。下面是所有模块的列表:

1、程序启动框架
      AppRunner
2、核心功能模块
      GoSpring
3、启动器核心组件
      GoSpringBoot
4、开源微服务组件
      GoSpringCloud
5、多个项目启动器
      GoSpringBootStarter
      GoSpringCloudStarter

项目特点

  1. 面向接口编程
  2. 面向模块化编程
  3. 简单的启动器框架
  4. 依赖注入、属性注入
  5. 项目依赖管理
  6. 简化的 http test 框架
  7. 支持多种配置文件格式
  8. 支持多环境配置文件
  9. 统一的代码风格
  10. 自动加载配置、模块
  11. 丰富的示例,极易上手

代码规范

  1. 一个单词的包名采用小写格式(Maybe)
  2. 多个单词的包名使用首字母大写的格式
  3. HTTP 接口强制使用 POST 方法
  4. 业务代码允许 panic 中断请求
  5. 返回值包含详细的错误信息 …

实现原理

  1. AppRunner
  2. SpringContext
  3. Bean 管理
  4. Bean 注入,autowire
  5. 属性注入,value
  6. SpringBootApplication,适配 AppRunner
  7. 启动器框架,Starters
  8. 常用模块简介,Web、Redis、Mysql 等
  9. Spring-Message 框架
  10. Spring-Check + RPC框架

未来规划

  1. 继承 Java Spring 全家桶的设计原则,但不照搬照抄,适应 Go 语言
  2. 形成滴滴的 Go 项目和代码规范
  3. 完整支持微服务框架,监控、日志跟踪等
  4. 和 dubbo 协议、框架打通
  5. 创建新项目的工具软件
  6. 探索无服务器架构支持
  7. 管理端点 endpoint
  8. 更丰富的 debug 信息输出
  9. 支持用户配置覆盖模块默认配置
  10. 支持禁用特定的自动配置
  11. 定制 banner
  12. 属性支持占位符,松散绑定等高级特性 …

1.0 版本目标

TODO

示例

https://github.com/go-spring

相关文档

TODO

项目成员

发起者/负责人

lvan100 (LiangHuan)

如何成为外部贡献者? 提交有意义的PR,并被采纳。

QQ 交流群

Note

This is not an official Didi product (experimental or otherwise), it is just code that happens to be owned by Didi.

go-spring's People

Contributors

llitfkitfk avatar lvan100 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.