Git Product home page Git Product logo

go-spring's Introduction

Go-Spring

Go-Spring 的目标是让 GoLang 程序员也能用上如 Java Spring 那般威力强大的编程框架。

特性:

  1. 提供完善的 IoC 容器,支持依赖注入、属性绑定;
  2. 提供强大的启动器框架,支持自动装配、开箱即用;
  3. 提供常见组件的抽象层,支持灵活地替换底层实现;

入门指南

Go-Spring 当前使用 Go1.12 进行开发,使用 Go Modules 进行依赖管理。

package main

import (
	_ "github.com/go-spring/go-spring-boot-starter/starter-gin"
	_ "github.com/go-spring/go-spring-boot-starter/starter-web"
	"github.com/go-spring/go-spring-web/spring-web"
	"github.com/go-spring/go-spring/spring-boot"
	"github.com/go-spring/go-spring/spring-core"
	"net/http"
)

func init() {
	SpringBoot.RegisterBean(new(Controller))
}

type Controller struct{}

func (c *Controller) InitWebBean(wc SpringWeb.WebContainer) {
	wc.GET("/", c.Home)
}

func (c *Controller) Home(ctx SpringWeb.WebContext) {
	ctx.String(http.StatusOK, "OK!")
}

func main() {
	SpringBoot.RunApplication("config/")
}

更多示例: https://github.com/go-spring/go-spring-boot-demo

项目列表

go-spring-parent

所有 Go-Spring 项目的根模块,包含日志,常量等。

go-spring

实现了 IoC 容器和 Boot 框架。

go-spring-web

不依赖 Go-Spring 框架的独立的 Web 模块。

go-spring-redis

不依赖 Go-Spring 框架的独立的 Redis 模块。

go-spring-rpc

不依赖 Go-Spring 框架的独立的 RPC 模块。

go-spring-orm

不依赖 Go-Spring 框架的独立的 ORM 模块。

go-spring-message

不依赖 Go-Spring 框架的独立的 MQ 模块。

go-spring-boot-starter

提供常见组件的启动器,实现开箱即用。

项目成员

发起者/负责人

lvan100 (LiangHuan)

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

QQ 交流群

微信公众号

License

The Go-Spring is released under version 2.0 of the Apache License.

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.