global

package
v0.0.0-...-5c42bcd Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DB                 *gorm.DB
	DBList             map[string]*gorm.DB
	RedisClient        *redis.Client
	ConfigServer       config.Server
	Viper              *viper.Viper
	Logger             *zap.Logger
	Timer              = timer.NewTimerTask()
	ConcurrencyControl = &singleflight.Group{}

	BlackCache local_cache.Cache

	Cache local_cache.Cache
)

Functions

func GetGlobalDBByDBName

func GetGlobalDBByDBName(dbname string) *gorm.DB

GetGlobalDBByDBName 通过名称获取db list中的db

func MustGetGlobalDBByDBName

func MustGetGlobalDBByDBName(dbname string) *gorm.DB

MustGetGlobalDBByDBName 通过名称获取db 如果不存在则panic

Types

type Model

type Model struct {
	ID        uint           `json:"id" form:"id" gorm:"primarykey"` // 主键ID
	CreatedAt time.Time      `json:"createdAt" form:"createdAt"`     // 创建时间
	UpdatedAt time.Time      `json:"updatedAt" form:"updatedAt"`     // 更新时间
	DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`                 // 删除时间
}

Jump to

Keyboard shortcuts

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