config

package
v0.0.0-...-2242553 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2018 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DbConfig = map[string]interface{}{
	"Default":         "mysql_dev",
	"SetMaxOpenConns": 300,
	"SetMaxIdleConns": 10,
	"Connections": map[string]map[string]string{
		"mysql_dev": {
			"host":     "192.168.200.248",
			"username": "gcore",
			"password": "gcore",
			"port":     "3306",
			"database": "test",
			"charset":  "utf8",
			"protocol": "tcp",
			"prefix":   "",
			"driver":   "mysql",
		},
		"mssql_dev": {
			"host":     "192.168.200.248",
			"username": "gcore",
			"password": "gcore",
			"port":     "1433",
			"database": "test",
			"prefix":   "",

			"driver": "mssql",
		},
		"postgres_dev": {
			"host":     "localhost",
			"username": "postgres",
			"password": "",
			"port":     "5432",
			"database": "test",
			"prefix":   "",

			"driver": "postgres",
		},
		"oracle_dev": {

			"username": "root",
			"password": "",

			"database": "test",
			"prefix":   "",

			"driver": "oracle",
		},
		"sqlite_dev": {

			"database": "./foo.db",
			"prefix":   "",

			"driver": "sqlite3",
		},
	},
}

DbConfig : 所有数据库配置 如果想从json读取, 只需要用这个struct读取出来, 然后在赋值给类似这个变量类型就可以了: map[string]interface{}

type Configer struct {
	   Default string
	   SetMaxOpenConns int
	   SetMaxIdleConns int
	   Connections map[string]map[string]string
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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