lib

package
v0.0.0-...-66ce3c7 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateMetaObjectHandler

func CreateMetaObjectHandler(db *gorm.DB)

func NewMysql

func NewMysql(config DatabaseConfig) (*gorm.DB, error)

NewMysql 数据库连接

func NewNullInt64

func NewNullInt64(s int64) sql.NullInt64

NewNullInt64 空数值

func NewNullString

func NewNullString(s string) sql.NullString

NewNullString 空字符串

func NewRedis

func NewRedis(config RedisConfig) (*redis.Client, error)

NewRedis redis连接

func UpdateMetaObjectHandler

func UpdateMetaObjectHandler(db *gorm.DB)

Types

type DatabaseConfig

type DatabaseConfig struct {
	Host          string
	Port          string
	User          string
	Pass          string
	DbName        string
	Prefix        string
	MaxIdleConnes int
	MaxOpenConnes int
	MaxLifeTime   int // 分钟
	LogLevel      logger.LogLevel
}

type RedisConfig

type RedisConfig struct {
	Addr     string
	Password string
	DbNum    int
}

Jump to

Keyboard shortcuts

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