ginstarter

package module
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2021 License: MIT Imports: 6 Imported by: 4

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/

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitGin

func InitGin() application.Initializer

InitGin 函数:开始初始化Gin应用程序

func Module

func Module() application.Module

Module 定义要导出的模块

func ModuleWithDevtools

func ModuleWithDevtools() application.Module

ModuleWithDevtools 定义要导出的模块(with devtools)

Types

This section is empty.

Directories

Path Synopsis
etc
src
devtools/go command
main/go command

Jump to

Keyboard shortcuts

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