mysql

package
v0.0.0-...-8227b98 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package mysql ...

Description : mysql客户端

Author : go_developer@163.com<张德满>

Date : 2021-03-01 9:20 下午

Package mysql...

Description : 数据定义

Author : go_developer@163.com<张德满>

Date : 2021-03-01 9:27 下午

Package mysql...

Description : 异常定义

Author : go_developer@163.com<张德满>

Date : 2021-03-01 9:42 下午

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectionOpenError

func ConnectionOpenError(err error) error

ConnectionOpenError 数据库连接失败

Author : go_developer@163.com<张德满>

Date : 9:43 下午 2021/3/1

func CreateDBLogError

func CreateDBLogError(err error) error

CreateDBLogError 打开日志失败

Author : go_developer@163.com<张德满>

Date : 10:53 下午 2021/3/1

func GetDatabaseClient

func GetDatabaseClient(conf *DBConfig, logConf *LogConfig) (*gorm.DB, error)

GetDatabaseClient 获取日志实例

Author : go_developer@163.com<张德满>

Date : 10:49 下午 2021/3/1

Types

type DBConfig

type DBConfig struct {
	Host              string // 主机
	Port              uint   // 端口
	Database          string // 数据库
	Username          string // 账号
	Password          string // 密码
	Charset           string // 编码
	MaxOpenConnection uint   // 打开的最大连接数
	MaxIdleConnection uint   // 最大空闲连接数
}

DBConfig 数据库连接的配置

Author : go_developer@163.com<张德满>

Date : 9:32 下午 2021/3/1

type LogConfig

type LogConfig struct {
	Level            zapcore.Level
	ConsoleOutput    bool
	Encoder          zapcore.Encoder
	SplitConfig      *logger.RotateLogConfig
	ExtractFieldList []string
	TraceFieldName   string
	Skip             int
}

LogConfig 日志配置

Author : go_developer@163.com<张德满>

Date : 10:51 下午 2021/3/1

Jump to

Keyboard shortcuts

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