bootstrap

package
v0.0.0-...-be1d0c1 Latest Latest
Warning

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

Go to latest
Published: May 22, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitAll

func InitAll()

InitAll 执行项目整体的初始化 除了 router 路由信息都可以用 InitAll() 初始化

主体逻辑
// 加载配置
bootstrap.InitConfig()
// 加载日志
bootstrap.InitLogger()
// mysql初始化,初始化连接对象
bootstrap.InitDB()
// 自动迁移数据库表
bootstrap.InitModel()
bootstrap.InitRedis()

func InitConfig

func InitConfig()

func InitDB

func InitDB() *gorm.DB

初始化mysql,获取mysql连接 InitDB 初始化mysql,获取mysql连接

func InitDriver

func InitDriver()

func InitLogger

func InitLogger()

InitLogger 初始化 log 日志, 使用 zap 的原因是因为高性能 learn from [juejin.cn](https://juejin.cn/post/6971217119379718175)

func InitModel

func InitModel()

func InitRedis

func InitRedis()

func InitRouter

func InitRouter(r *gin.Engine)

InitRouter 定义路由, init 版本只使用了两个中间件, TODO JWT

Types

This section is empty.

Jump to

Keyboard shortcuts

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