model

package
v1.0.0-beta Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gorm

type Gorm struct {
	// 日志打印级别
	Debug bool `json:"debug" yaml:"Debug"`
	// 数据库类型:例如mysql
	DBType            string `json:"dbType" yaml:"DBType"`
	MaxLifetime       int    `json:"maxLifetime" yaml:"MaxLifetime"`
	MaxOpenConns      int    `json:"maxOpenConns" yaml:"MaxOpenConns"`
	MaxIdleConns      int    `json:"maxIdleConns" yaml:"MaxIdleConns"`
	EnableAutoMigrate bool   `json:"enableAutoMigrate" yaml:"EnableAutoMigrate"`
	// 是否开启日志打印
	IsLoggerOn bool `json:"isLoggerOn"`
}

Gorm 框架的相关配置

type Mysql

type Mysql struct {
	// ip
	Host string `json:"host" yaml:"Host"`
	// 端口
	Port int `json:"port" yaml:"Port"`
	// mysql cli用户
	User string `json:"user" yaml:"User"`
	// 密码
	Password string `json:"password" yaml:"Password"`
	// 数据库
	DBName string `json:"dbName" yaml:"DBName"`
	// 其他参数
	Parameters string `json:"parameters" yaml:"Parameters"`
}

mysql数据库配置

func (Mysql) DSN

func (m Mysql) DSN() string

DSN 数据库连接串

Jump to

Keyboard shortcuts

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