db_clients

package
v0.0.0-...-909db3f Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBootConfigKey

func GetBootConfigKey() string

func GetClient

func GetClient(name string) *sqlagent.SqlAgent

func GetInjectInfo

func GetInjectInfo(name string) (injectName string, tp reflect.Type)

Types

type DBConfig

type DBConfig struct {
	NamedDBs map[string]dbConfig `json:"dbs"`
}

** DBConfig config json format ** {

"dbs": {
		"test-db": {
			"db": {
				"host": "127.0.0.1",
				"port": 3306,
				"name": "test",
				"type": "mysql",
				"user": "test",
				"password": "",
				"parameters": {
				"parseTime": "true",
				"charset": "utf8mb4,utf8",
				"loc": "Asia/Shanghai"
				},
			},
			"connection": {
				"max_open_connections": 60,
				"max_idle_connections": 40,
				"max_life_time": 600
			},
			"sql": {
				"column_map_tag": "json"
			}
		}
	}
}

Jump to

Keyboard shortcuts

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