booting-go
介绍
基于iris和gorm的小型go web即开即用依赖注入框架
软件架构
web框架:iris
orm框架:gorm
安装教程
go get gitee.com/kristas/booting-go
使用说明
简易部署
创建config.yml
server:
port: 8888
iris:
FireMethodNotAllowed: true
DisableBodyConsumptionOnUnmarshal: true
TimeFormat: "2006-01-02 15:04:05"
Charset: UTF-8
LogLevel: info # "disable","fatal","error","warn","info","debug"
EnableOptimizations: true
创建main.go
package main
import (
"gitee.com/kristas/booting-go/demo/api"
"gitee.com/kristas/booting-go/demo/service"
"gitee.com/kristas/booting-go/framework"
"gitee.com/kristas/booting-go/framework/bean/bean_factory"
_ "gitee.com/kristas/booting-go/framework/starter"
)
func main() {
var appName = "DemoApp"
bean_factory.RegisterWithName("app_name", &appName)
framework.NewApplication().
Use(new(service.HelloService)).
Use(new(api.HelloController)).
Run()
}
启动
go run main.go
参与贡献
- Fork 本仓库
- 新建 Feat_xxx 分支
- 提交代码
- 新建 Pull Request