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 @@
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_binary",
"go_library",
)
go_binary(
name = "cmd",
embed = [":go_default_library"],
tags = ["automanaged"],
)
go_library(
name = "go_default_library",
srcs = ["main.go"],
data = ["web-goblin-test.toml"],
importpath = "go-common/app/interface/main/web-goblin/cmd",
tags = ["automanaged"],
visibility = ["//visibility:public"],
deps = [
"//app/interface/main/web-goblin/conf:go_default_library",
"//app/interface/main/web-goblin/http:go_default_library",
"//library/ecode/tip:go_default_library",
"//library/log:go_default_library",
"//library/net/trace:go_default_library",
],
)
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,42 @@
package main
import (
"flag"
"os"
"os/signal"
"syscall"
"go-common/app/interface/main/web-goblin/conf"
"go-common/app/interface/main/web-goblin/http"
ecode "go-common/library/ecode/tip"
"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.Log)
defer log.Close()
log.Info("web-goblin start")
trace.Init(conf.Conf.Tracer)
defer trace.Close()
ecode.Init(conf.Conf.Ecode)
http.Init(conf.Conf)
c := make(chan os.Signal, 1)
signal.Notify(c, syscall.SIGHUP, syscall.SIGQUIT, syscall.SIGTERM, syscall.SIGINT)
for {
s := <-c
log.Info("web-goblin get a signal %s", s.String())
switch s {
case syscall.SIGQUIT, syscall.SIGTERM, syscall.SIGINT:
log.Info("web-goblin exit")
return
case syscall.SIGHUP:
default:
return
}
}
}

View File

@@ -0,0 +1,120 @@
[log]
dir = "/data/log/web-goblin/"
[app]
key = "7c7ac0db1aa05587"
secret = "9a6d62d93290c5f771ad381e9ca23f26"
[memcache]
name = "web-goblin"
proto = "tcp"
addr = ""
active = 50
idle = 10
dialTimeout = "1s"
readTimeout = "1s"
writeTimeout = "1s"
idleTimeout = "10s"
[db]
[db.goblin]
addr = "172.22.34.101:3308"
dsn = "goblin_reader:apKhkA0X1L6UnWZ25rGcfVo4FizYQ3I9@tcp(172.22.34.101:3308)/bilibili_goblin?timeout=5s&readTimeout=5s&writeTimeout=5s&parseTime=true&loc=Local&charset=utf8,utf8mb4"
active = 5
idle = 2
idleTimeout = "4h"
queryTimeout = "100ms"
execTimeout = "100ms"
tranTimeout = "200ms"
[db.goblin.breaker]
window = "3s"
sleep = "100ms"
bucket = 10
ratio = 0.5
request = 100
[db.show]
addr = "172.16.33.205:3308"
dsn = "test:test@tcp(172.16.33.205:3308)/bilibili_show?timeout=5s&readTimeout=5s&writeTimeout=5s&parseTime=true&loc=Local&charset=utf8,utf8mb4"
active = 5
idle = 2
idleTimeout = "4h"
queryTimeout = "100ms"
execTimeout = "100ms"
tranTimeout = "200ms"
[db.show.breaker]
window = "3s"
sleep = "100ms"
bucket = 10
ratio = 0.5
request = 100
[redis]
name = "web-goblin"
proto = "tcp"
addr = "172.22.33.137:6819"
idle = 10
active = 10
dialTimeout = "1s"
readTimeout = "1s"
writeTimeout = "1s"
idleTimeout = "10s"
[httpclient]
key = "6aa4286456d16b97"
secret = "351cf022e1ae8296109c3c524faafcc8"
dial = "1s"
timeout = "1s"
keepAlive = "60s"
timer = 1000
[tagRPC]
timeout = "1s"
[suitRPC]
timeout = "1s"
[archiveRPC]
timeout = "1s"
[rule]
gid = 6
chCardInterval = "1m"
[host]
wechat = "https://api.weixin.qq.com"
pgcURI = "http://bangumi.bilibili.co"
[wechat]
appid = "wx7564fd5313d24844"
secret = "7f19aa432134132bd15248863254f117"
[[pendants]]
pid = 1
level = 7
[[pendants]]
pid = 2
level = 15
[[pendants]]
pid = 3
level = 28
[searchClient]
key = "6aa4286456d16b97"
secret = "351cf022e1ae8296109c3c524faafcc8"
dial = "2s"
timeout = "30s"
keepAlive = "60s"
timer = 1000
[outSearch]
rspan = 3600
acPgcFull = ["youku","iqiyi","tencent","acfun"]
acPgcIncre = ["youku","iqiyi","tencent","acfun"]
acUgcFull = ["youku","iqiyi","tencent","acfun"]
acUgcIncre = ["youku","iqiyi","tencent","acfun"]
dealCommFull = 100
dealLikeFull = 200
[recruit]
mokaURI = "https://api.mokahr.com"
orgid = "bilibili"