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,45 @@
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 = ["test.toml"],
importpath = "go-common/app/service/bbq/video/cmd",
tags = ["automanaged"],
visibility = ["//visibility:public"],
deps = [
"//app/service/bbq/video/conf:go_default_library",
"//app/service/bbq/video/server/grpc:go_default_library",
"//app/service/bbq/video/server/http:go_default_library",
"//app/service/bbq/video/service: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,45 @@
package main
import (
"flag"
"go-common/app/service/bbq/video/conf"
"go-common/app/service/bbq/video/server/grpc"
"go-common/app/service/bbq/video/server/http"
"go-common/app/service/bbq/video/service"
ecode "go-common/library/ecode/tip"
"go-common/library/log"
"go-common/library/net/trace"
"os"
"os/signal"
"syscall"
)
func main() {
flag.Parse()
if err := conf.Init(); err != nil {
panic(err)
}
log.Init(conf.Conf.Log)
defer log.Close()
log.Info("start")
trace.Init(conf.Conf.Tracer)
defer trace.Close()
ecode.Init(conf.Conf.Ecode)
srv := service.New(conf.Conf)
grpc.New(srv)
http.Init(conf.Conf, srv)
c := make(chan os.Signal, 1)
signal.Notify(c, syscall.SIGHUP, syscall.SIGQUIT, syscall.SIGTERM, syscall.SIGINT)
for {
s := <-c
log.Info("get a signal %s", s.String())
switch s {
case syscall.SIGQUIT, syscall.SIGTERM, syscall.SIGINT:
log.Info("exit")
return
case syscall.SIGHUP:
default:
return
}
}
}

View File

@@ -0,0 +1,18 @@
[archive]
state = 0
notAccess = 10000
tid = [11, 13, 23, 165, 177, 4, 5]
subTid = [130, 54, 71, 174, 153, 169, 170]
title = ["搬运", "抖音", "快手", "秒拍", "美拍", "微视", "西瓜视频", "火山视频", "火山小视频", "纳豆视频", "电流小视频"]
content = ["搬运", "抖音", "快手", "秒拍", "美拍", "微视", "西瓜视频", "火山视频", "火山小视频", "纳豆视频", "电流小视频", "转侵删", "来自网络", "韩国车展", "韩国车模", "付邮送", "退坑出", "出簪", "抽福袋", "评论抽"]
[up]
uname = ["搬运", "抖音", "快手"]
mid = [330061605, 38331436, 348608259, 39735082]
[dimension]
minX = 720
minYX = 1.75
maxYX = 1.80
maxDuration = 60
minDuration = 15

View File

@@ -0,0 +1,168 @@
[log]
# dir = "/tmp/log/bbq-service"
stdout=true
v = 5
[grpc]
timeout = "500ms"
addr = "0.0.0.0:9005"
[bm]
[bm.server]
addr = "0.0.0.0:8802"
timeout = "1s"
[bm.client]
key = "654af11b5df0c9d3"
secret = "a7512b8b243b82f4bdb72cf2824b3f8e"
dial = "500ms"
timeout = "30s"
keepAlive = "60s"
timer = 10
[bm.client.breaker]
window = "3s"
sleep = "100ms"
bucket = 10
ratio = 0.5
request = 100
[mysql]
#addr = "127.0.0.1:3306"
#dsn = "root:123456@tcp(127.0.0.1:3306)/bbq?allowNativePasswords=true&timeout=200ms&readTimeout=200ms&writeTimeout=200ms&parseTime=true&loc=Local&charset=utf8,utf8mb4"
#readDSN = ["root:123456@tcp(127.0.0.2:3306)/bbq?allowNativePasswords=true&timeout=200ms&readTimeout=200ms&writeTimeout=200ms&parseTime=true&loc=Local&charset=utf8,utf8mb4"]
addr = "172.16.38.91:3306"
dsn = "root:123456@tcp(172.16.38.91:3306)/bbq?timeout=2000ms&readTimeout=2000ms&writeTimeout=2000ms&parseTime=true&loc=Local&charset=utf8,utf8mb4"
readDSN = ["root:123456@tcp(172.16.38.91:3306)/bbq?timeout=2000ms&readTimeout=2000ms&writeTimeout=2000ms&parseTime=true&loc=Local&charset=utf8,utf8mb4"]
active = 20
idle = 50
idleTimeout ="4h"
queryTimeout = "1000ms"
execTimeout = "1000ms"
tranTimeout = "2000ms"
[cmsmysql]
addr = "172.16.38.91:3306"
dsn = "root:123456@tcp(172.16.38.91:3306)/bbq_cms?timeout=2000ms&readTimeout=2000ms&writeTimeout=2000ms&parseTime=true&loc=Local&charset=utf8,utf8mb4"
readDSN = ["root:123456@tcp(172.16.38.91:3306)/bbq_cms?timeout=2000ms&readTimeout=2000ms&writeTimeout=2000ms&parseTime=true&loc=Local&charset=utf8,utf8mb4"]
active = 20
idle = 50
idleTimeout ="4h"
queryTimeout = "1000ms"
execTimeout = "1000ms"
tranTimeout = "2000ms"
[redis]
name = "bbq-web"
proto = "tcp"
addr = "172.16.38.91:6379"
idle = 10
active = 10
dialTimeout = "1s"
readTimeout = "1s"
writeTimeout = "1s"
idleTimeout = "10s"
expire = "1m"
[berserker]
[berserker.key]
[berserker.key.yyc]
appkey = "dcf555f4f314ccdfad7cb8a3288f1643"
secret = "4efd3443561e66832b3ba9128a1ad720"
[berserker.key.hsc]
appkey = "0bcf67ecf921576350a4f916c1edecbf"
secret = "1003e5a9babe66ef6834fe839ce8223f"
[berserker.key.lzq]
appkey = "e51d04f43e9c9bca8678dcb4586c76db"
secret = "7c53bf6d17c2d51253b927bc057abeae"
[berserker.api]
rankmonthly = "http://berserker.bilibili.co/avenger/api/92/query"
rankdaily = "http://berserker.bilibili.co/avenger/api/102/query"
userdmg = "http://berserker.bilibili.co/avenger/api/98/query"
operaonce = "http://berserker.bilibili.co/avenger/api/121/query"
[grpcClient]
[grpcClient.account]
addr = "discovery://default/account.service"
[grpcClient.account.wardenconf]
dial = "1s"
timeout = "2s"
[grpcClient.archive]
addr = "discovery://default/archive.service"
[grpcClient.archive.wardenconf]
dial = "100ms"
timeout = "500ms"
[grpcClient.bvcplay]
addr = "172.16.39.21:14500"
[grpcClient.bvcplay.wardenconf]
dial = "3000ms"
timeout = "5000ms"
[urls]
bvc_push="http://172.18.33.140:7703/api/v1/task/push/bbq"
[databus]
[databus.cms]
key = "36ff3e402f7c310a"
secret = "dbd11b140486dc0bc263cf7ec540186c"
group = "BBQCms-BbqBbq-P"
topic = "BBQCms-T"
action = "pub"
buffer = 1024
name = "history"
proto = "tcp"
addr = "172.22.33.174:6205"
idle = 1
active = 1
dialTimeout = "1s"
readTimeout = "60s"
writeTimeout = "1s"
idleTimeout = "10s"
[databus.cms.discovery]
domain = "uat-api.bilibili.co"
key = "c8c48e784e05acfb"
secret = "aa63ee0a10afa358d02a07e7abcec546"
region = "sh"
zone = "sh001"
env = "uat"
[databus.archive]
key = "36ff3e402f7c310a"
secret = "dbd11b140486dc0bc263cf7ec540186c"
group = "ArchiveNotify-BbqBbq-BbqBiliArchiveNotify-S"
topic = "ArchiveNotify-T"
action = "sub"
buffer = 1024
name = "history"
proto = "tcp"
addr = "172.22.33.174:6205"
idle = 1
active = 1
dialTimeout = "1s"
readTimeout = "60s"
writeTimeout = "1s"
idleTimeout = "10s"
[databus.archive.discovery]
domain = "api.bilibili.co"
key = "c8c48e784e05acfb"
secret = "aa63ee0a10afa358d02a07e7abcec546"
region = "sh"
zone = "sh001"
env = "uat"
[bpscode]
[bpscode.720p]
2m=130
1m=129
[bpscode.540p]
2m=128
1m=127
[upload]
[upload.file]
prefix= "0"
line = "ws"
[upload.endpoint]
main = "//upos-hz-uat.acgvideo.com"
backup = "//upos-hz-uat.acgvideo.com"
[upload.auth]
ak = "1494471752"
sk = "3c3989e9e0f4e64d9c817be4caf8a9c1"