Create & Init Project...

This commit is contained in:
2019-04-22 18:49:16 +08:00
commit fc4fa37393
25440 changed files with 4054998 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
"go_binary",
)
go_library(
name = "go_default_library",
srcs = ["main.go"],
data = [
"passport-user-job.toml",
"passport-user-job-uat.toml",
],
importpath = "go-common/app/job/main/passport-user/cmd",
tags = ["automanaged"],
visibility = ["//visibility:private"],
deps = [
"//app/job/main/passport-user/conf:go_default_library",
"//app/job/main/passport-user/http:go_default_library",
"//library/log:go_default_library",
"//library/net/trace:go_default_library",
],
)
go_binary(
name = "cmd",
embed = [":go_default_library"],
visibility = ["//visibility:public"],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)

View File

@@ -0,0 +1,40 @@
package main
import (
"flag"
"os"
"os/signal"
"syscall"
"go-common/app/job/main/passport-user/conf"
"go-common/app/job/main/passport-user/http"
"go-common/library/log"
"go-common/library/net/trace"
)
func main() {
flag.Parse()
if err := conf.Init(); err != nil {
panic(err)
}
log.Init(conf.Conf.Xlog)
defer log.Close()
trace.Init(conf.Conf.Tracer)
defer trace.Close()
http.Init(conf.Conf)
log.Info("passport-user-job start")
c := make(chan os.Signal, 1)
signal.Notify(c, syscall.SIGHUP, syscall.SIGQUIT, syscall.SIGTERM, syscall.SIGINT)
for {
s := <-c
log.Info("passport-user-job get a signal %s", s.String())
switch s {
case syscall.SIGQUIT, syscall.SIGTERM, syscall.SIGINT:
log.Info("passport-user-job exit")
return
case syscall.SIGHUP:
default:
return
}
}
}

View File

@@ -0,0 +1,119 @@
[incSync]
switch = false
[fullSync]
asoCountryCodeSwitch = false
[fullSync.asoAccount]
switch = false
chanNum = 20
chanSize = 1024
start = 0
end = 100000000
count = 10000
[fullSync.asoAccountInfo]
switch = false
chanNum = 20
chanSize = 1024
start = 0
end = 100000000
count = 10000
[fullSync.asoAccountReg]
switch = false
chanNum = 20
chanSize = 1024
start = 0
end = 100000000
count = 10000
[fullSync.asoAccountSns]
switch = false
chanNum = 20
chanSize = 1024
start = 0
end = 100000000
count = 10000
[fullSync.asoTelBindLog]
switch = false
chanNum = 20
chanSize = 1024
start = 0
end = 100000000
count = 10000
[scheduler]
switch = false
telDuplicateCron = "*/5 * * * * ?"
emailDuplicateCron = "*/5 * * * * ?"
[bm]
addr = "0.0.0.0:8000"
timeout = "1s"
[db]
[db.originDB]
addr = "172.22.34.101:3309"
dsn = "aso:WsjbodupJcZlBeWPEiYyK8HOTIcp3n3Z@tcp(172.22.34.101:3309)/aso?timeout=1s&readTimeout=1s&writeTimeout=1s&parseTime=true&loc=Local&charset=utf8,utf8mb4"
active = 5
idle = 2
queryTimeout = "1s"
execTimeout = "2s"
tranTimeout = "2s"
[db.originDB.breaker]
window = "3s"
sleep = "100ms"
bucket = 10
ratio = 0.5
request = 100
[db.userDB]
addr = "172.22.34.101:3308"
dsn = "passport:G5ntsSqTixJak0oyjceP1buXfVFBQH47@tcp(172.22.34.101:3308)/passport_user?timeout=1s&readTimeout=1s&writeTimeout=1s&parseTime=true&loc=Local&charset=utf8,utf8mb4"
active = 5
idle = 2
queryTimeout = "1s"
execTimeout = "2s"
tranTimeout = "2s"
[db.userDB.breaker]
window = "3s"
sleep = "100ms"
bucket = 10
ratio = 0.5
request = 100
[db.encryptDB]
addr = "172.22.34.101:3308"
dsn = "secret_reader:VK7UMbq8Z4dBxyCzOYkh20EFsa1IWrAi@tcp(172.22.34.101:3308)/passport_secret?timeout=1s&readTimeout=1s&writeTimeout=1s&parseTime=true&loc=Local&charset=utf8,utf8mb4"
active = 5
idle = 2
queryTimeout = "1s"
execTimeout = "2s"
tranTimeout = "2s"
[db.encryptDB.breaker]
window = "3s"
sleep = "100ms"
bucket = 10
ratio = 0.5
request = 100
[databusUtil]
size = 200
num = 32
ticker = "1s"
chan = 1024
[databus]
[databus.asoBinLogSub]
key = "4ba46ba31f9a44ef"
secret = "e4c5a7fce28695209e6b4f0af8cf91c5"
group = "PassportUserBinlog-MainAccount-S"
topic = "PassportUserBinlog-T"
action = "sub"
offset = "old"
buffer = 2048
name = "passport-user/databus"
proto = "tcp"
addr = "172.18.33.50:6205"
idle = 1
active = 1
dialTimeout = "1s"
readTimeout = "60s"
writeTimeout = "1s"
idleTimeout = "10s"

