booting-go
介绍
基于iris和gorm的小型go web即开即用依赖注入框架
软件架构
web框架:iris
orm框架:gorm
安装教程
go get gitee.com/kristas/booting-go
使用说明
参考demo
简易部署
创建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/component_config"
"gitee.com/kristas/booting-go/framework"
"gitee.com/kristas/booting-go/framework/bean/bean_factory"
"os"
)
func main() {
var appName = "DemoApp"
bean_factory.RegisterWithName("app_name", &appName) // 注册bean
// 启动框架
framework.Application().
Use(Components()...).Run(os.Args...)
}
启动
go run main.go
参与贡献
- Fork 本仓库
- 新建 Feat_xxx 分支
- 提交代码
- 新建 Pull Request