core

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: MIT Imports: 30 Imported by: 9

Documentation

Index

Constants

View Source
const (
	ModeDev  Mode = "dev"  //开发模式
	ModeTest Mode = "test" //测试模式
	ModeProd Mode = "prod" //生产模式

	Mysql  DBType = "mysql" //mysql数据库标识
	Mssql  DBType = "mssql"
	Pgsql  DBType = "pgsql"
	Sqlite DBType = "sqlite" //sqlite
)

Variables

View Source
var (
	Cfg config.AppCfg

	Cache cache.ICache

	RedisLock *locker.Redis
	Started   = make(chan byte, 1)
	ToClose   = make(chan byte, 1)
)
View Source
var Version = "V0.0.1"

Functions

func DB

func DB() *gorm.DB

获取默认的(master)db

func Db

func Db(name string) *gorm.DB

func Dbs

func Dbs() map[string]*gorm.DB

GetDb 获取所有map里的db数据

func GetEngine

func GetEngine() http.Handler

func GetGinEngine

func GetGinEngine() *gin.Engine

func GetGromLogCfg

func GetGromLogCfg(logMode logger.LogLevel, prefix string, slowThreshold int, singular, color, ignoreNotFound bool, logW io.Writer) *gorm.Config

func Init

func Init()

func Run

func Run()

func SetDb

func SetDb(key string, db *gorm.DB)

func SetEngine

func SetEngine(aEngine http.Handler)

Types

type DBType

type DBType string

func (DBType) String

func (e DBType) String() string

type IServer

type IServer interface {
	GetEngine() http.Handler
}

type Mode

type Mode string

func (Mode) String

func (e Mode) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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