database

package
v0.0.0-...-13c8884 Latest Latest
Warning

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

Go to latest
Published: May 5, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefOrm

func GetDefOrm() orm.Ormer

func GetOrm

func GetOrm(name string) orm.Ormer

func HealthCheck

func HealthCheck() error

func Init

func Init()

func InitByCfgs

func InitByCfgs(cfgs map[string]DatabaseConfig)

func InitByFile

func InitByFile(fileName string)

Types

type DatabaseConfig

type DatabaseConfig struct {
	Driver       string `json:"dbdriver"`
	Protocol     string `json:"protocol"`
	Address      string `json:"address"`
	Username     string `json:"username"`
	Password     string `json:"password"`
	Database     string `json:"database"`
	Charset      string `json:"charset"`
	MaxIdle      int    `json:"maxIdle"`
	MaxConn      int    `json:"maxConn"`
	CheckSec     int    `json:"checkSec"`
	CurCheckTime int64
}

func (DatabaseConfig) GenDsn

func (this DatabaseConfig) GenDsn() string

Jump to

Keyboard shortcuts

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