orm

package
v0.0.0-...-ce13bd1 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(c *Config) (db *gorm.DB)

NewMySQL new MySQL db and retry connection when has error.

Types

type Config

type Config struct {
	DbType        string        `ini:"TYPE"`
	DSN           string        `ini:"DSN"`            // data source name.
	Active        int           `ini:"ACTIVE"`         // pool
	Idle          int           `ini:"IDLE"`           // pool
	IdleTimeout   time.Duration `ini:"IDLE_TIMEOUT"`   // connect max life time.
	SlowThreshold time.Duration `ini:"SLOW_THRESHOLD"` // slow log threshold
}

Jump to

Keyboard shortcuts

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