ginApp

package module
v0.0.0-...-df00f50 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2018 License: MIT Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

gin-app(开发中)

基于gin的app框架

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GinApp

type GinApp struct {
	AppConfig *config.AppConfig // app的配置信息
	Db        *gorm.DB          // 默认数据库,主库
	// contains filtered or unexported fields
}

func Instance

func Instance() *GinApp

* app单例

func (*GinApp) DefaultLoadConfig

func (app *GinApp) DefaultLoadConfig(configDirPath string)

func (*GinApp) Engine

func (app *GinApp) Engine() *gin.Engine

func (*GinApp) GetCommonPath

func (app *GinApp) GetCommonPath() string

func (*GinApp) GetDb

func (app *GinApp) GetDb() *gorm.DB

* 获取默认db

func (*GinApp) GetRootPath

func (app *GinApp) GetRootPath() string

* 读取项目根目录

func (*GinApp) InitIdentify

func (app *GinApp) InitIdentify(expirePeriod, gcPeriod time.Duration)

* 初始化验证码模块

func (*GinApp) InitSession

func (app *GinApp) InitSession() error

* 初始化session配置

func (*GinApp) Mode

func (app *GinApp) Mode() string

func (*GinApp) Run

func (app *GinApp) Run(addr ...string) *GinApp

func (*GinApp) SetCommonPath

func (app *GinApp) SetCommonPath(commonPath string)

* 设置common文件夹

func (*GinApp) SetMode

func (app *GinApp) SetMode(mode string)

* 设置当前运行环境:debug、test、release

func (*GinApp) SetRootPath

func (app *GinApp) SetRootPath(root string)

* 设置项目根目录,通常是web所在目录

Directories

Path Synopsis
db
safe

Jump to

Keyboard shortcuts

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