mysql

package module
v0.0.0-...-cf5a81e Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package mysql ...

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMySQLClient

func NewMySQLClient(rawCfg RawConfig, ormCfg ORMConfig) (*gorm.DB, error)

Types

type ORMConfig

type ORMConfig struct {
	MySQL mysql.Config
	GORM  gorm.Config
}

type RawConfig

type RawConfig struct {
	IP                string `envconfig:"MYSQL_IP"`
	Port              string `envconfig:"MYSQL_PORT,default=3306"`
	TLP               string `envconfig:"MYSQL_TLP,optional"`
	User              string `envconfig:"MYSQL_USER"`
	Password          string `envconfig:"MYSQL_PASSWORD"`
	Database          string `envconfig:"MYSQL_DATABASE"`
	ConnMaxLifeMinute int    `envconfig:"MYSQL_CONN_MAX_LIFE_MINUTE,default=3"`
	MaxOpenConns      int    `envconfig:"MYSQL_MAX_OPEN_CONNS,default=10"`
	MaxIdleConns      int    `envconfig:"MYSQL_MAX_IDLE_CONNS,default=10"`
}

Jump to

Keyboard shortcuts

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