feat: import services and standardize Go 1.26.5
This commit is contained in:
27
apps/base/feedback/scripts/blocks.yaml
Normal file
27
apps/base/feedback/scripts/blocks.yaml
Normal file
@@ -0,0 +1,27 @@
|
||||
# 微服务相关配置
|
||||
service:
|
||||
key: feedback
|
||||
origin: bsm
|
||||
describe: system feedback microservice
|
||||
|
||||
# 编译选项:二进制文件,docker镜像
|
||||
build:
|
||||
- binary
|
||||
- docker
|
||||
|
||||
|
||||
# docker 环境镜像
|
||||
docker_image: golang:1.26.5
|
||||
|
||||
# docker 私有仓库
|
||||
docker_registry:
|
||||
endpoint: cid.apinb.com
|
||||
account: op
|
||||
password: 123456
|
||||
|
||||
# 微服务系统变量,docker或宿主机
|
||||
start:
|
||||
- export BlocksMesh_Workspace=scf
|
||||
- export BlocksMesh_Prefix=/usr/local/bsm/
|
||||
- export BlocksMesh_RuntimeMode=dev
|
||||
- export BlocksMesh_JwtSecretKey=Cblocksmesh2022C
|
||||
3
apps/base/feedback/scripts/build.sh
Normal file
3
apps/base/feedback/scripts/build.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
#go build
|
||||
go build -ldflags "-X git.apinb.com/blocks-sdk/engine/vars.VERSION=1.2.2 -X 'git.apinb.com/blocks-sdk/engine/vars.BUILD_TIME=2024-02-02 12:33:55' -X 'git.apinb.com/blocks-sdk/engine/vars.GO_VERSION=1.26.5'" -o /build/feedback ../cmd/main.go
|
||||
32
apps/base/feedback/scripts/filebeat.yaml
Normal file
32
apps/base/feedback/scripts/filebeat.yaml
Normal file
@@ -0,0 +1,32 @@
|
||||
filebeat.inputs:
|
||||
- type: log
|
||||
enabled: true
|
||||
# 开启json解析
|
||||
json.keys_under_root: true
|
||||
json.add_error_key: true
|
||||
# 日志文件路径
|
||||
paths:
|
||||
- ./logs/feedback/error.log
|
||||
- ./logs/feedback/slow.log
|
||||
|
||||
setup.template.settings:
|
||||
index.number_of_shards: 1
|
||||
|
||||
# 定义kafka topic field
|
||||
fields:
|
||||
log_topic: scf.feedback.dev
|
||||
|
||||
# 输出到kafka
|
||||
output.kafka:
|
||||
hosts: ["127.0.0.1:9092"]
|
||||
topic: '%{[fields.log_topic]}'
|
||||
partition.round_robin:
|
||||
reachable_only: false
|
||||
required_acks: 1
|
||||
keep_alive: 10s
|
||||
|
||||
# ================================= Processors =================================
|
||||
processors:
|
||||
- decode_json_fields:
|
||||
fields: ['@timestamp','level','content','trace','span','duration']
|
||||
target: ""
|
||||
5
apps/base/feedback/scripts/lint.sh
Normal file
5
apps/base/feedback/scripts/lint.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
#install
|
||||
go install github.com/securego/gosec/v2/cmd/gosec@latest
|
||||
|
||||
#run
|
||||
gosec -fmt=json -out=./test/lint/gosec.json ./...
|
||||
10
apps/base/feedback/scripts/proto_gen.sh
Normal file
10
apps/base/feedback/scripts/proto_gen.sh
Normal file
@@ -0,0 +1,10 @@
|
||||
# 由于goctl 不能编译多个proto文件,所以先要安装合并工具:
|
||||
# go install git.apinb.com/bsm-tools/proto-merge@v0.0.3
|
||||
|
||||
# 1. 先合并
|
||||
proto-merge ./proto/*.proto ./proto/feedback.proto
|
||||
|
||||
# 2. goctl 生成代码至/gen
|
||||
goctl rpc protoc ./proto/feedback.proto --go_out=./pb --go-grpc_out=./pb --zrpc_out=./gen/ -m --style go_zero
|
||||
|
||||
#protoc --go_out=./pb/ --go_opt=paths=source_relative --go-grpc_out=./pb/ --go-grpc_opt=require_unimplemented_servers=false --go-grpc_opt=paths=source_relative ./proto/*.proto --proto_path=./proto/
|
||||
Reference in New Issue
Block a user