database

package
v0.8.17 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Set

func Set(config *Database)

Types

type Database

type Database struct {
	Username string
	Password string
	Host     string
	Port     string
	Database string
	Charset  string
	Pool     *Pool
	Settings *gorm.Config
}

func Get

func Get() *Database

type Pool added in v0.4.0

type Pool struct {
	MaxOpenConns int           //打开数据库连接的最大数量
	MaxIdleConns int           //连接池中空闲连接的最大数量
	MaxIdleTime  time.Duration //连接最大闲置时间
	MaxLifetime  time.Duration //连接最大可复用时间
	Heartbeat    time.Duration //心跳
}

Jump to

Keyboard shortcuts

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