mysql

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(log logger.Interface) (orm.ORM, error)

Types

type Configuration

type Configuration struct {
	// 连接主机
	Host string
	// 连接端口
	Port string
	// 连接用户
	UserName string
	// 连接密码
	Password string
	// 数据库名称
	DataBase string
	// 数据库编码格式
	Charset string
	// 空闲连接数
	MaxIdleConns int
	// 最大连接数
	MaxOpenConns int
	// 连接可复用的时间
	ConnMaxLifetime time.Duration
}

func (*Configuration) CheckConfig

func (c *Configuration) CheckConfig() error

func (*Configuration) InitDataBase

func (c *Configuration) InitDataBase(loger logger.Interface) (*gorm.DB, error)

Jump to

Keyboard shortcuts

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