mysqldb

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DbConfig

type DbConfig struct {
	Host     string `mapstructure:"host"`
	Username string `mapstructure:"user"`
	Password string `mapstructure:"password"`
}

type MonMysqlPlugin

type MonMysqlPlugin struct {
	DBName string
}

func (MonMysqlPlugin) Initialize

func (p MonMysqlPlugin) Initialize(db *gorm.DB) error

func (MonMysqlPlugin) Name

func (p MonMysqlPlugin) Name() string

type MysqlDB

type MysqlDB struct {
	Engine *gorm.DB
	Name   string
}

func InitMysqlDB

func InitMysqlDB(setting MysqlSetting) *MysqlDB

func (*MysqlDB) Close

func (d *MysqlDB) Close()

func (*MysqlDB) SetLogger

func (d *MysqlDB) SetLogger(logger logger.Interface)

type MysqlSetting

type MysqlSetting struct {
	Name           string        `mapstructure:"name"`
	Type           string        `mapstructure:"type"`
	Write          DbConfig      `mapstructure:"write"`
	Read           DbConfig      `mapstructure:"read"`
	Database       string        `mapstructure:"database"`
	MaxPoolSize    int           `mapstructure:"max_pool_size"`
	MaxIdle        int           `mapstructure:"max_idle"`
	IdleTimeout    time.Duration `mapstructure:"idle_timeout"`
	ConnectTimeout time.Duration `mapstructure:"connect_timeout"`
	DoWithTimeout  time.Duration `mapstructure:"do_with_timeout"`
}

Jump to

Keyboard shortcuts

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