mysql

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MySQLConfig

type MySQLConfig struct {
	Host                 string
	Port                 int
	DriverName           string
	Username             string
	Password             string
	DBName               string
	AdditionalParameters string
	MaxOpenConns         int
	MaxIdleConns         int
	ConnMaxLifetime      time.Duration
}

func (MySQLConfig) InitMysqlDB

func (m MySQLConfig) InitMysqlDB() (db *sqlx.DB, err error)

type MySQLConfigBuilder

type MySQLConfigBuilder struct {
	// contains filtered or unexported fields
}

MySQLConfig builder pattern code

func NewMySQLConfigBuilder

func NewMySQLConfigBuilder() *MySQLConfigBuilder

func (*MySQLConfigBuilder) Build

func (b *MySQLConfigBuilder) Build() (*MySQLConfig, error)

func (*MySQLConfigBuilder) WithAdditionalParameters

func (b *MySQLConfigBuilder) WithAdditionalParameters(additionalParameters string) *MySQLConfigBuilder

func (*MySQLConfigBuilder) WithConnMaxLifetime

func (b *MySQLConfigBuilder) WithConnMaxLifetime(connMaxLifetime time.Duration) *MySQLConfigBuilder

func (*MySQLConfigBuilder) WithDBName

func (b *MySQLConfigBuilder) WithDBName(dBName string) *MySQLConfigBuilder

func (*MySQLConfigBuilder) WithDriverName

func (b *MySQLConfigBuilder) WithDriverName(driver string) *MySQLConfigBuilder

func (*MySQLConfigBuilder) WithHost

func (b *MySQLConfigBuilder) WithHost(host string) *MySQLConfigBuilder

func (*MySQLConfigBuilder) WithMaxIdleConns

func (b *MySQLConfigBuilder) WithMaxIdleConns(maxIdleConns int) *MySQLConfigBuilder

func (*MySQLConfigBuilder) WithMaxOpenConns

func (b *MySQLConfigBuilder) WithMaxOpenConns(maxOpenConns int) *MySQLConfigBuilder

func (*MySQLConfigBuilder) WithPassword

func (b *MySQLConfigBuilder) WithPassword(password string) *MySQLConfigBuilder

func (*MySQLConfigBuilder) WithPort

func (b *MySQLConfigBuilder) WithPort(port int) *MySQLConfigBuilder

func (*MySQLConfigBuilder) WithUsername

func (b *MySQLConfigBuilder) WithUsername(username string) *MySQLConfigBuilder

Jump to

Keyboard shortcuts

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