Categorygithub.com/bitwormhole/starter-gin
modulepackage
0.1.5
Repository: https://github.com/bitwormhole/starter-gin.git
Documentation: pkg.go.dev

# README

Starter-Gin 项目

Starter-Gin 在 Starter 的基础上,实现了以依赖注入的方式,来配置并启动 Gin 服务。

安装

在安装 Starter-Gin 包之前, 需要先 安装 Starter 框架

  1. 首先安装 Starter 框架, 然后你就能通过下列命令来安装 Starter-Gin 了。

     $ go get -u github.com/bitwormhole/starter-gin
    
  2. 把它导入到你的代码:

     import ginstarter "github.com/bitwormhole/starter-gin"
    

快速开始

在工程文件夹下新建一个源文件,例如:example.go, 然后输入下列代码。

package main

import ginstarter "github.com/bitwormhole/starter-gin"

func main() {
    i := ginstarter.InitGin()
    i.Use(ginstarter.Module())
    i.Run()
}

运行这个例子:

$ go run example.go

更多

要了解更多内容,请访问: https://bitwormhole.com/starter-gin/

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

InitGin 函数:开始初始化Gin应用程序.
Module 定义要导出的模块.
ModuleForDemo 定义要导出的模块(with demo).
ModuleWithDevtools 定义要导出的模块(with devtools).
SimpleModule 函数创建一个 SimpleModuleBuilder,【注意】 此方法无法向控制器注入依赖,如果需要注入,请使用标准的模块定义方式!.

# Interfaces

SimpleModuleBuilder 是用于快速创建自定义Gin模块的工具.