builder

package
v0.0.0-...-78514e9 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateGormDB

func CreateGormDB(options *DBOptions) (*gorm.DB, error)

Types

type DBDriver

type DBDriver string
const (
	DBDriverMysql     DBDriver = "mysql"
	DBDriverPostgresL          = "postgres"
)

type DBOptions

type DBOptions struct {
	Driver      DBDriver
	User        string
	Password    string
	Host        string
	Port        uint
	DBName      string
	SchemaName  string
	Charset     string
	MaxIdleConn int // 最大空闲连接数
	MaxOpenConn int // 最大连接数
	MaxLifetime int // 最大连接时长
}

func (*DBOptions) SetDefault

func (o *DBOptions) SetDefault()

Jump to

Keyboard shortcuts

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