dbconfig

package
v0.0.0-...-5591726 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// id db
	DbIdA string = "DbIdA"
	DbIdB string = "DbIdB"
	DbIdC string = "DbIdC"
	DbIdD string = "DbIdD"

	// passport db
	DbPassport string = "DbPassport"

	// file db
	DbFile string = "DbFile"

	// user db
	DbUser string = "DbUser"

	DbEvent string = "DbEvent"

	DbMsgShard0 string = "DbMsgShard0"
	DbMsgShard1 string = "DbMsgShard1"
	DbMsgShard2 string = "DbMsgShard2"
	DbMsgShard3 string = "DbMsgShard3"
)
View Source
const (
	// 默认最大的shard数量
	MsgTotalShard = 4
)

Variables

View Source
var (
	DbEventConfig = db.Config{
		Addr:            "127.0.0.1:3306",
		User:            "root",
		Pwd:             "123456",
		Db:              "event",
		MaxOpenConns:    20,
		MaxIdleConns:    20,
		MaxConnLifeTime: 3600,
	}

	DbEventR1Config = db.Config{
		Addr:            "127.0.0.1:3306",
		User:            "root",
		Pwd:             "123456",
		Db:              "event",
		MaxOpenConns:    20,
		MaxIdleConns:    20,
		MaxConnLifeTime: 3600,
	}
)
View Source
var (
	DbFileConfig = db.Config{
		Addr:            "127.0.0.1:3306",
		User:            "root",
		Pwd:             "123456",
		Db:              "file",
		MaxOpenConns:    20,
		MaxIdleConns:    20,
		MaxConnLifeTime: 3600,
	}

	DbFileR1Config = db.Config{
		Addr:            "127.0.0.1:3306",
		User:            "root",
		Pwd:             "123456",
		Db:              "file",
		MaxOpenConns:    20,
		MaxIdleConns:    20,
		MaxConnLifeTime: 3600,
	}
)
View Source
var (
	DbIdADevConfig = db.Config{
		Addr:         "127.0.0.1:3306",
		User:         "root",
		Pwd:          "123456",
		Db:           "db_a",
		MaxOpenConns: 2,
		MaxIdleConns: 1,
	}

	DbIdBDevConfig = db.Config{
		Addr:         "127.0.0.1:3306",
		User:         "root",
		Pwd:          "123456",
		Db:           "db_b",
		MaxOpenConns: 2,
		MaxIdleConns: 1,
	}

	DbIdCDevConfig = db.Config{
		Addr:         "127.0.0.1:3306",
		User:         "root",
		Pwd:          "123456",
		Db:           "db_c",
		MaxOpenConns: 2,
		MaxIdleConns: 1,
	}

	DbIdDDevConfig = db.Config{
		Addr:         "127.0.0.1:3306",
		User:         "root",
		Pwd:          "123456",
		Db:           "db_d",
		MaxOpenConns: 2,
		MaxIdleConns: 1,
	}
)
View Source
var (
	DbIdAConfig = db.Config{
		Addr:            "127.0.0.1:3306",
		User:            "root",
		Pwd:             "123456",
		Db:              "db_a",
		MaxOpenConns:    4,
		MaxIdleConns:    2,
		MaxConnLifeTime: 3600,
	}

	DbIdBConfig = db.Config{
		Addr:            "127.0.0.1:3306",
		User:            "root",
		Pwd:             "123456",
		Db:              "db_b",
		MaxOpenConns:    4,
		MaxIdleConns:    2,
		MaxConnLifeTime: 3600,
	}

	DbIdCConfig = db.Config{
		Addr:            "127.0.0.1:3306",
		User:            "root",
		Pwd:             "123456",
		Db:              "db_c",
		MaxOpenConns:    4,
		MaxIdleConns:    2,
		MaxConnLifeTime: 3600,
	}

	DbIdDConfig = db.Config{
		Addr:            "127.0.0.1:3306",
		User:            "root",
		Pwd:             "123456",
		Db:              "db_d",
		MaxOpenConns:    4,
		MaxIdleConns:    2,
		MaxConnLifeTime: 3600,
	}
)
View Source
var (
	DbMsgShard0Config = db.Config{
		Addr:            "127.0.0.1:3306",
		User:            "root",
		Pwd:             "123456",
		Db:              "msg_shard0",
		MaxOpenConns:    40,
		MaxIdleConns:    40,
		MaxConnLifeTime: 3600,
	}

	DbMsgShard0R1Config = db.Config{
		Addr:            "127.0.0.1:3306",
		User:            "root",
		Pwd:             "123456",
		Db:              "msg_shard0",
		MaxOpenConns:    40,
		MaxIdleConns:    40,
		MaxConnLifeTime: 3600,
	}
	DbMsgShard1Config = db.Config{
		Addr:            "127.0.0.1:3306",
		User:            "root",
		Pwd:             "123456",
		Db:              "msg_shard1",
		MaxOpenConns:    40,
		MaxIdleConns:    40,
		MaxConnLifeTime: 3600,
	}

	DbMsgShard1R1Config = db.Config{
		Addr:            "127.0.0.1:3306",
		User:            "root",
		Pwd:             "123456",
		Db:              "msg_shard1",
		MaxOpenConns:    40,
		MaxIdleConns:    40,
		MaxConnLifeTime: 3600,
	}
	/******shard2****/
	DbMsgShard2Config = db.Config{
		Addr:            "127.0.0.1:3306",
		User:            "root",
		Pwd:             "123456",
		Db:              "msg_shard2",
		MaxOpenConns:    40,
		MaxIdleConns:    40,
		MaxConnLifeTime: 3600,
	}

	DbMsgShard2R1Config = db.Config{
		Addr:            "127.0.0.1:3306",
		User:            "root",
		Pwd:             "123456",
		Db:              "msg_shard2",
		MaxOpenConns:    40,
		MaxIdleConns:    40,
		MaxConnLifeTime: 3600,
	}
	/******shard3****/
	DbMsgShard3Config = db.Config{
		Addr:            "127.0.0.1:3306",
		User:            "root",
		Pwd:             "123456",
		Db:              "msg_shard3",
		MaxOpenConns:    40,
		MaxIdleConns:    40,
		MaxConnLifeTime: 3600,
	}

	DbMsgShard3R1Config = db.Config{
		Addr:            "127.0.0.1:3306",
		User:            "root",
		Pwd:             "123456",
		Db:              "msg_shard3",
		MaxOpenConns:    40,
		MaxIdleConns:    40,
		MaxConnLifeTime: 3600,
	}
)
View Source
var (
	DbPassportConfig = db.Config{
		Addr:            "127.0.0.1:3306",
		User:            "root",
		Pwd:             "123456",
		Db:              "passport",
		MaxOpenConns:    20,
		MaxIdleConns:    20,
		MaxConnLifeTime: 3600,
	}

	DbPassportR1Config = db.Config{
		Addr:            "127.0.0.1:3306",
		User:            "root",
		Pwd:             "123456",
		Db:              "passport",
		MaxOpenConns:    20,
		MaxIdleConns:    20,
		MaxConnLifeTime: 3600,
	}
)
View Source
var (
	DbUserConfig = db.Config{
		Addr:            "127.0.0.1:3306",
		User:            "root",
		Pwd:             "123456",
		Db:              "user",
		MaxOpenConns:    20,
		MaxIdleConns:    20,
		MaxConnLifeTime: 3600,
	}
	DbUserR1Config = db.Config{
		Addr:            "127.0.0.1:3306",
		User:            "root",
		Pwd:             "123456",
		Db:              "user",
		MaxOpenConns:    20,
		MaxIdleConns:    20,
		MaxConnLifeTime: 3600,
	}
)