View File

@@ -0,0 +1,133 @@
[xlog]
dir = "/data/log/passport-user"
[incSync]
switch = true
[fullSync]
asoCountryCodeSwitch = false
[fullSync.asoAccount]
switch = true
chanNum = 2
chanSize = 1024
start = 0
end = 100
count = 10
[fullSync.asoAccountInfo]
switch = false
chanNum = 2
chanSize = 1024
start = 0
end = 100000
count = 10000
[fullSync.asoAccountReg]
switch = false
chanNum = 2
chanSize = 1024
start = 0
end = 100000
count = 10000
[fullSync.asoAccountSns]
switch = false
chanNum = 2
chanSize = 1024
start = 0
end = 100000
count = 10000
[fullSync.asoTelBindLog]
switch = false
chanNum = 2
chanSize = 1024
start = 0
end = 100000
count = 10000
[scheduler]
switch = false
telDuplicateCron = "*/5 * * * * ?"
emailDuplicateCron = "*/5 * * * * ?"
[bm]
addr = "0.0.0.0:8000"
timeout = "1s"
[db]
[db.originDB]
addr = "172.16.33.205:3306"
dsn = "aso:hA0DAnENNFz78kYB@tcp(172.16.33.205:3306)/aso?timeout=1s&readTimeout=1s&writeTimeout=1s&parseTime=true&loc=Local&charset=utf8,utf8mb4"
active = 5
idle = 2
queryTimeout = "1s"
execTimeout = "2s"
tranTimeout = "2s"
[db.originDB.breaker]
window = "3s"
sleep = "100ms"
bucket = 10
ratio = 0.5
request = 100
[db.userDB]
addr = "127.0.0.1:3306"
dsn = "root:root@tcp(127.0.0.1:3306)/user?timeout=1s&readTimeout=1s&writeTimeout=1s&parseTime=true&loc=Local&charset=utf8,utf8mb4"
active = 5
idle = 2
queryTimeout = "1s"
execTimeout = "2s"
tranTimeout = "2s"
[db.userDB.breaker]
window = "3s"
sleep = "100ms"
bucket = 10
ratio = 0.5
request = 100
[db.encryptDB]
addr = "127.0.0.1:3306"
dsn = "root:root@tcp(127.0.0.1:3306)/user?timeout=1s&readTimeout=1s&writeTimeout=1s&parseTime=true&loc=Local&charset=utf8,utf8mb4"
active = 5
idle = 2
queryTimeout = "1s"
execTimeout = "2s"
tranTimeout = "2s"
[db.encryptDB.breaker]
window = "3s"
sleep = "100ms"
bucket = 10
ratio = 0.5
request = 100
[databusUtil]
size = 200
num = 32
ticker = "1s"
chan = 1024
[databus]
[databus.asoBinLogSub]
key = "4ba46ba31f9a44ef"
secret = "99985eb4451cfb1b899ca0fbe3c4bdc8"
group = "PassportUserBinlog-MainAccount-S"
topic = "PassportUserBinlog-T"
action = "sub"
offset = "old"
buffer = 2048
name = "passport-user/databus"
proto = "tcp"
addr = "172.16.38.154:6205"
idle = 1
active = 1
dialTimeout = "1s"
readTimeout = "60s"
writeTimeout = "1s"
idleTimeout = "10s"
[memcache]
name = "passport-user-service"
proto = "tcp"
addr = "172.22.33.137:11219"
idle = 1000
active = 1000
dialTimeout = "10s"
readTimeout = "10s"
writeTimeout = "10s"
idleTimeout = "30s"