-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
1,526 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Code Scan | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: [ "dev" ] | ||
|
||
jobs: | ||
qodana: | ||
runs-on: ubuntu-latest | ||
environment: Analysis | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: 'Qodana Scan' | ||
uses: JetBrains/[email protected] | ||
with: | ||
pr-mode: false | ||
args: --apply-fixes | ||
push-fixes: pull-request | ||
upload-result: true | ||
env: | ||
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} | ||
- uses: github/codeql-action/upload-sarif@v2 | ||
with: | ||
sarif_file: ${{ runner.temp }}/qodana/results/qodana.sarif.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM alpine | ||
|
||
RUN apk update --no-cache \ | ||
&& apk upgrade \ | ||
&& apk add yasm \ | ||
&& apk add ffmpeg \ | ||
&& rm -rf /var/cache/apk/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# GuGoTik | ||
GuGoTik是 第六届字节跳动青训营后端进阶 实战项目,题目为编写一个小型的抖音后端。 | ||
# 贡献者 | ||
项目开发者:这是一群来自五湖四海的 Contributors,来自于 WHU,HNU,NJUPT。 | ||
- [EpicMo](https://github.com/liaosunny123) | ||
- [Maples](https://github.com/Maple-pro) | ||
- [Attacks](https://github.com/Attack825) | ||
- [amazing-compass](https://github.com/amazing-compass) | ||
- [XFFFCCCC](https://github.com/XFFFCCCC) | ||
|
||
特别感谢: | ||
- [Eric](https://github.com/ExerciseBook) | ||
- [Huang Yongliang](https://github.com/956237586) | ||
- [nicognaW](https://github.com/nicognaW) | ||
|
||
以及有事而无法参与项目的小伙伴: | ||
- [Chuanwise](https://github.com/Chuanwise) | ||
|
||
# 外部服务依赖 | ||
- Redis (Cluster) | ||
- PostgreSQL | ||
- Consul | ||
- OpenTelemetry Collector | ||
- FFMpeg | ||
- Go | ||
|
||
项目推荐使用以下可观测性基础设施: | ||
- Jaeger | ||
- Victoria Metrics | ||
- Grafana | ||
|
||
Profile 性能分析: | ||
- Pyroscope | ||
|
||
# 自部署流程 | ||
由 梦想珈 RyzeBot 提供自动推送至K8S集群构建流程。 | ||
PR 至 Dev 分支,经过基于 Action 的 UnitTest + Code Analysis + Lint + BuildCheck 后,可合并至 Master 分支。 | ||
Master 分支会自动触发 CD,构建镜像并推送,由 RyzeBot 完成向 K8S 的推送,自动部署。 | ||
|
||
# 配置 | ||
GuGoTik可以自动捕获环境变量,也可以以 .env 文件的方式手动提供,覆盖顺序为: | ||
.env > 环境变量 > DefaultEnv > EmptyEnv(即默认提供空值,由GuGoTik提供运行时特判) | ||
|
||
# 构建 | ||
## 基于 Standalone | ||
运行 scripts 文件夹下 build-all 脚本,然后运行 run-all 脚本即可,请选择自己平台支持的脚本。 | ||
## 基于 Docker | ||
```bash | ||
docker pull epicmo/gugotik:latest | ||
``` | ||
通过交互式终端进入容器后自行运行 GateWay 文件夹下和 Services 文件夹下程序 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: env-config | ||
namespace: gugotik-service-bundle | ||
data: | ||
DREAM_APP_NAME: "gugotik-service-bundle" | ||
DREAM_UNIT_NAME: "gugotik-service-bundle" | ||
DREAM_APP_VERSION: "${CI_COMMIT_ID}" | ||
DREAM_APP_ROOT: "/data/apps/gugotik-service-bundle" | ||
DREAM_CFG_ACCESS_KEY: '' | ||
DREAM_ENV: "TESTING" | ||
DREAM_REGION_NAME: "endymx" | ||
DREAM_SEC_APP_TOKEN: '' | ||
DREAM_SERVICE_DISCOVERY_URI: 'consul://consul-server.consul.svc.cluster.local:8500' | ||
DREAM_IMAGE_TAG: "${IMAGE_TAG}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
annotations: | ||
sidecar.jaegertracing.io/inject: 'true' | ||
labels: | ||
app: gugotik-auth-service | ||
name: gugotik-auth-service | ||
namespace: gugotik-service-bundle | ||
spec: | ||
selector: | ||
matchLabels: | ||
name: gugotik-auth-service | ||
template: | ||
metadata: | ||
labels: | ||
app: gugotik-auth-service | ||
branch: master | ||
version: ${BUILD_NUMBER}-${CI_COMMIT_ID} | ||
name: gugotik-auth-service | ||
dream-app: gugotik-auth-service | ||
dream-unit: gugotik-auth-service | ||
spec: | ||
imagePullSecrets: | ||
- name: reg-cred | ||
containers: | ||
- image: ${IMAGE} | ||
imagePullPolicy: IfNotPresent | ||
name: gugotik-auth-service | ||
command: | ||
- ./services/AuthService | ||
envFrom: | ||
- configMapRef: | ||
name: env-config | ||
ports: | ||
- name: grpc-37001 | ||
containerPort: 37001 | ||
protocol: TCP | ||
resources: | ||
limits: | ||
cpu: 500m | ||
memory: 256Mi | ||
requests: | ||
cpu: 100m | ||
memory: 8Mi | ||
terminationGracePeriodSeconds: 30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
package strings | ||
|
||
const ( | ||
VideoPicker = "video_picker" | ||
VideoExchange = "video_exchange" | ||
|
||
VideoPicker = "video_picker" | ||
VideoSummary = "video_summary" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package models | ||
|
||
import ( | ||
"GuGoTik/src/storage/database" | ||
|
||
"gorm.io/gorm" | ||
) | ||
|
||
type Message struct { | ||
ID uint32 `gorm:"not null;primarykey;autoIncrement"` | ||
ToUserId uint32 `gorm:"not null" ` | ||
FromUserId uint32 `gorm:"not null"` | ||
ConversationId string `gorm:"not null" index:"conversationid"` | ||
Content string `gorm:"not null"` | ||
|
||
// Create_time time.Time `gorm:"not null"` | ||
//Updatetime deleteTime | ||
gorm.Model | ||
} | ||
|
||
func init() { | ||
if err := database.Client.AutoMigrate(&Message{}); err != nil { | ||
panic(err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.