dev config map

prod config map

View Source
var (
	DbEventDevConfig = db.Config{
		Addr:         "127.0.0.1:3306",
		User:         "root",
		Pwd:          "123456",
		Db:           "event",
		MaxOpenConns: 5,
		MaxIdleConns: 3,
		Options:      "interpolateParams=true",
	}
)
View Source
var (
	DbFileDevConfig = db.Config{
		Addr:         "127.0.0.1:3306",
		User:         "root",
		Pwd:          "123456",
		Db:           "file",
		MaxOpenConns: 5,
		MaxIdleConns: 3,
		Options:      "interpolateParams=true",
	}
)
View Source
var (
	DbMsgShard0DevConfig = db.Config{
		Addr:         "127.0.0.1:3306",
		User:         "root",
		Pwd:          "123456",
		Db:           "msg_shard0",
		MaxOpenConns: 5,
		MaxIdleConns: 3,
		Options:      "interpolateParams=true",
	}
)
View Source
var (
	DbPassportDevConfig = db.Config{
		Addr:         "127.0.0.1:3306",
		User:         "root",
		Pwd:          "123456",
		Db:           "passport",
		MaxOpenConns: 5,
		MaxIdleConns: 3,
		Options:      "interpolateParams=true",
	}
)
View Source
var (
	DbUserDevConfig = db.Config{
		Addr:         "127.0.0.1:3306",
		User:         "root",
		Pwd:          "123456",
		Db:           "user",
		MaxOpenConns: 5,
		MaxIdleConns: 3,
		Options:      "interpolateParams=true",
	}
)

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