booting-go

module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2021 License: Apache-2.0

README

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
参与贡献
  1. Fork 本仓库
  2. 新建 Feat_xxx 分支
  3. 提交代码
  4. 新建 Pull Request

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL