injector

package
v0.0.0-...-9b87607 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2020 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InjectorSet = wire.NewSet(wire.Struct(new(Injector), "*"))

InjectorSet 注入Injector

Functions

func InitAuth

func InitAuth() (auth.Auther, func(), error)

InitAuth 初始化用户认证

func InitCasbin

func InitCasbin(adapter persist.Adapter) (*casbin.SyncedEnforcer, func(), error)

InitCasbin 初始化casbin

func InitGinEngine

func InitGinEngine(r router.IRouter) *gin.Engine

InitGinEngine 初始化gin引擎

func InitGormDB

func InitGormDB() (*gorm.DB, func(), error)

InitGormDB 初始化gorm存储

func InitMongo

func InitMongo() (*mongo.Client, func(), error)

InitMongo 初始化mongo存储

func NewGormDB

func NewGormDB() (*gorm.DB, func(), error)

NewGormDB 创建DB实例

Types

type Injector

type Injector struct {
	Engine         *gin.Engine
	Auth           auth.Auther
	CasbinEnforcer *casbin.SyncedEnforcer
	MenuBll        bll.IMenu
}

Injector 注入器(用于初始化完成之后的引用)

func BuildInjector

func BuildInjector() (*Injector, func(), error)

Jump to

Keyboard shortcuts

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