diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index 3f03bf4c..ed6ca243 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -9,6 +9,7 @@ updates:
directory: "/"
schedule:
interval: "weekly"
+ target-branch: "dev"
reviewers:
- "rocboss"
- "alimy"
diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml
index 6d5dca69..a38b564a 100644
--- a/.github/workflows/go.yml
+++ b/.github/workflows/go.yml
@@ -7,7 +7,9 @@ on:
- dev
- 'jc/**'
- 'feature/**'
+ - 'r/**'
- 'x/**'
+ - 't/**'
paths:
- '**.go'
- 'go.mod'
@@ -45,7 +47,7 @@ jobs:
name: Test
strategy:
matrix:
- go-version: [ 1.18.x, 1.19.x ]
+ go-version: [ 1.20.x ]
platform: [ ubuntu-latest, macos-latest ]
runs-on: ${{ matrix.platform }}
steps:
@@ -64,7 +66,7 @@ jobs:
name: TestOnWindows
strategy:
matrix:
- go-version: [ 1.18.x, 1.19.x ]
+ go-version: [ 1.20.x ]
platform: [ windows-latest ]
runs-on: ${{ matrix.platform }}
steps:
diff --git a/.gitignore b/.gitignore
index c67a6e18..96f9f38d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
+.DS_Store
.idea
-.vscode
+__debug_bin
!*.example
/config.yaml
*.log
@@ -7,3 +8,4 @@ paopao-ce*
/release
/data
/custom
+/.custom
diff --git a/.vscode/.gitignore b/.vscode/.gitignore
new file mode 100644
index 00000000..577ebbbe
--- /dev/null
+++ b/.vscode/.gitignore
@@ -0,0 +1,4 @@
+.DS_Store
+*.log
+__debug_bin
+settings.json
diff --git a/.vscode/launch.json b/.vscode/launch.json
new file mode 100644
index 00000000..fb60435b
--- /dev/null
+++ b/.vscode/launch.json
@@ -0,0 +1,14 @@
+{
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "name": "paopao-ce [debug]",
+ "type": "go",
+ "request": "launch",
+ "mode": "exec",
+ "program": "${workspaceFolder}/.vscode/__debug_bin",
+ "preLaunchTask": "go: build (debug)",
+ "cwd": "${workspaceFolder}"
+ }
+ ]
+}
diff --git a/.vscode/sort_launch.js b/.vscode/sort_launch.js
new file mode 100644
index 00000000..58d379e3
--- /dev/null
+++ b/.vscode/sort_launch.js
@@ -0,0 +1,4 @@
+let launch = require('./launch.json');
+launch.configurations.sort((a, b) => a.name.localeCompare(b.name));
+let fs = require('fs');
+fs.writeFileSync('launch.json', JSON.stringify(launch, null, 4));
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
new file mode 100644
index 00000000..b716d1a8
--- /dev/null
+++ b/.vscode/tasks.json
@@ -0,0 +1,21 @@
+{
+ "version": "2.0.0",
+ "tasks": [
+ {
+ "label": "go: build (debug)",
+ "type": "shell",
+ "command": "go",
+ "args": [
+ "build",
+ "-gcflags=all=-N -l",
+ "-tags",
+ "'embed go_json'",
+ "-o",
+ "${workspaceFolder}/.vscode/__debug_bin"
+ ],
+ "options": {
+ "cwd": "${workspaceFolder}"
+ }
+ }
+ ]
+}
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 00000000..7e917b31
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,178 @@
+# Changelog
+
+All notable changes to paopao-ce are documented in this file.
+## 0.4.0+dev ([`dev`](https://github.com/rocboss/paopao-ce/tree/dev))
+### Added
+- add `pprof` feature support [#327](https://github.com/rocboss/paopao-ce/pull/327)
+- use compiler profile-guided optimization (PGO) to further optimize builds. [#327](https://github.com/rocboss/paopao-ce/pull/327)
+- frontend: re-add stars page embed to profile page. [#339](https://github.com/rocboss/paopao-ce/pull/339)
+- simple support for user posts filter by style(post/comment/media/star). [#345](https://github.com/rocboss/paopao-ce/pull/345)
+- add user highlight tweet support include custom tweet set to highlight and list in user/profile page.
+
+### Changed
+- change man content width to 600px and optimize tweet/comment/replay text length. [#333](https://github.com/rocboss/paopao-ce/pull/333)
+
+## 0.3.1
+### Fixed
+- fixed: video player assets cdn error. [&caff8c0](https://github.com/rocboss/paopao-ce/commit/caff8c052be6c8d59576011192f830fd98e17ab3 'commit caff8c0')
+
+## 0.3.0
+### Added
+
+- add custom comment sort strategy support [#243](https://github.com/rocboss/paopao-ce/pull/243)
+- add `RedisCacheIndex` feature [#250](https://github.com/rocboss/paopao-ce/pull/250)
+- add `Sentry` feature [#258](https://github.com/rocboss/paopao-ce/pull/258)
+- add simple tweet share feature(just copy tweet link to clipboard now) support [#264](https://github.com/rocboss/paopao-ce/pull/264)
+- add default tweet max length configure in web/.env support. [&a1160ca](https://github.com/rocboss/paopao-ce/commit/a1160ca79380445157146d9eae1710543c153cce 'commit a1160ca')
+ Set the value of `VITE_DEFAULT_TWEET_MAX_LENGTH` in file web/.env to change the tweet max default length.
+ - add custom whether provide user register configure in web/.env support. [#267](https://github.com/rocboss/paopao-ce/pull/267)
+ Set the value of `VITE_ALLOW_USER_REGISTER` in file web/.env to custom whether provide user register feature.
+ ```
+ # file: web/.env or web/.env.local
+ ...
+ # 局部参数
+ VITE_ALLOW_USER_REGISTER=true
+ ...
+ ```
+ and disallow user register in backend(add `Web:DisallowUserRegister` feature in `config.yaml`):
+ ```yaml
+ # file config.yaml
+ ...
+ Features:
+ Default: ["Base", "Postgres", "Zinc", "LocalOSS", "LoggerZinc", "BigCacheIndex", "Friendship", "Service", "Web:DisallowUserRegister"]
+ ...
+ ```
+- add topic follow feature support [#273](https://github.com/rocboss/paopao-ce/pull/273)
+ mirgration database first(sql ddl file in `scripts/migration/**/*_topic_follow.up.sql`):
+ ```sql
+ CREATE TABLE `p_topic_user` (
+ `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
+ `topic_id` BIGINT UNSIGNED NOT NULL COMMENT '标签ID',
+ `user_id` BIGINT UNSIGNED NOT NULL COMMENT '创建者ID',
+ `alias_name` VARCHAR ( 255 ) COMMENT '别名',
+ `remark` VARCHAR ( 512 ) COMMENT '备注',
+ `quote_num` BIGINT UNSIGNED COMMENT '引用数',
+ `is_top` TINYINT UNSIGNED NOT NULL DEFAULT '0' COMMENT '是否置顶 0 为未置顶、1 为已置顶',
+ `created_on` BIGINT UNSIGNED NOT NULL DEFAULT '0' COMMENT '创建时间',
+ `modified_on` BIGINT UNSIGNED NOT NULL DEFAULT '0' COMMENT '修改时间',
+ `deleted_on` BIGINT UNSIGNED NOT NULL DEFAULT '0' COMMENT '删除时间',
+ `is_del` TINYINT UNSIGNED NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除',
+ `reserve_a` VARCHAR ( 255 ) COMMENT '保留字段a',
+ `reserve_b` VARCHAR ( 255 ) COMMENT '保留字段b',
+ PRIMARY KEY ( `id` ) USING BTREE,
+ UNIQUE KEY `idx_topic_user_uid_tid` ( `topic_id`, `user_id` ) USING BTREE
+ ) ENGINE = INNODB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户话题';
+ ```
+- add tweet comment thumbs up/down feature support [#275](https://github.com/rocboss/paopao-ce/pull/275)
+ mirgration database first(sql ddl file in `scripts/migration/**/*_comment_thumbs.up.sql`):
+- add load more comments feature support [&60b217b](https://github.com/rocboss/paopao-ce/commit/60b217bcd950c69ba45cebcaa17efdf8048d5a4f 'commit 60b217b')
+
+### Fixed
+
+- fixed sql ddl p_contact's column `is_delete` define error (change to `is_del`) in scripts/paopao-mysql.sql [&afd8fe1](https://github.com/rocboss/paopao-ce/commit/afd8fe18d2dce08a4af846c2f822379d99a3d3b3 'commit afd8fe1')
+- fixed cache index not expire in delete/add tweet error [#266](https://github.com/rocboss/paopao-ce/pull/266)
+- fixed tweet's owner not allow star/collection action when tweet is private error [#274](https://github.com/rocboss/paopao-ce/pull/274)
+- fixed user not list owner's collectioned private tweet error [#274](https://github.com/rocboss/paopao-ce/pull/274)
+- fixed comments thumbs up/down state incorrect error [#283](https://github.com/rocboss/paopao-ce/pull/283)
+
+### Fixed
+
+- fixed sql ddl p_contact's column `is_delete` define error (change to `is_del`) in scripts/paopao-mysql.sql [&afd8fe1](https://github.com/rocboss/paopao-ce/commit/afd8fe18d2dce08a4af846c2f822379d99a3d3b3 'commit afd8fe1')
+
+### Changed
+
+- use [github.com/rueian/rueidis](https://github.com/rueian/rueidis) as Redis client [#249](https://github.com/rocboss/paopao-ce/pull/249)
+ the **Old** redis client configure field
+ ```yaml
+ ...
+ Redis:
+ Host: redis:6379
+ Password:
+ DB:
+ ```
+ the **New** redis client configure field
+ ```yaml
+ ...
+ Redis:
+ InitAddress:
+ - redis:6379
+ Username:
+ Password:
+ SelectDB:
+ ConnWriteTimeout: 60 # 连接写超时时间 多少秒 默认 60秒
+ ```
+- optimize web frontend dark theme [&b082a8f](https://github.com/rocboss/paopao-ce/commit/b082a8fa5e43dd6dacf459df93fa7e243dd901ea 'commit b082a8f')
+- change web frontend main content layout default size to 544px [&b082a8f](https://github.com/rocboss/paopao-ce/commit/b082a8fa5e43dd6dacf459df93fa7e243dd901ea 'commit b082a8f')
+- optimize web frontend in mobile environment use Drawer to display menu [#265](https://github.com/rocboss/paopao-ce/pull/265)
+- optimize Dockerfile use pre-build builder/runner image to prevent network latency problem (`bitbus/paopao-ce-backend-builder` `bitbus/paopao-ce-backend-runner`) [#265](https://github.com/rocboss/paopao-ce/pull/265)
+- optimize web ui in mobile environment [#280](https://github.com/rocboss/paopao-ce/pull/280)
+- optimize upload zip attachment compatible with different browsers for uploading zip mimetype [#286](https://github.com/rocboss/paopao-ce/pull/286)
+- adapte meilisearch to version v1.1 [#288](https://github.com/rocboss/paopao-ce/pull/288)
+
+### Removed
+
+- remove `Deprecated:OldWeb` feature [#256](https://github.com/rocboss/paopao-ce/pull/256)
+
+## 0.2.5
+
+### Changed
+
+- fixed sql ddl error for contact table [#281](https://github.com/rocboss/paopao-ce/pull/281)
+
+## 0.2.4
+
+### Added
+
+- add PWA support for web frontend [#242](https://github.com/rocboss/paopao-ce/pull/242)
+
+
+## 0.2.3
+
+### Added
+
+- add PostgreSQL DDL file [#229](https://github.com/rocboss/paopao-ce/pull/229)
+
+### Changed
+
+- optimize MySQL DDL file [#229](https://github.com/rocboss/paopao-ce/pull/229)
+- optimize Sqlite3 DDL file [#229](https://github.com/rocboss/paopao-ce/pull/229)
+
+## 0.2.2
+
+### Fixed
+
+- fixed add star to tweet error [#222](https://github.com/rocboss/paopao-ce/pull/222)
+
+## 0.2.1
+
+### Changed
+
+- optimize docker-compose.yaml use bitbus/paopao-ce:latest as release image [#217](https://github.com/rocboss/paopao-ce/pull/217)
+
+### Fixed
+
+- fixed sql ddl in scripts/paopao-mysql.sql and scripts/paopao-sqlite3.sql [#217](https://github.com/rocboss/paopao-ce/pull/217)
+
+## 0.2.0
+
+### Added
+
+- add `Friendship` feature [#192](https://github.com/rocboss/paopao-ce/pull/192)
+- add `Lightship` feature [#198](https://github.com/rocboss/paopao-ce/pull/198)
+- add `Pyroscope` feature [#199](https://github.com/rocboss/paopao-ce/pull/199)
+- add new `Web` service [#196](https://github.com/rocboss/paopao-ce/pull/196)
+- add `Frontend:Web` feature [#196](https://github.com/rocboss/paopao-ce/pull/196)
+- add `Deprecated:OldWeb` feature [#196](https://github.com/rocboss/paopao-ce/pull/196)
+
+### Changes
+
+- support run multiple service in single paopao-ce instance [#196](https://github.com/rocboss/paopao-ce/pull/196)
+- use [go-mir](https://github.com/alimy/mir) optimize paopao-ce source code architecture [#196](https://github.com/rocboss/paopao-ce/pull/196)
+
+### Fixed
+
+- some other features optimize and bug fix
+
+---
+
+**Older change logs can be found on [GitHub](https://github.com/rocboss/paopao-ce/releases?after=v0.2.0).**
\ No newline at end of file
diff --git a/Dockerfile b/Dockerfile
index 65e9eba9..48190375 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,5 +1,7 @@
+# syntax=docker/dockerfile:experimental
+
# build frontend
-FROM node:18-alpine as frontend
+FROM node:19-alpine as frontend
ARG API_HOST
ARG USE_API_HOST=yes
ARG EMBED_UI=yes
@@ -11,15 +13,11 @@ RUN [ $EMBED_UI != yes ] || [ $USE_DIST != no ] || (yarn && yarn build)
RUN [ $EMBED_UI = yes ] || mkdir dist || echo ""
# build backend
-FROM golang:1.18-alpine AS backend
+FROM bitbus/paopao-ce-backend-builder:latest AS backend
ARG API_HOST
ARG USE_API_HOST=yes
ARG EMBED_UI=yes
ARG USE_DIST=no
-RUN apk --no-cache --no-progress add --virtual \
- build-deps \
- build-base \
- git
WORKDIR /paopao-ce
COPY . .
@@ -28,19 +26,18 @@ ENV GOPROXY=https://goproxy.cn
RUN [ $EMBED_UI != yes ] || make build TAGS='embed go_json'
RUN [ $EMBED_UI = yes ] || make build TAGS='go_json'
-FROM alpine:3.16
+FROM bitbus/paopao-ce-backend-runner:latest
ARG API_HOST
ARG USE_API_HOST=yes
ARG EMBED_UI=yes
ARG USE_DIST=no
ENV TZ=Asia/Shanghai
-RUN apk update && apk add --no-cache ca-certificates && update-ca-certificates
WORKDIR /app/paopao-ce
COPY --from=backend /paopao-ce/release/paopao-ce .
-COPY configs ./configs
+COPY --from=backend /paopao-ce/config.yaml.sample config.yaml
-VOLUME ["/app/paopao-ce/configs"]
+VOLUME ["/app/paopao-ce/custom"]
EXPOSE 8008
HEALTHCHECK --interval=5s --timeout=3s --retries=3 CMD ps -ef | grep paopao-ce || exit 1
ENTRYPOINT ["/app/paopao-ce/paopao-ce"]
diff --git a/Makefile b/Makefile
index 3104045c..8b1d1dae 100644
--- a/Makefile
+++ b/Makefile
@@ -4,37 +4,38 @@ TARGET = paopao-ce
ifeq ($(OS),Windows_NT)
TARGET := $(TARGET).exe
endif
+TARGET_BIN = $(basename $(TARGET))
ifeq (n$(CGO_ENABLED),n)
CGO_ENABLED := 1
endif
RELEASE_ROOT = release
-RELEASE_FILES = LICENSE README.md config.yaml.sample scripts configs
+RELEASE_FILES = LICENSE README.md CHANGELOG.md config.yaml.sample docker-compose.yaml scripts docs
RELEASE_LINUX_AMD64 = $(RELEASE_ROOT)/linux-amd64/$(TARGET)
RELEASE_DARWIN_AMD64 = $(RELEASE_ROOT)/darwin-amd64/$(TARGET)
RELEASE_DARWIN_ARM64 = $(RELEASE_ROOT)/darwin-arm64/$(TARGET)
RELEASE_WINDOWS_AMD64 = $(RELEASE_ROOT)/windows-amd64/$(TARGET)
-BUILD_VERSION := $(shell git describe --tags | cut -f 1 -d "-")
+BUILD_VERSION := $(shell git describe --tags --always | cut -f1 -f2 -d "-")
BUILD_DATE := $(shell date +'%Y-%m-%d %H:%M:%S')
SHA_SHORT := $(shell git rev-parse --short HEAD)
TAGS = ""
MOD_NAME = github.com/rocboss/paopao-ce
-LDFLAGS = -X "${MOD_NAME}/pkg/debug.version=${BUILD_VERSION}" \
- -X "${MOD_NAME}/pkg/debug.buildDate=${BUILD_DATE}" \
- -X "${MOD_NAME}/pkg/debug.commitID=${SHA_SHORT}" -w -s
+LDFLAGS = -X "${MOD_NAME}/pkg/version.version=${BUILD_VERSION}" \
+ -X "${MOD_NAME}/pkg/version.buildDate=${BUILD_DATE}" \
+ -X "${MOD_NAME}/pkg/version.commitID=${SHA_SHORT}" -w -s
all: fmt build
build:
@go mod download
@echo Build paopao-ce
- @go build -trimpath -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -o $(RELEASE_ROOT)/$(TARGET)
+ @go build -pgo=auto -trimpath -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -o $(RELEASE_ROOT)/$(TARGET)
run:
- @go run -trimpath -gcflags "all=-N -l" -tags '$(TAGS)' -ldflags '$(LDFLAGS)' .
+ @go run -pgo=auto -trimpath -gcflags "all=-N -l" -tags '$(TAGS)' -ldflags '$(LDFLAGS)' .
.PHONY: release
release: linux-amd64 darwin-amd64 darwin-arm64 windows-x64
@@ -50,37 +51,37 @@ release: linux-amd64 darwin-amd64 darwin-arm64 windows-x64
.PHONY: linux-amd64
linux-amd64:
- @echo Build paopao-ce [linux-amd64] CGO_ENABLED=$(CGO_ENABLED)
- @CGO_ENABLED=$(CGO_ENABLED) GOOS=linux GOARCH=amd64 go build -trimpath -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -o $(RELEASE_LINUX_AMD64)/$(TARGET)
+ @echo Build paopao-ce [linux-amd64] CGO_ENABLED=$(CGO_ENABLED) TAGS="'$(TAGS)'"
+ @CGO_ENABLED=$(CGO_ENABLED) GOOS=linux GOARCH=amd64 go build -pgo=auto -trimpath -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -o $(RELEASE_LINUX_AMD64)/$(TARGET_BIN)
.PHONY: darwin-amd64
darwin-amd64:
- @echo Build paopao-ce [darwin-amd64] CGO_ENABLED=$(CGO_ENABLED)
- @CGO_ENABLED=$(CGO_ENABLED) GOOS=darwin GOARCH=amd64 go build -trimpath -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -o $(RELEASE_DARWIN_AMD64)/$(TARGET)
+ @echo Build paopao-ce [darwin-amd64] CGO_ENABLED=$(CGO_ENABLED) TAGS="'$(TAGS)'"
+ @CGO_ENABLED=$(CGO_ENABLED) GOOS=darwin GOARCH=amd64 go build -pgo=auto -trimpath -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -o $(RELEASE_DARWIN_AMD64)/$(TARGET_BIN)
.PHONY: darwin-arm64
darwin-arm64:
- @echo Build paopao-ce [darwin-arm64] CGO_ENABLED=$(CGO_ENABLED)
- @CGO_ENABLED=$(CGO_ENABLED) GOOS=darwin GOARCH=arm64 go build -trimpath -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -o $(RELEASE_DARWIN_ARM64)/$(TARGET)
+ @echo Build paopao-ce [darwin-arm64] CGO_ENABLED=$(CGO_ENABLED) TAGS="'$(TAGS)'"
+ @CGO_ENABLED=$(CGO_ENABLED) GOOS=darwin GOARCH=arm64 go build -pgo=auto -trimpath -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -o $(RELEASE_DARWIN_ARM64)/$(TARGET_BIN)
.PHONY: windows-x64
windows-x64:
- @echo Build paopao-ce [windows-x64] CGO_ENABLED=$(CGO_ENABLED)
- @CGO_ENABLED=$(CGO_ENABLED) GOOS=windows GOARCH=amd64 go build -trimpath -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -o $(RELEASE_WINDOWS_AMD64)/$(basename $(TARGET)).exe
+ @echo Build paopao-ce [windows-x64] CGO_ENABLED=$(CGO_ENABLED) TAGS="'$(TAGS)'"
+ @CGO_ENABLED=$(CGO_ENABLED) GOOS=windows GOARCH=amd64 go build -pgo=auto -trimpath -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -o $(RELEASE_WINDOWS_AMD64)/$(TARGET_BIN).exe
.PHONY: generate
-generate: gen-mir gen-grpc
+generate: gen-mir gen-rpc
.PHONY: gen-mir
gen-mir:
- @go generate mirc/main.go
+ @go generate mirc/gen.go
@go fmt ./auto/api/...
-.PHONY: gen-grpc
-gen-grpc:
- @rm -rf auto/rpc
+.PHONY: gen-rpc
+gen-rpc:
+ @rm -rf auto/rpc auto/connect
@buf generate proto
- @go fmt ./auto/rpc/...
+ @go fmt ./auto/rpc/... ./auto/connect/...
.PHONY: proto-mod
proto-mod:
@@ -109,9 +110,11 @@ pre-commit: fmt
.PHONY: install-protobuf-plugins
install-protobuf-plugins:
- @go install github.com/bufbuild/buf/cmd/buf@v1.11.0
- @go install github.com/bufbuild/buf/cmd/protoc-gen-buf-breaking@v1.11.0
- @go install github.com/bufbuild/buf/cmd/protoc-gen-buf-lint@v1.11.0
+ @go install github.com/bufbuild/buf/cmd/buf@v1.25.0
+ @go install github.com/bufbuild/buf/cmd/protoc-gen-buf-breaking@v1.25.0
+ @go install github.com/bufbuild/buf/cmd/protoc-gen-buf-lint@v1.25.0
+ @go install github.com/bufbuild/connect-go/cmd/protoc-gen-connect-go@latest
+ @go install github.com/fullstorydev/grpcurl/cmd/grpcurl@latest
@go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
@go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
diff --git a/README.md b/README.md
index d86d454d..7cf224b7 100644
--- a/README.md
+++ b/README.md
@@ -65,7 +65,7 @@ PaoPao主要由以下优秀的开源项目/工具构建
### 环境要求
-* Go (1.18+)
+* Go (1.20+)
* Node.js (14+)
* MySQL (5.7+)
* Redis
@@ -194,7 +194,10 @@ PaoPao主要由以下优秀的开源项目/工具构建
docker build -t your/paopao-ce:tag --build-arg EMBED_UI=no .
# 运行
- docker run -d -p 8008:8008 -v ${PWD}/config.yaml.sample:/app/paopao-ce/config.yaml your/paopao-ce:tag
+ mkdir custom && docker run -d -p 8008:8008 -v ${PWD}/custom:/app/paopao-ce/custom -v ${PWD}/config.yaml.sample:/app/paopao-ce/config.yaml your/paopao-ce:tag
+
+ # 或者直接运行构建好的docker image
+ mkdir custom && docker run -d -p 8008:8008 -v ${PWD}/custom:/app/paopao-ce/custom -v ${PWD}/config.yaml.sample:/app/paopao-ce/config.yaml bitbus/paopao-ce:latest
```
* 前端:
@@ -217,8 +220,10 @@ PaoPao主要由以下优秀的开源项目/工具构建
### 方式三. 使用 docker-compose 运行
```sh
git clone https://github.com/rocboss/paopao-ce.git
-docker compose up --build
-# visit paopao-ce(http://127.0.0.1:8008) and phpMyadmin(http://127.0.0.1:8080)
+cd paopao-ce && docker compose up -d
+# visit http://localhost:8008 👀 paopao-ce
+# visit http://localhost:8001 👀 RedisInsight
+# visit http://localhost:8080 👀 phpMyAdmin
```
默认是使用config.yaml.sample的配置,如果需要自定义配置,请拷贝默认配置文件(比如config.yaml),修改后再同步配置到docker-compose.yaml如下:
@@ -227,8 +232,7 @@ docker compose up --build
# file: docker-compose.yaml
...
backend:
- build:
- context: .
+ image: bitbus/paopao-ce:latest
restart: always
depends_on:
- db
@@ -246,8 +250,18 @@ docker compose up --build
> 注意:默认提供的 docker-compose.yaml 初衷是搭建本机开发调试环境,如果需要产品部署供外网访问,请自行调优配置参数或使用其他方式部署。
-### API 文档
-* `config.yaml` 添加 `Docs:OpenAPI` 功能项:
+### 开发文档
+#### Docs文档说明
+`docs`目录提供了各种开发文档,包括:
+* [deploy](docs/deploy/) - paopao-ce部署文档
+* [discuss](docs/discuss/) - 开发相关的问题交流论述文档
+* [openapi](docs/openapi/) - paopao-ce后端导出API文档
+* [proposal](docs/proposal/) - paopao-ce功能特性提按文档
+> 比如,关于paopao-ce的设计定位,可以参考[docs/proposal/001-关于paopao-ce的设计定位](docs/proposal/001-关于paopao-ce的设计定位.md),简要阐述了paopao-ce是如何定位自身的。
+
+#### API文档
+开发者可以在本地开启`Docs`服务,浏览后端导出的API服务接口文档。
+* `config.yaml` 添加 `Docs` 功能项:
```yaml
...
Features:
@@ -260,7 +274,7 @@ Features:
```sh
make run TAGS='docs'
-# visit http://127.0.0.1:8008/docs/openapi
+# visit http://127.0.0.1:8011/docs/openapi
```
### 配置说明
@@ -328,11 +342,11 @@ release/paopao-ce --no-default-features --features sqlite3,localoss,loggerfile,r
|`Bot` | 子服务 | WIP | 开启Bot服务|
|`NativeOBS` | 子服务 | WIP | 开启NativeOBS服务|
|`Docs` | 子服务 | WIP | 开启开发者文档服务|
-|`Frontend:Web` | 子服务 | 内测 | 开启独立前端服务|
-|`Frontend:EmbedWeb` | 子服务 | 内测 | 开启内嵌于后端Web API服务中的前端服务|
-|`Deprecated:Web` | 子服务 | 稳定 | 开启旧的Web服务|
+|`Frontend:Web` | 子服务 | 稳定 | 开启独立前端服务|
+|`Frontend:EmbedWeb` | 子服务 | 稳定 | 开启内嵌于后端Web API服务中的前端服务|
|`Gorm` | 数据库 | 稳定(默认) | 使用[gorm](https://github.com/go-gorm/gorm)作为数据库的ORM,默认使用 `Gorm` + `MySQL`组合|
|`Sqlx`| 数据库 | WIP | 使用[sqlx](https://github.com/jmoiron/sqlx)作为数据库的ORM|
+|`Sqlc`| 数据库 | WIP | 使用[sqlc](https://github.com/kyleconroy/sqlc)自动生成ORM代码|
|`MySQL`| 数据库 | 稳定(默认) | 使用MySQL作为数据库|
|`Postgres`| 数据库 | 稳定 | 使用PostgreSQL作为数据库|
|`Sqlite3`| 数据库 | 稳定 | 使用Sqlite3作为数据库|
@@ -345,20 +359,26 @@ release/paopao-ce --no-default-features --features sqlite3,localoss,loggerfile,r
|`OSS:Retention` | 对象存储 | 内测 |基于对象存储系统的对象过期自动删除特性实现 先创建临时对象再持久化的功能|
|`OSS:TempDir` | 对象存储 | 内测 |基于对象存储系统的对象拷贝/移动特性实现 先创建临时对象再持久化的功能|
|`Redis` | 缓存 | 稳定 | Redis缓存功能 |
-|`SimpleCacheIndex` | 缓存 | 稳定 | 提供简单的 广场推文列表 的缓存功能 |
+|`SimpleCacheIndex` | 缓存 | Deprecated | 提供简单的 广场推文列表 的缓存功能 |
|`BigCacheIndex` | 缓存 | 稳定(推荐) | 使用[BigCache](https://github.com/allegro/bigcache)缓存 广场推文列表,缓存每个用户每一页,简单做到千人千面 |
+|`RedisCacheIndex` | 缓存 | 内测(推荐) | 使用Redis缓存 广场推文列表,缓存每个用户每一页,简单做到千人千面 |
|`Zinc` | 搜索 | 稳定(推荐) | 基于[Zinc](https://github.com/zinclabs/zinc)搜索引擎提供推文搜索服务 |
|`Meili` | 搜索 | 稳定(推荐) | 基于[Meilisearch](https://github.com/meilisearch/meilisearch)搜索引擎提供推文搜索服务 |
|`Bleve` | 搜索 | WIP | 基于[Bleve](https://github.com/blevesearch/bleve)搜索引擎提供推文搜索服务 |
+|[`Sentry`](docs/proposal/23040412-关于使用sentry用于错误追踪与性能检测的设计.md) | 监控 | 内测 | 使用Sentry进行错误跟踪与性能监控 |
|`LoggerFile` | 日志 | 稳定 | 使用文件写日志 |
|`LoggerZinc` | 日志 | 稳定(推荐) | 使用[Zinc](https://github.com/zinclabs/zinc)写日志 |
|`LoggerMeili` | 日志 | 内测 | 使用[Meilisearch](https://github.com/meilisearch/meilisearch)写日志 |
-|`Friendship` | 关系模式 | 内测(默认) | 弱关系好友模式,类似微信朋友圈 |
-|`Followship` | 关系模式 | WIP | 关注者模式,类似Twitter的Follow模式 |
+|[`Friendship`](docs/proposal/002-关于Friendship功能项的设计.md) | 关系模式 | 内测 | 弱关系好友模式,类似微信朋友圈 |
+|[`Followship`](docs/proposal/003-关于Followship功能项的设计.md) | 关系模式 | WIP | 关注者模式,类似Twitter的Follow模式 |
+|[`Lightship`](docs/proposal/011-关于Lightship功能项的设计.md) | 关系模式 | 内测(默认) | 开放模式,所有推文都公开可见 |
|`Alipay` | 支付 | 稳定 | 开启基于[支付宝开放平台](https://open.alipay.com/)的钱包功能 |
|`Sms` | 短信验证 | 稳定 | 开启短信验证码功能,用于手机绑定验证手机是否注册者的;功能如果没有开启,手机绑定时任意短信验证码都可以绑定手机 |
|`Docs:OpenAPI` | 开发文档 | 稳定 | 开启openapi文档功能,提供web api文档说明(visit http://127.0.0.1:8008/docs/openapi) |
+|[`Pyroscope`](docs/proposal/23021510-关于使用pyroscope用于性能调试的设计.md)| 性能优化 | 内测 | 开启Pyroscope功能用于性能调试 |
+|[`Pprof`](docs/proposal/23062905-添加Pprof功能特性用于获取Profile.md)| 性能优化 | 内测 | 开启Pprof功能收集Profile信息 |
|`PhoneBind` | 其他 | 稳定 | 手机绑定功能 |
+|`Web:DisallowUserRegister` | 功能特性 | 稳定 | 不允许用户注册 |
> 功能项状态详情参考 [features-status](features-status.md).
@@ -416,19 +436,10 @@ docker run -d --name meili -v ${PWD}/data/meili/data:/meili_data -p 7700:7700 -e
# 使用docker compose运行,需要删除docker-compose.yaml中关于meili的注释
docker compose up -d meili
-# 使用docker运行meilisearch的ui管理前端
-docker run -d --name uirecord -p 7701:3000 bitriory/uirecord
-# visit http://localhost:7701
-
-# 使用docker compose运行meilisearch的ui管理前端,需要删除docker-compose.yaml中关于uirecord的注释
-docker compose up -d uirecord
-# visit http://loclahost:7701
-
# 查看meili运行状态
docker compose ps
NAME COMMAND SERVICE STATUS PORTS
paopao-ce-meili-1 "tini -- /bin/sh -c …" meili running 0.0.0.0:7700->7700/tcp
-paopao-ce-uirecord-1 "docker-entrypoint.s…" uirecord running 0.0.0.0:7701->3000/tcp
```
* 修改Meili配置
@@ -480,6 +491,32 @@ MinIO: # MinIO 存储配置
...
```
+#### [Pyroscope](https://github.com/pyroscope-io/pyroscope) 性能剖析
+* Pyroscope运行
+```sh
+mkdir -p data/minio/data
+
+# 使用Docker运行
+docker run -it -p 4040:4040 pyroscope/pyroscope:latest server
+# 使用docker compose运行, 需要删除docker-compose.yaml中关于pyroscope的注释
+docker compose up -d pyroscope
+# visit http://loclahost:4040
+```
+
+* 修改Pyroscope配置
+```yaml
+# features中加上 MinIO
+Features:
+ Default: ["Meili", "LoggerMeili", "Base", "Sqlite3", "BigCacheIndex", "Pyroscope"]
+...
+Pyroscope: # Pyroscope配置
+ AppName: "paopao-ce"
+ Endpoint: "http://localhost:4040" # Pyroscope server address
+ AuthToken: # Pyroscope authentication token
+ Logger: none # Pyroscope logger (standard | logrus | none)
+...
+```
+
### 源代码分支管理
**主代码库`github.com/rocboss/paopao-ce`**
```bash
@@ -492,20 +529,48 @@ feature/followship
feature/mir
feature/localoss
jc/alimy
+r/paopao-plus
+r/paopao-pro
x/sqlc
x/sqlx
```
-**分支说明**
-* 分支`main`是主分支,也是paopao-ce的稳定版本发布分支,只有经过内部测试,没有重大bug出现的稳定代码才会推进到这个分支;该分支主要由`beta`分支代码演进而来,原则上**只接受bug修复PR**。`rc版本/稳定版本` 发布都应该在`main`主分支中进行。
-* 分支`beta`是公测分支,代码推进到`main`主分支的候选分支;该分支主要由`dev`分支代码演进而来,**接受bug修复以及新功能优化的PR**,原则上不接受新功能PR。`alpha/beta版本` 发布都应该在`beta`公测分支下进行。
-* 分支`dev`是开发分支,**不定期频繁更新**,接受 *新功能PR、代码优化PR、bug修复PR*;**新功能PR** 都应该首先提交给`dev`分支进行合并,bug修复/代码优化 后 **冻结新功能** 将代码演进合并到`beta`分支。
-* `feature/*`是新功能子分支,一般新功能子分支都是 *从`dev`开发分支fork出来的*;子功能分支 **只专注于该新功能** 代码的开发/优化,待开发接近内测阶段 *提交新功能PR给`dev`分支进行review/merge*,待新功能代码演进到`beta`分支后,原则上是可以删除该分支,但也可以保留到稳定版本发布。**该分支专注于新功能的开发,只接受新功能的bug修复/优化PR**。
-* `jc/*`是代码库维护者的开发分支,一般包含一些局部优化或者bug修复代码,有时可以直接将代码merge到`dev/beta`分支,原则上不允许直接merge代码到`main`主分支。
-* `x/*`是技术实验分支,某些技术的引入需要经过具体的代码实现与真实场景的测评,考量评估后如果某项技术适合引入到paopao-ce,就fork出一个`feature/*`分支,作为新功能引入到paopao-ce。一般一些比较激进的技术,从`dev`分支fork出一个新的`x/*`分支,各种尝试、考量、评估后,或丢弃、或引入到paopao-ce。
+**分支说明**
+| 名称 | 说明 | 备注|
+| ----- | ----- | ----- |
+| [`main`](https://github.com/rocboss/paopao-ce) | 主分支 |分支`main`是主分支,也是paopao-ce的稳定版本发布分支,只有经过内部测试,没有重大bug出现的稳定代码才会推进到这个分支;该分支主要由`beta`分支代码演进而来,原则上**只接受bug修复PR**。`rc版本/稳定版本` 发布都应该在`main`主分支中进行。|
+| [`beta`](https://github.com/rocboss/paopao-ce/tree/beta) | 公测分支 |分支`beta`是公测分支,代码推进到`main`主分支的候选分支;该分支主要由`alpha`分支代码演进而来,**接受bug修复以及新功能优化的PR**,原则上不接受新功能PR。`beta版本` 发布都应该在`beta`公测分支下进行。|
+| [`alpha`](https://github.com/rocboss/paopao-ce/tree/alpha) | 内测分支 |分支`alpha`是内测分支,代码推进到`beta`分支的候选分支;该分支主要由`dev`分支代码演进而来,**接受bug修复以及新功能相关的PR**,接受新功能PR。分支代码演进到一个里程碑式的阶段后**冻结所有新功能**,合并代码到`beta`公测分支进行下一阶段的持续演进。`alpha版本` 发布都应该在`alpha`内测分支下进行。|
+| [`dev`](https://github.com/rocboss/paopao-ce/tree/dev) | 开发分支 | 分支`dev`是开发分支,**不定期频繁更新**,接受 *新功能PR、代码优化PR、bug修复PR*;**新功能PR** 都应该首先提交给`dev`分支进行合并,bug修复/新功能开发/代码优化 **阶段性冻结** 后将代码演进合并到`alpha`分支。|
+| `feature/*` | 子功能分支 |`feature/*`是新功能子分支,一般新功能子分支都是 *从`dev`开发分支fork出来的*;子功能分支 **只专注于该新功能** 代码的开发/优化,待开发接近内测阶段 *提交新功能PR给`dev`分支进行review/merge*,待新功能代码演进到`beta`分支后,原则上是可以删除该分支,但也可以保留到稳定版本发布。**该分支专注于新功能的开发,只接受新功能的bug修复/优化PR**。|
+| `jc/*` |维护者的开发分支|`jc/*`是代码库维护者的开发分支,一般包含一些局部优化或者bug修复代码,有时可以直接将代码merge到`dev/beta`分支,原则上不允许直接merge代码到`main`主分支。|
+| `x/*` |实验分支|`x/*`是技术实验分支,某些技术的引入需要经过具体的代码实现与真实场景的测评,考量评估后如果某项技术适合引入到paopao-ce,就fork出一个`feature/*`分支,作为新功能引入到paopao-ce。一般一些比较激进的技术,从`dev`分支fork出一个新的`x/*`分支,各种尝试、考量、评估后,或丢弃、或引入到paopao-ce。|
+| `t/*` | 临时分支 |`t/*`是临时发版本分支,一般 `beta` 分支演进到正式版本发布前的最后某个beta版本(比如v0.2.0-beta)就从beta分支fork出一个 `t/*` 分支用于向 `main` 分支提交 PR 用于Review,待 PR Reviewed 合并到 `main` 分支后,可以删除这个临时创建的分支。这样设计主要是考虑到有时合并到 `main` 分支时,需要Review的时间可能会长一些,而dev分支的代码又急需推进到beta分支以发布下一个alpha版本用于内测,相当于为下一个测试版本发布腾地方。|
+| `r/*` |发行版本分支|`r/*`是不同发行版本分支,不同发行版本各有不同的侧重点,可以根据需要选择适合的发行版本。|
+
+**发行版本分支说明**
+| 名称 | 说明 | 维护者 | 备注 |
+| ----- | ----- | ----- | ----- |
+|[`paopao-ce`](https://github.com/rocboss/paopao-ce/tree/dev)|paopao-ce 主发行版本|[ROC](https://github.com/rocboss 'ROC')|该分支 [数据逻辑层](https://github.com/rocboss/paopao-ce/tree/dev/internal/dao/jinzhu) 使用[gorm](https://github.com/go-gorm/gorm)作为数据逻辑层的ORM框架,适配MySQL/PostgreSQL/Sqlite3数据库。|
+|[`r/paopao-ce`](https://github.com/rocboss/paopao-ce/tree/r/paopao-ce)|paopao-ce 主分支预览版本|[ROC](https://github.com/rocboss 'ROC')
[北野](https://github.com/alimy 'Michael Li')|该分支 [数据逻辑层](https://github.com/rocboss/paopao-ce/tree/dev/internal/dao/jinzhu) 使用[gorm](https://github.com/go-gorm/gorm)作为数据逻辑层的ORM框架,适配MySQL/PostgreSQL/Sqlite3数据库。代码较`main`分支新,是主发行版本的前瞻预览版本。|
+|[`r/paopao-ce-plus`](https://github.com/rocboss/paopao-ce/tree/r/paopao-ce-plus)|paopao-ce-plus 发行版本|[北野](https://github.com/alimy 'Michael Li')|该分支 [数据逻辑层](https://github.com/rocboss/paopao-ce/tree/r/paopao-ce-plus/internal/dao/sakila) 使用[sqlx](https://github.com/jmoiron/sqlx)作为数据逻辑层的ORM框架,专注于为MySQL/PostgreSQL/Sqlite3使用更优化的查询语句以提升数据检索效率。建议熟悉[sqlx](https://github.com/jmoiron/sqlx)的开发人员可以基于此版本来做 二次开发。|
+|[`r/paopao-ce-pro`](https://github.com/rocboss/paopao-ce/tree/r/paopao-ce-pro)|paopao-ce-pro 发行版本|[北野](https://github.com/alimy 'Michael Li')|该分支 [数据逻辑层](https://github.com/rocboss/paopao-ce/tree/r/paopao-ce-pro/internal/dao/slonik) 使用[sqlc](https://github.com/kyleconroy/sqlc)作为sql语句生成器自动生成ORM代码,专门针对特定数据库MySQL/PostgreSQL进行查询优化,熟悉[sqlc](https://github.com/kyleconroy/sqlc)的开发人员可以基于此版本来做 二次开发。(另:分支目前只使用[pgx-v5](https://github.com/jackc/pgx)适配了PostgreSQL数据库,后续或许会适配MySQL/TiDB数据库。)|
+|[`r/paopao-ce-xtra`](https://github.com/rocboss/paopao-ce/tree/r/paopao-ce-xtra)|paopao-ce-xtra 发行版本|[北野](https://github.com/alimy 'Michael Li')|该分支 是r/paopao-ce、r/paopao-ce-plus、r/paopao-ce-pro的合集|
+|[`r/paopao-ce-mini`](https://github.com/rocboss/paopao-ce/tree/r/paopao-ce-mini)|paopao-ce-mini 发行版本|[北野](https://github.com/alimy 'Michael Li')|该分支是paopao-ce最小可用版本,专注于个人部署、一键傻瓜式最简部署|
**代码分支演进图**
![](docs/proposal/.assets/000-01.png)
+### 部署站点信息
+* [官方 paopao.info](https://www.paopao.info)
+> 具体部署站点信息请查阅 [deployed-sites](./deployed-sites.md 'deployed sites'). 欢迎站长将已部署PaoPao实例的站点信息添加到 [deployed-sites](./deployed-sites.md 'deployed sites') 列表中。
+
+#### Collaborator's paopao account
+| 昵称 | [@GitHub](https://github.com 'github.com') | [@PaoPao](https://www.paopao.info 'paopao.info') |
+| ----- | ----- | ----- |
+| ROC | [ROC](https://github.com/rocboss 'ROC')|[ROC](https://www.paopao.info/#/user?username=roc 'ROC @roc')|
+| [北野](https://alimy.me '糊涂小栈') | [Michael Li](https://github.com/alimy 'Michael Li') | [alimy](https://www.paopao.info/#/user?username=alimy '北野 @alimy')|
+| orzi!| [orzi!](https://github.com/orziz 'orzi!')||
+
### 其他说明
建议后端服务使用 `supervisor` 守护进程,并通过 `nginx` 反向代理后,提供API给前端服务调用。
diff --git a/ROADMAP.md b/ROADMAP.md
index fc0e6681..fa77d3be 100644
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@ -1,18 +1,35 @@
## Roadmap for paopao-ce
-paopao-ce roadmap.
+[paopao-ce](https://github.com/rocboss/paopao-ce/tree/dev)/[paopao-ce-plus](https://github.com/rocboss/paopao-ce/tree/r/paopao-ce-plus)/[paopao-ce-pro](https://github.com/rocboss/paopao-ce/tree/r/paopao-ce-pro) features develop or optimize and bug fix roadmap.
-### v0.2.0
+## paopao-ce roadmap
+#### dev+
+* [ ] add `Followship` feature
+* [ ] add `Auth:Bcrypt` feature
+* [ ] add `Auth:MD5` feature (just for compatible)
+* [x] add extend base ORM code for implement data logic base sqlx/sqlc
+* [ ] optimize media tweet submit logic
+* [ ] optimize search logic service
+
+#### v0.3.0
+* [x] remove `Deprecated:OldWeb` feature
+* [x] add user topic follow feature support
+* [x] add tweet link share support
+* [ ] add comment thumbsUp/thumbsDown support
+* [x] add `RedisCacheIndex` feature
+* [x] add `Sentry` feature
+
+#### v0.2.0
* [x] add `Friendship` feature
-* [ ] add `Lightship` feature
-* [ ] add `Sqlx` feature
+* [x] add `Lightship` feature
+* [ ] add extend base ORM code for implement data logic base sqlx/sqlc
+* [x] add `Pyroscope` feature
* [x] add new `Web` service
* [x] add `Frontend:Web` feature
* [x] add `Deprecated:OldWeb` feature
* [x] support run multiple service in single paopao-ce instance
* [x] use [go-mir](https://github.com/alimy/mir) optimize paopao-ce source code architecture
-### Next
-* [ ] add `Followship` feature
+#### Next
* [ ] add `Bleve` feature
* [ ] add `SpaceX` feature
* [ ] add `Bot` feature
@@ -24,8 +41,30 @@ paopao-ce roadmap.
* [ ] add tweet resource access control base on simple RBAC support
* [ ] add user's `Activation Code` feature support
* [ ] add user block feature support
-* [ ] optimize current message push logic service use `ims` module
-* [ ] optimize media tweet submit logic
+* [ ] add i18n support
+* [ ] add reactions support
+* [ ] add tweet thread like twitter support
+* [ ] add short link support
* [ ] optimize topics service
+* [ ] optimize current message push logic service use `ims` module
* [ ] optimize backend data logic service(optimize database CRUD operate)
-* [ ] optimize search logic service
+
+## paopao-ce-plus roadmap
+#### paopao-ce-plus/v0.4.0
+* [ ] adapt for paopao-ce v0.4.0
+
+#### paopao-ce-plus/v0.3.0
+* [ ] adapt for paopao-ce v0.3.0
+
+#### paopao-ce-plus/v0.2.0
+* [ ] adapt for paopao-ce v0.2.0
+
+## paopao-ce-pro roadmap
+#### paopao-ce-pro/v0.4.0
+* [ ] adapt for paopao-ce v0.4.0
+
+#### paopao-ce-pro/v0.3.0
+* [ ] adapt for paopao-ce v0.3.0
+
+#### paopao-ce-pro/v0.2.0
+* [ ] adapt for paopao-ce v0.2.0
diff --git a/auto/api/m/v1/user.go b/auto/api/m/v1/user.go
index 431343e7..8918a199 100644
--- a/auto/api/m/v1/user.go
+++ b/auto/api/m/v1/user.go
@@ -1,14 +1,29 @@
// Code generated by go-mir. DO NOT EDIT.
+// versions:
+// - mir v4.0.0
package v1
import (
"net/http"
- "github.com/alimy/mir/v3"
+ "github.com/alimy/mir/v4"
"github.com/gin-gonic/gin"
)
+type _binding_ interface {
+ Bind(*gin.Context) mir.Error
+}
+
+type _render_ interface {
+ Render(*gin.Context)
+}
+
+type _default_ interface {
+ Bind(*gin.Context, any) mir.Error
+ Render(*gin.Context, any, mir.Error)
+}
+
type LoginReq struct {
AgentInfo AgentInfo `json:"agent_info"`
Name string `json:"name"`
@@ -35,6 +50,8 @@ type UserInfo struct {
}
type User interface {
+ _default_
+
// Chain provide handlers chain for gin
Chain() gin.HandlersChain
@@ -44,21 +61,8 @@ type User interface {
mustEmbedUnimplementedUserServant()
}
-type UserBinding interface {
- BindLogin(*gin.Context) (*LoginReq, mir.Error)
-
- mustEmbedUnimplementedUserBinding()
-}
-
-type UserRender interface {
- RenderLogout(*gin.Context, mir.Error)
- RenderLogin(*gin.Context, *LoginResp, mir.Error)
-
- mustEmbedUnimplementedUserRender()
-}
-
// RegisterUserServant register User servant to gin
-func RegisterUserServant(e *gin.Engine, s User, b UserBinding, r UserRender) {
+func RegisterUserServant(e *gin.Engine, s User) {
router := e.Group("m/v1")
// use chain for router
middlewares := s.Chain()
@@ -72,30 +76,26 @@ func RegisterUserServant(e *gin.Engine, s User, b UserBinding, r UserRender) {
default:
}
- r.RenderLogout(c, s.Logout())
+ s.Render(c, nil, s.Logout())
})
-
router.Handle("POST", "/user/login/", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindLogin(c)
- if err != nil {
- r.RenderLogin(c, nil, err)
+ req := new(LoginReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
return
}
resp, err := s.Login(req)
- r.RenderLogin(c, resp, err)
+ s.Render(c, resp, err)
})
-
}
// UnimplementedUserServant can be embedded to have forward compatible implementations.
-type UnimplementedUserServant struct {
-}
+type UnimplementedUserServant struct{}
func (UnimplementedUserServant) Chain() gin.HandlersChain {
return nil
@@ -110,31 +110,3 @@ func (UnimplementedUserServant) Login(req *LoginReq) (*LoginResp, mir.Error) {
}
func (UnimplementedUserServant) mustEmbedUnimplementedUserServant() {}
-
-// UnimplementedUserRender can be embedded to have forward compatible implementations.
-type UnimplementedUserRender struct {
- RenderAny func(*gin.Context, any, mir.Error)
-}
-
-func (r *UnimplementedUserRender) RenderLogout(c *gin.Context, err mir.Error) {
- r.RenderAny(c, nil, err)
-}
-
-func (r *UnimplementedUserRender) RenderLogin(c *gin.Context, data *LoginResp, err mir.Error) {
- r.RenderAny(c, data, err)
-}
-
-func (r *UnimplementedUserRender) mustEmbedUnimplementedUserRender() {}
-
-// UnimplementedUserBinding can be embedded to have forward compatible implementations.
-type UnimplementedUserBinding struct {
- BindAny func(*gin.Context, any) mir.Error
-}
-
-func (b *UnimplementedUserBinding) BindLogin(c *gin.Context) (*LoginReq, mir.Error) {
- obj := new(LoginReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedUserBinding) mustEmbedUnimplementedUserBinding() {}
diff --git a/auto/api/r/v1/user.go b/auto/api/r/v1/user.go
index 1850b157..e7f98082 100644
--- a/auto/api/r/v1/user.go
+++ b/auto/api/r/v1/user.go
@@ -1,14 +1,29 @@
// Code generated by go-mir. DO NOT EDIT.
+// versions:
+// - mir v4.0.0
package v1
import (
"net/http"
- "github.com/alimy/mir/v3"
+ "github.com/alimy/mir/v4"
"github.com/gin-gonic/gin"
)
+type _binding_ interface {
+ Bind(*gin.Context) mir.Error
+}
+
+type _render_ interface {
+ Render(*gin.Context)
+}
+
+type _default_ interface {
+ Bind(*gin.Context, any) mir.Error
+ Render(*gin.Context, any, mir.Error)
+}
+
type LoginReq struct {
AgentInfo AgentInfo `json:"agent_info"`
Name string `json:"name"`
@@ -35,6 +50,8 @@ type UserInfo struct {
}
type User interface {
+ _default_
+
// Chain provide handlers chain for gin
Chain() gin.HandlersChain
@@ -44,21 +61,8 @@ type User interface {
mustEmbedUnimplementedUserServant()
}
-type UserBinding interface {
- BindLogin(*gin.Context) (*LoginReq, mir.Error)
-
- mustEmbedUnimplementedUserBinding()
-}
-
-type UserRender interface {
- RenderLogout(*gin.Context, mir.Error)
- RenderLogin(*gin.Context, *LoginResp, mir.Error)
-
- mustEmbedUnimplementedUserRender()
-}
-
// RegisterUserServant register User servant to gin
-func RegisterUserServant(e *gin.Engine, s User, b UserBinding, r UserRender) {
+func RegisterUserServant(e *gin.Engine, s User) {
router := e.Group("r/v1")
// use chain for router
middlewares := s.Chain()
@@ -72,30 +76,26 @@ func RegisterUserServant(e *gin.Engine, s User, b UserBinding, r UserRender) {
default:
}
- r.RenderLogout(c, s.Logout())
+ s.Render(c, nil, s.Logout())
})
-
router.Handle("POST", "/user/login/", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindLogin(c)
- if err != nil {
- r.RenderLogin(c, nil, err)
+ req := new(LoginReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
return
}
resp, err := s.Login(req)
- r.RenderLogin(c, resp, err)
+ s.Render(c, resp, err)
})
-
}
// UnimplementedUserServant can be embedded to have forward compatible implementations.
-type UnimplementedUserServant struct {
-}
+type UnimplementedUserServant struct{}
func (UnimplementedUserServant) Chain() gin.HandlersChain {
return nil
@@ -110,31 +110,3 @@ func (UnimplementedUserServant) Login(req *LoginReq) (*LoginResp, mir.Error) {
}
func (UnimplementedUserServant) mustEmbedUnimplementedUserServant() {}
-
-// UnimplementedUserRender can be embedded to have forward compatible implementations.
-type UnimplementedUserRender struct {
- RenderAny func(*gin.Context, any, mir.Error)
-}
-
-func (r *UnimplementedUserRender) RenderLogout(c *gin.Context, err mir.Error) {
- r.RenderAny(c, nil, err)
-}
-
-func (r *UnimplementedUserRender) RenderLogin(c *gin.Context, data *LoginResp, err mir.Error) {
- r.RenderAny(c, data, err)
-}
-
-func (r *UnimplementedUserRender) mustEmbedUnimplementedUserRender() {}
-
-// UnimplementedUserBinding can be embedded to have forward compatible implementations.
-type UnimplementedUserBinding struct {
- BindAny func(*gin.Context, any) mir.Error
-}
-
-func (b *UnimplementedUserBinding) BindLogin(c *gin.Context) (*LoginReq, mir.Error) {
- obj := new(LoginReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedUserBinding) mustEmbedUnimplementedUserBinding() {}
diff --git a/auto/api/s/v1/user.go b/auto/api/s/v1/user.go
index ef2c855b..c0b7dae3 100644
--- a/auto/api/s/v1/user.go
+++ b/auto/api/s/v1/user.go
@@ -1,14 +1,29 @@
// Code generated by go-mir. DO NOT EDIT.
+// versions:
+// - mir v4.0.0
package v1
import (
"net/http"
- "github.com/alimy/mir/v3"
+ "github.com/alimy/mir/v4"
"github.com/gin-gonic/gin"
)
+type _binding_ interface {
+ Bind(*gin.Context) mir.Error
+}
+
+type _render_ interface {
+ Render(*gin.Context)
+}
+
+type _default_ interface {
+ Bind(*gin.Context, any) mir.Error
+ Render(*gin.Context, any, mir.Error)
+}
+
type LoginReq struct {
AgentInfo AgentInfo `json:"agent_info"`
Name string `json:"name"`
@@ -35,6 +50,8 @@ type UserInfo struct {
}
type User interface {
+ _default_
+
Logout() mir.Error
Login(*LoginReq) (*LoginResp, mir.Error)
Index() mir.Error
@@ -42,22 +59,8 @@ type User interface {
mustEmbedUnimplementedUserServant()
}
-type UserBinding interface {
- BindLogin(*gin.Context) (*LoginReq, mir.Error)
-
- mustEmbedUnimplementedUserBinding()
-}
-
-type UserRender interface {
- RenderLogout(*gin.Context, mir.Error)
- RenderLogin(*gin.Context, *LoginResp, mir.Error)
- RenderIndex(*gin.Context, mir.Error)
-
- mustEmbedUnimplementedUserRender()
-}
-
// RegisterUserServant register User servant to gin
-func RegisterUserServant(e *gin.Engine, s User, b UserBinding, r UserRender) {
+func RegisterUserServant(e *gin.Engine, s User) {
router := e.Group("s/v1")
// register routes info to router
@@ -68,25 +71,22 @@ func RegisterUserServant(e *gin.Engine, s User, b UserBinding, r UserRender) {
default:
}
- r.RenderLogout(c, s.Logout())
+ s.Render(c, nil, s.Logout())
})
-
router.Handle("POST", "/user/login/", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindLogin(c)
- if err != nil {
- r.RenderLogin(c, nil, err)
+ req := new(LoginReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
return
}
resp, err := s.Login(req)
- r.RenderLogin(c, resp, err)
+ s.Render(c, resp, err)
})
-
router.Handle("GET", "/index/", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
@@ -94,14 +94,12 @@ func RegisterUserServant(e *gin.Engine, s User, b UserBinding, r UserRender) {
default:
}
- r.RenderIndex(c, s.Index())
+ s.Render(c, nil, s.Index())
})
-
}
// UnimplementedUserServant can be embedded to have forward compatible implementations.
-type UnimplementedUserServant struct {
-}
+type UnimplementedUserServant struct{}
func (UnimplementedUserServant) Logout() mir.Error {
return mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented))
@@ -116,35 +114,3 @@ func (UnimplementedUserServant) Index() mir.Error {
}
func (UnimplementedUserServant) mustEmbedUnimplementedUserServant() {}
-
-// UnimplementedUserRender can be embedded to have forward compatible implementations.
-type UnimplementedUserRender struct {
- RenderAny func(*gin.Context, any, mir.Error)
-}
-
-func (r *UnimplementedUserRender) RenderLogout(c *gin.Context, err mir.Error) {
- r.RenderAny(c, nil, err)
-}
-
-func (r *UnimplementedUserRender) RenderLogin(c *gin.Context, data *LoginResp, err mir.Error) {
- r.RenderAny(c, data, err)
-}
-
-func (r *UnimplementedUserRender) RenderIndex(c *gin.Context, err mir.Error) {
- r.RenderAny(c, nil, err)
-}
-
-func (r *UnimplementedUserRender) mustEmbedUnimplementedUserRender() {}
-
-// UnimplementedUserBinding can be embedded to have forward compatible implementations.
-type UnimplementedUserBinding struct {
- BindAny func(*gin.Context, any) mir.Error
-}
-
-func (b *UnimplementedUserBinding) BindLogin(c *gin.Context) (*LoginReq, mir.Error) {
- obj := new(LoginReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedUserBinding) mustEmbedUnimplementedUserBinding() {}
diff --git a/auto/api/v1/admin.go b/auto/api/v1/admin.go
index 6872d123..ad4ac308 100644
--- a/auto/api/v1/admin.go
+++ b/auto/api/v1/admin.go
@@ -1,38 +1,43 @@
// Code generated by go-mir. DO NOT EDIT.
+// versions:
+// - mir v4.0.0
package v1
import (
"net/http"
- "github.com/alimy/mir/v3"
+ "github.com/alimy/mir/v4"
"github.com/gin-gonic/gin"
"github.com/rocboss/paopao-ce/internal/model/web"
)
-type Admin interface {
- // Chain provide handlers chain for gin
- Chain() gin.HandlersChain
+type _binding_ interface {
+ Bind(*gin.Context) mir.Error
+}
- ChangeUserStatus(*web.ChangeUserStatusReq) mir.Error
+type _render_ interface {
+ Render(*gin.Context)
+}
- mustEmbedUnimplementedAdminServant()
+type _default_ interface {
+ Bind(*gin.Context, any) mir.Error
+ Render(*gin.Context, any, mir.Error)
}
-type AdminBinding interface {
- BindChangeUserStatus(*gin.Context) (*web.ChangeUserStatusReq, mir.Error)
+type Admin interface {
+ _default_
- mustEmbedUnimplementedAdminBinding()
-}
+ // Chain provide handlers chain for gin
+ Chain() gin.HandlersChain
-type AdminRender interface {
- RenderChangeUserStatus(*gin.Context, mir.Error)
+ ChangeUserStatus(*web.ChangeUserStatusReq) mir.Error
- mustEmbedUnimplementedAdminRender()
+ mustEmbedUnimplementedAdminServant()
}
// RegisterAdminServant register Admin servant to gin
-func RegisterAdminServant(e *gin.Engine, s Admin, b AdminBinding, r AdminRender) {
+func RegisterAdminServant(e *gin.Engine, s Admin) {
router := e.Group("v1")
// use chain for router
middlewares := s.Chain()
@@ -45,20 +50,17 @@ func RegisterAdminServant(e *gin.Engine, s Admin, b AdminBinding, r AdminRender)
return
default:
}
-
- req, err := b.BindChangeUserStatus(c)
- if err != nil {
- r.RenderChangeUserStatus(c, err)
+ req := new(web.ChangeUserStatusReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
return
}
- r.RenderChangeUserStatus(c, s.ChangeUserStatus(req))
+ s.Render(c, nil, s.ChangeUserStatus(req))
})
-
}
// UnimplementedAdminServant can be embedded to have forward compatible implementations.
-type UnimplementedAdminServant struct {
-}
+type UnimplementedAdminServant struct{}
func (UnimplementedAdminServant) Chain() gin.HandlersChain {
return nil
@@ -69,27 +71,3 @@ func (UnimplementedAdminServant) ChangeUserStatus(req *web.ChangeUserStatusReq)
}
func (UnimplementedAdminServant) mustEmbedUnimplementedAdminServant() {}
-
-// UnimplementedAdminRender can be embedded to have forward compatible implementations.
-type UnimplementedAdminRender struct {
- RenderAny func(*gin.Context, any, mir.Error)
-}
-
-func (r *UnimplementedAdminRender) RenderChangeUserStatus(c *gin.Context, err mir.Error) {
- r.RenderAny(c, nil, err)
-}
-
-func (r *UnimplementedAdminRender) mustEmbedUnimplementedAdminRender() {}
-
-// UnimplementedAdminBinding can be embedded to have forward compatible implementations.
-type UnimplementedAdminBinding struct {
- BindAny func(*gin.Context, any) mir.Error
-}
-
-func (b *UnimplementedAdminBinding) BindChangeUserStatus(c *gin.Context) (*web.ChangeUserStatusReq, mir.Error) {
- obj := new(web.ChangeUserStatusReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedAdminBinding) mustEmbedUnimplementedAdminBinding() {}
diff --git a/auto/api/v1/alipay_priv.go b/auto/api/v1/alipay_priv.go
index 4cb3fe0a..02500522 100644
--- a/auto/api/v1/alipay_priv.go
+++ b/auto/api/v1/alipay_priv.go
@@ -1,16 +1,20 @@
// Code generated by go-mir. DO NOT EDIT.
+// versions:
+// - mir v4.0.0
package v1
import (
"net/http"
- "github.com/alimy/mir/v3"
+ "github.com/alimy/mir/v4"
"github.com/gin-gonic/gin"
"github.com/rocboss/paopao-ce/internal/model/web"
)
type AlipayPriv interface {
+ _default_
+
// Chain provide handlers chain for gin
Chain() gin.HandlersChain
@@ -21,24 +25,8 @@ type AlipayPriv interface {
mustEmbedUnimplementedAlipayPrivServant()
}
-type AlipayPrivBinding interface {
- BindUserWalletBills(*gin.Context) (*web.UserWalletBillsReq, mir.Error)
- BindUserRechargeResult(*gin.Context) (*web.UserRechargeResultReq, mir.Error)
- BindUserRechargeLink(*gin.Context) (*web.UserRechargeLinkReq, mir.Error)
-
- mustEmbedUnimplementedAlipayPrivBinding()
-}
-
-type AlipayPrivRender interface {
- RenderUserWalletBills(*gin.Context, *web.UserWalletBillsResp, mir.Error)
- RenderUserRechargeResult(*gin.Context, *web.UserRechargeResultResp, mir.Error)
- RenderUserRechargeLink(*gin.Context, *web.UserRechargeLinkResp, mir.Error)
-
- mustEmbedUnimplementedAlipayPrivRender()
-}
-
// RegisterAlipayPrivServant register AlipayPriv servant to gin
-func RegisterAlipayPrivServant(e *gin.Engine, s AlipayPriv, b AlipayPrivBinding, r AlipayPrivRender) {
+func RegisterAlipayPrivServant(e *gin.Engine, s AlipayPriv) {
router := e.Group("v1")
// use chain for router
middlewares := s.Chain()
@@ -51,53 +39,49 @@ func RegisterAlipayPrivServant(e *gin.Engine, s AlipayPriv, b AlipayPrivBinding,
return
default:
}
-
- req, err := b.BindUserWalletBills(c)
- if err != nil {
- r.RenderUserWalletBills(c, nil, err)
+ req := new(web.UserWalletBillsReq)
+ var bv _binding_ = req
+ if err := bv.Bind(c); err != nil {
+ s.Render(c, nil, err)
return
}
resp, err := s.UserWalletBills(req)
- r.RenderUserWalletBills(c, resp, err)
+ s.Render(c, resp, err)
})
-
router.Handle("GET", "/user/recharge", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindUserRechargeResult(c)
- if err != nil {
- r.RenderUserRechargeResult(c, nil, err)
+ req := new(web.UserRechargeResultReq)
+ var bv _binding_ = req
+ if err := bv.Bind(c); err != nil {
+ s.Render(c, nil, err)
return
}
resp, err := s.UserRechargeResult(req)
- r.RenderUserRechargeResult(c, resp, err)
+ s.Render(c, resp, err)
})
-
router.Handle("POST", "/user/recharge", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindUserRechargeLink(c)
- if err != nil {
- r.RenderUserRechargeLink(c, nil, err)
+ req := new(web.UserRechargeLinkReq)
+ var bv _binding_ = req
+ if err := bv.Bind(c); err != nil {
+ s.Render(c, nil, err)
return
}
resp, err := s.UserRechargeLink(req)
- r.RenderUserRechargeLink(c, resp, err)
+ s.Render(c, resp, err)
})
-
}
// UnimplementedAlipayPrivServant can be embedded to have forward compatible implementations.
-type UnimplementedAlipayPrivServant struct {
-}
+type UnimplementedAlipayPrivServant struct{}
func (UnimplementedAlipayPrivServant) Chain() gin.HandlersChain {
return nil
@@ -116,47 +100,3 @@ func (UnimplementedAlipayPrivServant) UserRechargeLink(req *web.UserRechargeLink
}
func (UnimplementedAlipayPrivServant) mustEmbedUnimplementedAlipayPrivServant() {}
-
-// UnimplementedAlipayPrivRender can be embedded to have forward compatible implementations.
-type UnimplementedAlipayPrivRender struct {
- RenderAny func(*gin.Context, any, mir.Error)
-}
-
-func (r *UnimplementedAlipayPrivRender) RenderUserWalletBills(c *gin.Context, data *web.UserWalletBillsResp, err mir.Error) {
- r.RenderAny(c, data, err)
-}
-
-func (r *UnimplementedAlipayPrivRender) RenderUserRechargeResult(c *gin.Context, data *web.UserRechargeResultResp, err mir.Error) {
- r.RenderAny(c, data, err)
-}
-
-func (r *UnimplementedAlipayPrivRender) RenderUserRechargeLink(c *gin.Context, data *web.UserRechargeLinkResp, err mir.Error) {
- r.RenderAny(c, data, err)
-}
-
-func (r *UnimplementedAlipayPrivRender) mustEmbedUnimplementedAlipayPrivRender() {}
-
-// UnimplementedAlipayPrivBinding can be embedded to have forward compatible implementations.
-type UnimplementedAlipayPrivBinding struct {
- BindAny func(*gin.Context, any) mir.Error
-}
-
-func (b *UnimplementedAlipayPrivBinding) BindUserWalletBills(c *gin.Context) (*web.UserWalletBillsReq, mir.Error) {
- obj := new(web.UserWalletBillsReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedAlipayPrivBinding) BindUserRechargeResult(c *gin.Context) (*web.UserRechargeResultReq, mir.Error) {
- obj := new(web.UserRechargeResultReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedAlipayPrivBinding) BindUserRechargeLink(c *gin.Context) (*web.UserRechargeLinkReq, mir.Error) {
- obj := new(web.UserRechargeLinkReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedAlipayPrivBinding) mustEmbedUnimplementedAlipayPrivBinding() {}
diff --git a/auto/api/v1/alipay_pub.go b/auto/api/v1/alipay_pub.go
index 3119119e..b31172ad 100644
--- a/auto/api/v1/alipay_pub.go
+++ b/auto/api/v1/alipay_pub.go
@@ -1,35 +1,27 @@
// Code generated by go-mir. DO NOT EDIT.
+// versions:
+// - mir v4.0.0
package v1
import (
"net/http"
- "github.com/alimy/mir/v3"
+ "github.com/alimy/mir/v4"
"github.com/gin-gonic/gin"
"github.com/rocboss/paopao-ce/internal/model/web"
)
type AlipayPub interface {
+ _default_
+
AlipayNotify(*web.AlipayNotifyReq) mir.Error
mustEmbedUnimplementedAlipayPubServant()
}
-type AlipayPubBinding interface {
- BindAlipayNotify(*gin.Context) (*web.AlipayNotifyReq, mir.Error)
-
- mustEmbedUnimplementedAlipayPubBinding()
-}
-
-type AlipayPubRender interface {
- RenderAlipayNotify(*gin.Context, mir.Error)
-
- mustEmbedUnimplementedAlipayPubRender()
-}
-
// RegisterAlipayPubServant register AlipayPub servant to gin
-func RegisterAlipayPubServant(e *gin.Engine, s AlipayPub, b AlipayPubBinding, r AlipayPubRender) {
+func RegisterAlipayPubServant(e *gin.Engine, s AlipayPub) {
router := e.Group("v1")
// register routes info to router
@@ -39,47 +31,21 @@ func RegisterAlipayPubServant(e *gin.Engine, s AlipayPub, b AlipayPubBinding, r
return
default:
}
-
- req, err := b.BindAlipayNotify(c)
- if err != nil {
- r.RenderAlipayNotify(c, err)
+ req := new(web.AlipayNotifyReq)
+ var bv _binding_ = req
+ if err := bv.Bind(c); err != nil {
+ s.Render(c, nil, err)
return
}
- r.RenderAlipayNotify(c, s.AlipayNotify(req))
+ s.Render(c, nil, s.AlipayNotify(req))
})
-
}
// UnimplementedAlipayPubServant can be embedded to have forward compatible implementations.
-type UnimplementedAlipayPubServant struct {
-}
+type UnimplementedAlipayPubServant struct{}
func (UnimplementedAlipayPubServant) AlipayNotify(req *web.AlipayNotifyReq) mir.Error {
return mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented))
}
func (UnimplementedAlipayPubServant) mustEmbedUnimplementedAlipayPubServant() {}
-
-// UnimplementedAlipayPubRender can be embedded to have forward compatible implementations.
-type UnimplementedAlipayPubRender struct {
- RenderAny func(*gin.Context, any, mir.Error)
-}
-
-func (r *UnimplementedAlipayPubRender) RenderAlipayNotify(c *gin.Context, err mir.Error) {
- r.RenderAny(c, nil, err)
-}
-
-func (r *UnimplementedAlipayPubRender) mustEmbedUnimplementedAlipayPubRender() {}
-
-// UnimplementedAlipayPubBinding can be embedded to have forward compatible implementations.
-type UnimplementedAlipayPubBinding struct {
- BindAny func(*gin.Context, any) mir.Error
-}
-
-func (b *UnimplementedAlipayPubBinding) BindAlipayNotify(c *gin.Context) (*web.AlipayNotifyReq, mir.Error) {
- obj := new(web.AlipayNotifyReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedAlipayPubBinding) mustEmbedUnimplementedAlipayPubBinding() {}
diff --git a/auto/api/v1/core.go b/auto/api/v1/core.go
index 8e633c53..159e938f 100644
--- a/auto/api/v1/core.go
+++ b/auto/api/v1/core.go
@@ -1,16 +1,20 @@
// Code generated by go-mir. DO NOT EDIT.
+// versions:
+// - mir v4.0.0
package v1
import (
"net/http"
- "github.com/alimy/mir/v3"
+ "github.com/alimy/mir/v4"
"github.com/gin-gonic/gin"
"github.com/rocboss/paopao-ce/internal/model/web"
)
type Core interface {
+ _default_
+
// Chain provide handlers chain for gin
Chain() gin.HandlersChain
@@ -34,50 +38,8 @@ type Core interface {
mustEmbedUnimplementedCoreServant()
}
-type CoreBinding interface {
- BindTweetCollectionStatus(*gin.Context) (*web.TweetCollectionStatusReq, mir.Error)
- BindTweetStarStatus(*gin.Context) (*web.TweetStarStatusReq, mir.Error)
- BindSuggestTags(*gin.Context) (*web.SuggestTagsReq, mir.Error)
- BindSuggestUsers(*gin.Context) (*web.SuggestUsersReq, mir.Error)
- BindChangeAvatar(*gin.Context) (*web.ChangeAvatarReq, mir.Error)
- BindChangeNickname(*gin.Context) (*web.ChangeNicknameReq, mir.Error)
- BindChangePassword(*gin.Context) (*web.ChangePasswordReq, mir.Error)
- BindUserPhoneBind(*gin.Context) (*web.UserPhoneBindReq, mir.Error)
- BindGetStars(*gin.Context) (*web.GetStarsReq, mir.Error)
- BindGetCollections(*gin.Context) (*web.GetCollectionsReq, mir.Error)
- BindSendUserWhisper(*gin.Context) (*web.SendWhisperReq, mir.Error)
- BindReadMessage(*gin.Context) (*web.ReadMessageReq, mir.Error)
- BindGetMessages(*gin.Context) (*web.GetMessagesReq, mir.Error)
- BindGetUnreadMsgCount(*gin.Context) (*web.GetUnreadMsgCountReq, mir.Error)
- BindGetUserInfo(*gin.Context) (*web.UserInfoReq, mir.Error)
- BindSyncSearchIndex(*gin.Context) (*web.SyncSearchIndexReq, mir.Error)
-
- mustEmbedUnimplementedCoreBinding()
-}
-
-type CoreRender interface {
- RenderTweetCollectionStatus(*gin.Context, *web.TweetCollectionStatusResp, mir.Error)
- RenderTweetStarStatus(*gin.Context, *web.TweetStarStatusResp, mir.Error)
- RenderSuggestTags(*gin.Context, *web.SuggestTagsResp, mir.Error)
- RenderSuggestUsers(*gin.Context, *web.SuggestUsersResp, mir.Error)
- RenderChangeAvatar(*gin.Context, mir.Error)
- RenderChangeNickname(*gin.Context, mir.Error)
- RenderChangePassword(*gin.Context, mir.Error)
- RenderUserPhoneBind(*gin.Context, mir.Error)
- RenderGetStars(*gin.Context, *web.GetStarsResp, mir.Error)
- RenderGetCollections(*gin.Context, *web.GetCollectionsResp, mir.Error)
- RenderSendUserWhisper(*gin.Context, mir.Error)
- RenderReadMessage(*gin.Context, mir.Error)
- RenderGetMessages(*gin.Context, *web.GetMessagesResp, mir.Error)
- RenderGetUnreadMsgCount(*gin.Context, *web.GetUnreadMsgCountResp, mir.Error)
- RenderGetUserInfo(*gin.Context, *web.UserInfoResp, mir.Error)
- RenderSyncSearchIndex(*gin.Context, mir.Error)
-
- mustEmbedUnimplementedCoreRender()
-}
-
// RegisterCoreServant register Core servant to gin
-func RegisterCoreServant(e *gin.Engine, s Core, b CoreBinding, r CoreRender) {
+func RegisterCoreServant(e *gin.Engine, s Core) {
router := e.Group("v1")
// use chain for router
middlewares := s.Chain()
@@ -90,254 +52,229 @@ func RegisterCoreServant(e *gin.Engine, s Core, b CoreBinding, r CoreRender) {
return
default:
}
-
- req, err := b.BindTweetCollectionStatus(c)
- if err != nil {
- r.RenderTweetCollectionStatus(c, nil, err)
+ req := new(web.TweetCollectionStatusReq)
+ var bv _binding_ = req
+ if err := bv.Bind(c); err != nil {
+ s.Render(c, nil, err)
return
}
resp, err := s.TweetCollectionStatus(req)
- r.RenderTweetCollectionStatus(c, resp, err)
+ s.Render(c, resp, err)
})
-
router.Handle("GET", "/post/star", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindTweetStarStatus(c)
- if err != nil {
- r.RenderTweetStarStatus(c, nil, err)
+ req := new(web.TweetStarStatusReq)
+ var bv _binding_ = req
+ if err := bv.Bind(c); err != nil {
+ s.Render(c, nil, err)
return
}
resp, err := s.TweetStarStatus(req)
- r.RenderTweetStarStatus(c, resp, err)
+ s.Render(c, resp, err)
})
-
router.Handle("GET", "/suggest/tags", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindSuggestTags(c)
- if err != nil {
- r.RenderSuggestTags(c, nil, err)
+ req := new(web.SuggestTagsReq)
+ var bv _binding_ = req
+ if err := bv.Bind(c); err != nil {
+ s.Render(c, nil, err)
return
}
resp, err := s.SuggestTags(req)
- r.RenderSuggestTags(c, resp, err)
+ s.Render(c, resp, err)
})
-
router.Handle("GET", "/suggest/users", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindSuggestUsers(c)
- if err != nil {
- r.RenderSuggestUsers(c, nil, err)
+ req := new(web.SuggestUsersReq)
+ var bv _binding_ = req
+ if err := bv.Bind(c); err != nil {
+ s.Render(c, nil, err)
return
}
resp, err := s.SuggestUsers(req)
- r.RenderSuggestUsers(c, resp, err)
+ s.Render(c, resp, err)
})
-
router.Handle("POST", "/user/avatar", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindChangeAvatar(c)
- if err != nil {
- r.RenderChangeAvatar(c, err)
+ req := new(web.ChangeAvatarReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
return
}
- r.RenderChangeAvatar(c, s.ChangeAvatar(req))
+ s.Render(c, nil, s.ChangeAvatar(req))
})
-
router.Handle("POST", "/user/nickname", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindChangeNickname(c)
- if err != nil {
- r.RenderChangeNickname(c, err)
+ req := new(web.ChangeNicknameReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
return
}
- r.RenderChangeNickname(c, s.ChangeNickname(req))
+ s.Render(c, nil, s.ChangeNickname(req))
})
-
router.Handle("POST", "/user/password", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindChangePassword(c)
- if err != nil {
- r.RenderChangePassword(c, err)
+ req := new(web.ChangePasswordReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
return
}
- r.RenderChangePassword(c, s.ChangePassword(req))
+ s.Render(c, nil, s.ChangePassword(req))
})
-
router.Handle("POST", "/user/phone", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindUserPhoneBind(c)
- if err != nil {
- r.RenderUserPhoneBind(c, err)
+ req := new(web.UserPhoneBindReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
return
}
- r.RenderUserPhoneBind(c, s.UserPhoneBind(req))
+ s.Render(c, nil, s.UserPhoneBind(req))
})
-
router.Handle("GET", "/user/stars", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindGetStars(c)
- if err != nil {
- r.RenderGetStars(c, nil, err)
+ req := new(web.GetStarsReq)
+ var bv _binding_ = req
+ if err := bv.Bind(c); err != nil {
+ s.Render(c, nil, err)
return
}
resp, err := s.GetStars(req)
- r.RenderGetStars(c, resp, err)
+ s.Render(c, resp, err)
})
-
router.Handle("GET", "/user/collections", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindGetCollections(c)
- if err != nil {
- r.RenderGetCollections(c, nil, err)
+ req := new(web.GetCollectionsReq)
+ var bv _binding_ = req
+ if err := bv.Bind(c); err != nil {
+ s.Render(c, nil, err)
return
}
resp, err := s.GetCollections(req)
- r.RenderGetCollections(c, resp, err)
+ s.Render(c, resp, err)
})
-
router.Handle("POST", "/user/whisper", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindSendUserWhisper(c)
- if err != nil {
- r.RenderSendUserWhisper(c, err)
+ req := new(web.SendWhisperReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
return
}
- r.RenderSendUserWhisper(c, s.SendUserWhisper(req))
+ s.Render(c, nil, s.SendUserWhisper(req))
})
-
router.Handle("POST", "/user/message/read", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindReadMessage(c)
- if err != nil {
- r.RenderReadMessage(c, err)
+ req := new(web.ReadMessageReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
return
}
- r.RenderReadMessage(c, s.ReadMessage(req))
+ s.Render(c, nil, s.ReadMessage(req))
})
-
router.Handle("GET", "/user/messages", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindGetMessages(c)
- if err != nil {
- r.RenderGetMessages(c, nil, err)
+ req := new(web.GetMessagesReq)
+ var bv _binding_ = req
+ if err := bv.Bind(c); err != nil {
+ s.Render(c, nil, err)
return
}
resp, err := s.GetMessages(req)
- r.RenderGetMessages(c, resp, err)
+ s.Render(c, resp, err)
})
-
router.Handle("GET", "/user/msgcount/unread", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindGetUnreadMsgCount(c)
- if err != nil {
- r.RenderGetUnreadMsgCount(c, nil, err)
+ req := new(web.GetUnreadMsgCountReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
return
}
resp, err := s.GetUnreadMsgCount(req)
- r.RenderGetUnreadMsgCount(c, resp, err)
+ s.Render(c, resp, err)
})
-
router.Handle("GET", "/user/info", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindGetUserInfo(c)
- if err != nil {
- r.RenderGetUserInfo(c, nil, err)
+ req := new(web.UserInfoReq)
+ var bv _binding_ = req
+ if err := bv.Bind(c); err != nil {
+ s.Render(c, nil, err)
return
}
resp, err := s.GetUserInfo(req)
- r.RenderGetUserInfo(c, resp, err)
+ s.Render(c, resp, err)
})
-
router.Handle("GET", "/sync/index", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindSyncSearchIndex(c)
- if err != nil {
- r.RenderSyncSearchIndex(c, err)
+ req := new(web.SyncSearchIndexReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
return
}
- r.RenderSyncSearchIndex(c, s.SyncSearchIndex(req))
+ s.Render(c, nil, s.SyncSearchIndex(req))
})
-
}
// UnimplementedCoreServant can be embedded to have forward compatible implementations.
-type UnimplementedCoreServant struct {
-}
+type UnimplementedCoreServant struct{}
func (UnimplementedCoreServant) Chain() gin.HandlersChain {
return nil
@@ -408,177 +345,3 @@ func (UnimplementedCoreServant) SyncSearchIndex(req *web.SyncSearchIndexReq) mir
}
func (UnimplementedCoreServant) mustEmbedUnimplementedCoreServant() {}
-
-// UnimplementedCoreRender can be embedded to have forward compatible implementations.
-type UnimplementedCoreRender struct {
- RenderAny func(*gin.Context, any, mir.Error)
-}
-
-func (r *UnimplementedCoreRender) RenderTweetCollectionStatus(c *gin.Context, data *web.TweetCollectionStatusResp, err mir.Error) {
- r.RenderAny(c, data, err)
-}
-
-func (r *UnimplementedCoreRender) RenderTweetStarStatus(c *gin.Context, data *web.TweetStarStatusResp, err mir.Error) {
- r.RenderAny(c, data, err)
-}
-
-func (r *UnimplementedCoreRender) RenderSuggestTags(c *gin.Context, data *web.SuggestTagsResp, err mir.Error) {
- r.RenderAny(c, data, err)
-}
-
-func (r *UnimplementedCoreRender) RenderSuggestUsers(c *gin.Context, data *web.SuggestUsersResp, err mir.Error) {
- r.RenderAny(c, data, err)
-}
-
-func (r *UnimplementedCoreRender) RenderChangeAvatar(c *gin.Context, err mir.Error) {
- r.RenderAny(c, nil, err)
-}
-
-func (r *UnimplementedCoreRender) RenderChangeNickname(c *gin.Context, err mir.Error) {
- r.RenderAny(c, nil, err)
-}
-
-func (r *UnimplementedCoreRender) RenderChangePassword(c *gin.Context, err mir.Error) {
- r.RenderAny(c, nil, err)
-}
-
-func (r *UnimplementedCoreRender) RenderUserPhoneBind(c *gin.Context, err mir.Error) {
- r.RenderAny(c, nil, err)
-}
-
-func (r *UnimplementedCoreRender) RenderGetStars(c *gin.Context, data *web.GetStarsResp, err mir.Error) {
- r.RenderAny(c, data, err)
-}
-
-func (r *UnimplementedCoreRender) RenderGetCollections(c *gin.Context, data *web.GetCollectionsResp, err mir.Error) {
- r.RenderAny(c, data, err)
-}
-
-func (r *UnimplementedCoreRender) RenderSendUserWhisper(c *gin.Context, err mir.Error) {
- r.RenderAny(c, nil, err)
-}
-
-func (r *UnimplementedCoreRender) RenderReadMessage(c *gin.Context, err mir.Error) {
- r.RenderAny(c, nil, err)
-}
-
-func (r *UnimplementedCoreRender) RenderGetMessages(c *gin.Context, data *web.GetMessagesResp, err mir.Error) {
- r.RenderAny(c, data, err)
-}
-
-func (r *UnimplementedCoreRender) RenderGetUnreadMsgCount(c *gin.Context, data *web.GetUnreadMsgCountResp, err mir.Error) {
- r.RenderAny(c, data, err)
-}
-
-func (r *UnimplementedCoreRender) RenderGetUserInfo(c *gin.Context, data *web.UserInfoResp, err mir.Error) {
- r.RenderAny(c, data, err)
-}
-
-func (r *UnimplementedCoreRender) RenderSyncSearchIndex(c *gin.Context, err mir.Error) {
- r.RenderAny(c, nil, err)
-}
-
-func (r *UnimplementedCoreRender) mustEmbedUnimplementedCoreRender() {}
-
-// UnimplementedCoreBinding can be embedded to have forward compatible implementations.
-type UnimplementedCoreBinding struct {
- BindAny func(*gin.Context, any) mir.Error
-}
-
-func (b *UnimplementedCoreBinding) BindTweetCollectionStatus(c *gin.Context) (*web.TweetCollectionStatusReq, mir.Error) {
- obj := new(web.TweetCollectionStatusReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedCoreBinding) BindTweetStarStatus(c *gin.Context) (*web.TweetStarStatusReq, mir.Error) {
- obj := new(web.TweetStarStatusReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedCoreBinding) BindSuggestTags(c *gin.Context) (*web.SuggestTagsReq, mir.Error) {
- obj := new(web.SuggestTagsReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedCoreBinding) BindSuggestUsers(c *gin.Context) (*web.SuggestUsersReq, mir.Error) {
- obj := new(web.SuggestUsersReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedCoreBinding) BindChangeAvatar(c *gin.Context) (*web.ChangeAvatarReq, mir.Error) {
- obj := new(web.ChangeAvatarReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedCoreBinding) BindChangeNickname(c *gin.Context) (*web.ChangeNicknameReq, mir.Error) {
- obj := new(web.ChangeNicknameReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedCoreBinding) BindChangePassword(c *gin.Context) (*web.ChangePasswordReq, mir.Error) {
- obj := new(web.ChangePasswordReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedCoreBinding) BindUserPhoneBind(c *gin.Context) (*web.UserPhoneBindReq, mir.Error) {
- obj := new(web.UserPhoneBindReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedCoreBinding) BindGetStars(c *gin.Context) (*web.GetStarsReq, mir.Error) {
- obj := new(web.GetStarsReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedCoreBinding) BindGetCollections(c *gin.Context) (*web.GetCollectionsReq, mir.Error) {
- obj := new(web.GetCollectionsReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedCoreBinding) BindSendUserWhisper(c *gin.Context) (*web.SendWhisperReq, mir.Error) {
- obj := new(web.SendWhisperReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedCoreBinding) BindReadMessage(c *gin.Context) (*web.ReadMessageReq, mir.Error) {
- obj := new(web.ReadMessageReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedCoreBinding) BindGetMessages(c *gin.Context) (*web.GetMessagesReq, mir.Error) {
- obj := new(web.GetMessagesReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedCoreBinding) BindGetUnreadMsgCount(c *gin.Context) (*web.GetUnreadMsgCountReq, mir.Error) {
- obj := new(web.GetUnreadMsgCountReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedCoreBinding) BindGetUserInfo(c *gin.Context) (*web.UserInfoReq, mir.Error) {
- obj := new(web.UserInfoReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedCoreBinding) BindSyncSearchIndex(c *gin.Context) (*web.SyncSearchIndexReq, mir.Error) {
- obj := new(web.SyncSearchIndexReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedCoreBinding) mustEmbedUnimplementedCoreBinding() {}
diff --git a/auto/api/v1/followship.go b/auto/api/v1/followship.go
index 7e83efc9..fa6c0f8b 100644
--- a/auto/api/v1/followship.go
+++ b/auto/api/v1/followship.go
@@ -1,16 +1,20 @@
// Code generated by go-mir. DO NOT EDIT.
+// versions:
+// - mir v4.0.0
package v1
import (
"net/http"
- "github.com/alimy/mir/v3"
+ "github.com/alimy/mir/v4"
"github.com/gin-gonic/gin"
"github.com/rocboss/paopao-ce/internal/model/web"
)
type Followship interface {
+ _default_
+
// Chain provide handlers chain for gin
Chain() gin.HandlersChain
@@ -22,26 +26,8 @@ type Followship interface {
mustEmbedUnimplementedFollowshipServant()
}
-type FollowshipBinding interface {
- BindListFollowers(*gin.Context) (*web.ListFollowersReq, mir.Error)
- BindListFollowings(*gin.Context) (*web.ListFollowingsReq, mir.Error)
- BindDeleteFollowing(*gin.Context) (*web.DeleteFollowingReq, mir.Error)
- BindAddFollowing(*gin.Context) (*web.AddFollowingReq, mir.Error)
-
- mustEmbedUnimplementedFollowshipBinding()
-}
-
-type FollowshipRender interface {
- RenderListFollowers(*gin.Context, *web.ListFollowersResp, mir.Error)
- RenderListFollowings(*gin.Context, *web.ListFollowingsResp, mir.Error)
- RenderDeleteFollowing(*gin.Context, mir.Error)
- RenderAddFollowing(*gin.Context, mir.Error)
-
- mustEmbedUnimplementedFollowshipRender()
-}
-
// RegisterFollowshipServant register Followship servant to gin
-func RegisterFollowshipServant(e *gin.Engine, s Followship, b FollowshipBinding, r FollowshipRender) {
+func RegisterFollowshipServant(e *gin.Engine, s Followship) {
router := e.Group("v1")
// use chain for router
middlewares := s.Chain()
@@ -54,67 +40,58 @@ func RegisterFollowshipServant(e *gin.Engine, s Followship, b FollowshipBinding,
return
default:
}
-
- req, err := b.BindListFollowers(c)
- if err != nil {
- r.RenderListFollowers(c, nil, err)
+ req := new(web.ListFollowersReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
return
}
resp, err := s.ListFollowers(req)
- r.RenderListFollowers(c, resp, err)
+ s.Render(c, resp, err)
})
-
router.Handle("GET", "/following/list", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindListFollowings(c)
- if err != nil {
- r.RenderListFollowings(c, nil, err)
+ req := new(web.ListFollowingsReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
return
}
resp, err := s.ListFollowings(req)
- r.RenderListFollowings(c, resp, err)
+ s.Render(c, resp, err)
})
-
router.Handle("POST", "/following/delete", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindDeleteFollowing(c)
- if err != nil {
- r.RenderDeleteFollowing(c, err)
+ req := new(web.DeleteFollowingReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
return
}
- r.RenderDeleteFollowing(c, s.DeleteFollowing(req))
+ s.Render(c, nil, s.DeleteFollowing(req))
})
-
router.Handle("POST", "/following/add", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindAddFollowing(c)
- if err != nil {
- r.RenderAddFollowing(c, err)
+ req := new(web.AddFollowingReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
return
}
- r.RenderAddFollowing(c, s.AddFollowing(req))
+ s.Render(c, nil, s.AddFollowing(req))
})
-
}
// UnimplementedFollowshipServant can be embedded to have forward compatible implementations.
-type UnimplementedFollowshipServant struct {
-}
+type UnimplementedFollowshipServant struct{}
func (UnimplementedFollowshipServant) Chain() gin.HandlersChain {
return nil
@@ -137,57 +114,3 @@ func (UnimplementedFollowshipServant) AddFollowing(req *web.AddFollowingReq) mir
}
func (UnimplementedFollowshipServant) mustEmbedUnimplementedFollowshipServant() {}
-
-// UnimplementedFollowshipRender can be embedded to have forward compatible implementations.
-type UnimplementedFollowshipRender struct {
- RenderAny func(*gin.Context, any, mir.Error)
-}
-
-func (r *UnimplementedFollowshipRender) RenderListFollowers(c *gin.Context, data *web.ListFollowersResp, err mir.Error) {
- r.RenderAny(c, data, err)
-}
-
-func (r *UnimplementedFollowshipRender) RenderListFollowings(c *gin.Context, data *web.ListFollowingsResp, err mir.Error) {
- r.RenderAny(c, data, err)
-}
-
-func (r *UnimplementedFollowshipRender) RenderDeleteFollowing(c *gin.Context, err mir.Error) {
- r.RenderAny(c, nil, err)
-}
-
-func (r *UnimplementedFollowshipRender) RenderAddFollowing(c *gin.Context, err mir.Error) {
- r.RenderAny(c, nil, err)
-}
-
-func (r *UnimplementedFollowshipRender) mustEmbedUnimplementedFollowshipRender() {}
-
-// UnimplementedFollowshipBinding can be embedded to have forward compatible implementations.
-type UnimplementedFollowshipBinding struct {
- BindAny func(*gin.Context, any) mir.Error
-}
-
-func (b *UnimplementedFollowshipBinding) BindListFollowers(c *gin.Context) (*web.ListFollowersReq, mir.Error) {
- obj := new(web.ListFollowersReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedFollowshipBinding) BindListFollowings(c *gin.Context) (*web.ListFollowingsReq, mir.Error) {
- obj := new(web.ListFollowingsReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedFollowshipBinding) BindDeleteFollowing(c *gin.Context) (*web.DeleteFollowingReq, mir.Error) {
- obj := new(web.DeleteFollowingReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedFollowshipBinding) BindAddFollowing(c *gin.Context) (*web.AddFollowingReq, mir.Error) {
- obj := new(web.AddFollowingReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedFollowshipBinding) mustEmbedUnimplementedFollowshipBinding() {}
diff --git a/auto/api/v1/friendship.go b/auto/api/v1/friendship.go
index fbec2417..e6e912fe 100644
--- a/auto/api/v1/friendship.go
+++ b/auto/api/v1/friendship.go
@@ -1,16 +1,20 @@
// Code generated by go-mir. DO NOT EDIT.
+// versions:
+// - mir v4.0.0
package v1
import (
"net/http"
- "github.com/alimy/mir/v3"
+ "github.com/alimy/mir/v4"
"github.com/gin-gonic/gin"
"github.com/rocboss/paopao-ce/internal/model/web"
)
type Friendship interface {
+ _default_
+
// Chain provide handlers chain for gin
Chain() gin.HandlersChain
@@ -23,28 +27,8 @@ type Friendship interface {
mustEmbedUnimplementedFriendshipServant()
}
-type FriendshipBinding interface {
- BindGetContacts(*gin.Context) (*web.GetContactsReq, mir.Error)
- BindDeleteFriend(*gin.Context) (*web.DeleteFriendReq, mir.Error)
- BindRejectFriend(*gin.Context) (*web.RejectFriendReq, mir.Error)
- BindAddFriend(*gin.Context) (*web.AddFriendReq, mir.Error)
- BindRequestingFriend(*gin.Context) (*web.RequestingFriendReq, mir.Error)
-
- mustEmbedUnimplementedFriendshipBinding()
-}
-
-type FriendshipRender interface {
- RenderGetContacts(*gin.Context, *web.GetContactsResp, mir.Error)
- RenderDeleteFriend(*gin.Context, mir.Error)
- RenderRejectFriend(*gin.Context, mir.Error)
- RenderAddFriend(*gin.Context, mir.Error)
- RenderRequestingFriend(*gin.Context, mir.Error)
-
- mustEmbedUnimplementedFriendshipRender()
-}
-
// RegisterFriendshipServant register Friendship servant to gin
-func RegisterFriendshipServant(e *gin.Engine, s Friendship, b FriendshipBinding, r FriendshipRender) {
+func RegisterFriendshipServant(e *gin.Engine, s Friendship) {
router := e.Group("v1")
// use chain for router
middlewares := s.Chain()
@@ -57,81 +41,70 @@ func RegisterFriendshipServant(e *gin.Engine, s Friendship, b FriendshipBinding,
return
default:
}
-
- req, err := b.BindGetContacts(c)
- if err != nil {
- r.RenderGetContacts(c, nil, err)
+ req := new(web.GetContactsReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
return
}
resp, err := s.GetContacts(req)
- r.RenderGetContacts(c, resp, err)
+ s.Render(c, resp, err)
})
-
router.Handle("POST", "/friend/delete", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindDeleteFriend(c)
- if err != nil {
- r.RenderDeleteFriend(c, err)
+ req := new(web.DeleteFriendReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
return
}
- r.RenderDeleteFriend(c, s.DeleteFriend(req))
+ s.Render(c, nil, s.DeleteFriend(req))
})
-
router.Handle("POST", "/friend/reject", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindRejectFriend(c)
- if err != nil {
- r.RenderRejectFriend(c, err)
+ req := new(web.RejectFriendReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
return
}
- r.RenderRejectFriend(c, s.RejectFriend(req))
+ s.Render(c, nil, s.RejectFriend(req))
})
-
router.Handle("POST", "/friend/add", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindAddFriend(c)
- if err != nil {
- r.RenderAddFriend(c, err)
+ req := new(web.AddFriendReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
return
}
- r.RenderAddFriend(c, s.AddFriend(req))
+ s.Render(c, nil, s.AddFriend(req))
})
-
router.Handle("POST", "/friend/requesting", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindRequestingFriend(c)
- if err != nil {
- r.RenderRequestingFriend(c, err)
+ req := new(web.RequestingFriendReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
return
}
- r.RenderRequestingFriend(c, s.RequestingFriend(req))
+ s.Render(c, nil, s.RequestingFriend(req))
})
-
}
// UnimplementedFriendshipServant can be embedded to have forward compatible implementations.
-type UnimplementedFriendshipServant struct {
-}
+type UnimplementedFriendshipServant struct{}
func (UnimplementedFriendshipServant) Chain() gin.HandlersChain {
return nil
@@ -158,67 +131,3 @@ func (UnimplementedFriendshipServant) RequestingFriend(req *web.RequestingFriend
}
func (UnimplementedFriendshipServant) mustEmbedUnimplementedFriendshipServant() {}
-
-// UnimplementedFriendshipRender can be embedded to have forward compatible implementations.
-type UnimplementedFriendshipRender struct {
- RenderAny func(*gin.Context, any, mir.Error)
-}
-
-func (r *UnimplementedFriendshipRender) RenderGetContacts(c *gin.Context, data *web.GetContactsResp, err mir.Error) {
- r.RenderAny(c, data, err)
-}
-
-func (r *UnimplementedFriendshipRender) RenderDeleteFriend(c *gin.Context, err mir.Error) {
- r.RenderAny(c, nil, err)
-}
-
-func (r *UnimplementedFriendshipRender) RenderRejectFriend(c *gin.Context, err mir.Error) {
- r.RenderAny(c, nil, err)
-}
-
-func (r *UnimplementedFriendshipRender) RenderAddFriend(c *gin.Context, err mir.Error) {
- r.RenderAny(c, nil, err)
-}
-
-func (r *UnimplementedFriendshipRender) RenderRequestingFriend(c *gin.Context, err mir.Error) {
- r.RenderAny(c, nil, err)
-}
-
-func (r *UnimplementedFriendshipRender) mustEmbedUnimplementedFriendshipRender() {}
-
-// UnimplementedFriendshipBinding can be embedded to have forward compatible implementations.
-type UnimplementedFriendshipBinding struct {
- BindAny func(*gin.Context, any) mir.Error
-}
-
-func (b *UnimplementedFriendshipBinding) BindGetContacts(c *gin.Context) (*web.GetContactsReq, mir.Error) {
- obj := new(web.GetContactsReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedFriendshipBinding) BindDeleteFriend(c *gin.Context) (*web.DeleteFriendReq, mir.Error) {
- obj := new(web.DeleteFriendReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedFriendshipBinding) BindRejectFriend(c *gin.Context) (*web.RejectFriendReq, mir.Error) {
- obj := new(web.RejectFriendReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedFriendshipBinding) BindAddFriend(c *gin.Context) (*web.AddFriendReq, mir.Error) {
- obj := new(web.AddFriendReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedFriendshipBinding) BindRequestingFriend(c *gin.Context) (*web.RequestingFriendReq, mir.Error) {
- obj := new(web.RequestingFriendReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedFriendshipBinding) mustEmbedUnimplementedFriendshipBinding() {}
diff --git a/auto/api/v1/loose.go b/auto/api/v1/loose.go
index 7d4d1046..4c9f9c6f 100644
--- a/auto/api/v1/loose.go
+++ b/auto/api/v1/loose.go
@@ -1,19 +1,25 @@
// Code generated by go-mir. DO NOT EDIT.
+// versions:
+// - mir v4.0.0
package v1
import (
"net/http"
- "github.com/alimy/mir/v3"
+ "github.com/alimy/mir/v4"
"github.com/gin-gonic/gin"
"github.com/rocboss/paopao-ce/internal/model/web"
)
type Loose interface {
+ _default_
+
// Chain provide handlers chain for gin
Chain() gin.HandlersChain
+ TweetComments(*web.TweetCommentsReq) (*web.TweetCommentsResp, mir.Error)
+ TopicList(*web.TopicListReq) (*web.TopicListResp, mir.Error)
GetUserProfile(*web.GetUserProfileReq) (*web.GetUserProfileResp, mir.Error)
GetUserTweets(*web.GetUserTweetsReq) (*web.GetUserTweetsResp, mir.Error)
Timeline(*web.TimelineReq) (*web.TimelineResp, mir.Error)
@@ -21,142 +27,112 @@ type Loose interface {
mustEmbedUnimplementedLooseServant()
}
-type LooseBinding interface {
- BindGetUserProfile(*gin.Context) (*web.GetUserProfileReq, mir.Error)
- BindGetUserTweets(*gin.Context) (*web.GetUserTweetsReq, mir.Error)
- BindTimeline(*gin.Context) (*web.TimelineReq, mir.Error)
-
- mustEmbedUnimplementedLooseBinding()
-}
-
-type LooseRender interface {
- RenderGetUserProfile(*gin.Context, *web.GetUserProfileResp, mir.Error)
- RenderGetUserTweets(*gin.Context, *web.GetUserTweetsResp, mir.Error)
- RenderTimeline(*gin.Context, *web.TimelineResp, mir.Error)
-
- mustEmbedUnimplementedLooseRender()
-}
-
// RegisterLooseServant register Loose servant to gin
-func RegisterLooseServant(e *gin.Engine, s Loose, b LooseBinding, r LooseRender) {
+func RegisterLooseServant(e *gin.Engine, s Loose) {
router := e.Group("v1")
// use chain for router
middlewares := s.Chain()
router.Use(middlewares...)
// register routes info to router
+ router.Handle("GET", "/post/comments", func(c *gin.Context) {
+ select {
+ case <-c.Request.Context().Done():
+ return
+ default:
+ }
+ req := new(web.TweetCommentsReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
+ return
+ }
+ resp, err := s.TweetComments(req)
+ s.Render(c, resp, err)
+ })
+ router.Handle("GET", "/tags", func(c *gin.Context) {
+ select {
+ case <-c.Request.Context().Done():
+ return
+ default:
+ }
+ req := new(web.TopicListReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
+ return
+ }
+ resp, err := s.TopicList(req)
+ s.Render(c, resp, err)
+ })
router.Handle("GET", "/user/profile", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindGetUserProfile(c)
- if err != nil {
- r.RenderGetUserProfile(c, nil, err)
+ req := new(web.GetUserProfileReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
return
}
resp, err := s.GetUserProfile(req)
- r.RenderGetUserProfile(c, resp, err)
+ s.Render(c, resp, err)
})
-
router.Handle("GET", "/user/posts", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindGetUserTweets(c)
- if err != nil {
- r.RenderGetUserTweets(c, nil, err)
+ req := new(web.GetUserTweetsReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
return
}
resp, err := s.GetUserTweets(req)
- r.RenderGetUserTweets(c, resp, err)
+ s.Render(c, resp, err)
})
-
router.Handle("GET", "/posts", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindTimeline(c)
- if err != nil {
- r.RenderTimeline(c, nil, err)
+ req := new(web.TimelineReq)
+ var bv _binding_ = req
+ if err := bv.Bind(c); err != nil {
+ s.Render(c, nil, err)
return
}
resp, err := s.Timeline(req)
- r.RenderTimeline(c, resp, err)
+ s.Render(c, resp, err)
})
-
}
// UnimplementedLooseServant can be embedded to have forward compatible implementations.
-type UnimplementedLooseServant struct {
-}
+type UnimplementedLooseServant struct{}
func (UnimplementedLooseServant) Chain() gin.HandlersChain {
return nil
}
-func (UnimplementedLooseServant) GetUserProfile(req *web.GetUserProfileReq) (*web.GetUserProfileResp, mir.Error) {
+func (UnimplementedLooseServant) TweetComments(req *web.TweetCommentsReq) (*web.TweetCommentsResp, mir.Error) {
return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented))
}
-func (UnimplementedLooseServant) GetUserTweets(req *web.GetUserTweetsReq) (*web.GetUserTweetsResp, mir.Error) {
+func (UnimplementedLooseServant) TopicList(req *web.TopicListReq) (*web.TopicListResp, mir.Error) {
return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented))
}
-func (UnimplementedLooseServant) Timeline(req *web.TimelineReq) (*web.TimelineResp, mir.Error) {
+func (UnimplementedLooseServant) GetUserProfile(req *web.GetUserProfileReq) (*web.GetUserProfileResp, mir.Error) {
return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented))
}
-func (UnimplementedLooseServant) mustEmbedUnimplementedLooseServant() {}
-
-// UnimplementedLooseRender can be embedded to have forward compatible implementations.
-type UnimplementedLooseRender struct {
- RenderAny func(*gin.Context, any, mir.Error)
-}
-
-func (r *UnimplementedLooseRender) RenderGetUserProfile(c *gin.Context, data *web.GetUserProfileResp, err mir.Error) {
- r.RenderAny(c, data, err)
-}
-
-func (r *UnimplementedLooseRender) RenderGetUserTweets(c *gin.Context, data *web.GetUserTweetsResp, err mir.Error) {
- r.RenderAny(c, data, err)
-}
-
-func (r *UnimplementedLooseRender) RenderTimeline(c *gin.Context, data *web.TimelineResp, err mir.Error) {
- r.RenderAny(c, data, err)
-}
-
-func (r *UnimplementedLooseRender) mustEmbedUnimplementedLooseRender() {}
-
-// UnimplementedLooseBinding can be embedded to have forward compatible implementations.
-type UnimplementedLooseBinding struct {
- BindAny func(*gin.Context, any) mir.Error
-}
-
-func (b *UnimplementedLooseBinding) BindGetUserProfile(c *gin.Context) (*web.GetUserProfileReq, mir.Error) {
- obj := new(web.GetUserProfileReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedLooseBinding) BindGetUserTweets(c *gin.Context) (*web.GetUserTweetsReq, mir.Error) {
- obj := new(web.GetUserTweetsReq)
- err := b.BindAny(c, obj)
- return obj, err
+func (UnimplementedLooseServant) GetUserTweets(req *web.GetUserTweetsReq) (*web.GetUserTweetsResp, mir.Error) {
+ return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented))
}
-func (b *UnimplementedLooseBinding) BindTimeline(c *gin.Context) (*web.TimelineReq, mir.Error) {
- obj := new(web.TimelineReq)
- err := b.BindAny(c, obj)
- return obj, err
+func (UnimplementedLooseServant) Timeline(req *web.TimelineReq) (*web.TimelineResp, mir.Error) {
+ return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented))
}
-func (b *UnimplementedLooseBinding) mustEmbedUnimplementedLooseBinding() {}
+func (UnimplementedLooseServant) mustEmbedUnimplementedLooseServant() {}
diff --git a/auto/api/v1/priv.go b/auto/api/v1/priv.go
index 42c88ade..f4adccfc 100644
--- a/auto/api/v1/priv.go
+++ b/auto/api/v1/priv.go
@@ -1,24 +1,36 @@
// Code generated by go-mir. DO NOT EDIT.
+// versions:
+// - mir v4.0.0
package v1
import (
"net/http"
- "github.com/alimy/mir/v3"
+ "github.com/alimy/mir/v4"
"github.com/gin-gonic/gin"
"github.com/rocboss/paopao-ce/internal/model/web"
)
type Priv interface {
+ _default_
+
// Chain provide handlers chain for gin
Chain() gin.HandlersChain
+ UnfollowTopic(*web.UnfollowTopicReq) mir.Error
+ FollowTopic(*web.FollowTopicReq) mir.Error
+ StickTopic(*web.StickTopicReq) (*web.StickTopicResp, mir.Error)
+ ThumbsDownTweetReply(*web.TweetReplyThumbsReq) mir.Error
+ ThumbsUpTweetReply(*web.TweetReplyThumbsReq) mir.Error
+ ThumbsDownTweetComment(*web.TweetCommentThumbsReq) mir.Error
+ ThumbsUpTweetComment(*web.TweetCommentThumbsReq) mir.Error
DeleteCommentReply(*web.DeleteCommentReplyReq) mir.Error
CreateCommentReply(*web.CreateCommentReplyReq) (*web.CreateCommentReplyResp, mir.Error)
DeleteComment(*web.DeleteCommentReq) mir.Error
CreateComment(*web.CreateCommentReq) (*web.CreateCommentResp, mir.Error)
VisibleTweet(*web.VisibleTweetReq) (*web.VisibleTweetResp, mir.Error)
+ HighlightTweet(*web.HighlightTweetReq) (*web.HighlightTweetResp, mir.Error)
StickTweet(*web.StickTweetReq) (*web.StickTweetResp, mir.Error)
LockTweet(*web.LockTweetReq) (*web.LockTweetResp, mir.Error)
CollectionTweet(*web.CollectionTweetReq) (*web.CollectionTweetResp, mir.Error)
@@ -32,283 +44,356 @@ type Priv interface {
mustEmbedUnimplementedPrivServant()
}
-type PrivBinding interface {
- BindDeleteCommentReply(*gin.Context) (*web.DeleteCommentReplyReq, mir.Error)
- BindCreateCommentReply(*gin.Context) (*web.CreateCommentReplyReq, mir.Error)
- BindDeleteComment(*gin.Context) (*web.DeleteCommentReq, mir.Error)
- BindCreateComment(*gin.Context) (*web.CreateCommentReq, mir.Error)
- BindVisibleTweet(*gin.Context) (*web.VisibleTweetReq, mir.Error)
- BindStickTweet(*gin.Context) (*web.StickTweetReq, mir.Error)
- BindLockTweet(*gin.Context) (*web.LockTweetReq, mir.Error)
- BindCollectionTweet(*gin.Context) (*web.CollectionTweetReq, mir.Error)
- BindStarTweet(*gin.Context) (*web.StarTweetReq, mir.Error)
- BindDeleteTweet(*gin.Context) (*web.DeleteTweetReq, mir.Error)
- BindCreateTweet(*gin.Context) (*web.CreateTweetReq, mir.Error)
- BindDownloadAttachment(*gin.Context) (*web.DownloadAttachmentReq, mir.Error)
- BindDownloadAttachmentPrecheck(*gin.Context) (*web.DownloadAttachmentPrecheckReq, mir.Error)
- BindUploadAttachment(*gin.Context) (*web.UploadAttachmentReq, mir.Error)
-
- mustEmbedUnimplementedPrivBinding()
-}
-
-type PrivRender interface {
- RenderDeleteCommentReply(*gin.Context, mir.Error)
- RenderCreateCommentReply(*gin.Context, *web.CreateCommentReplyResp, mir.Error)
- RenderDeleteComment(*gin.Context, mir.Error)
- RenderCreateComment(*gin.Context, *web.CreateCommentResp, mir.Error)
- RenderVisibleTweet(*gin.Context, *web.VisibleTweetResp, mir.Error)
- RenderStickTweet(*gin.Context, *web.StickTweetResp, mir.Error)
- RenderLockTweet(*gin.Context, *web.LockTweetResp, mir.Error)
- RenderCollectionTweet(*gin.Context, *web.CollectionTweetResp, mir.Error)
- RenderStarTweet(*gin.Context, *web.StarTweetResp, mir.Error)
- RenderDeleteTweet(*gin.Context, mir.Error)
- RenderCreateTweet(*gin.Context, *web.CreateTweetResp, mir.Error)
- RenderDownloadAttachment(*gin.Context, *web.DownloadAttachmentResp, mir.Error)
- RenderDownloadAttachmentPrecheck(*gin.Context, *web.DownloadAttachmentPrecheckResp, mir.Error)
- RenderUploadAttachment(*gin.Context, *web.UploadAttachmentResp, mir.Error)
-
- mustEmbedUnimplementedPrivRender()
-}
-
// RegisterPrivServant register Priv servant to gin
-func RegisterPrivServant(e *gin.Engine, s Priv, b PrivBinding, r PrivRender) {
+func RegisterPrivServant(e *gin.Engine, s Priv) {
router := e.Group("v1")
// use chain for router
middlewares := s.Chain()
router.Use(middlewares...)
// register routes info to router
+ router.Handle("POST", "/topic/unfollow", func(c *gin.Context) {
+ select {
+ case <-c.Request.Context().Done():
+ return
+ default:
+ }
+ req := new(web.UnfollowTopicReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
+ return
+ }
+ s.Render(c, nil, s.UnfollowTopic(req))
+ })
+ router.Handle("POST", "/topic/follow", func(c *gin.Context) {
+ select {
+ case <-c.Request.Context().Done():
+ return
+ default:
+ }
+ req := new(web.FollowTopicReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
+ return
+ }
+ s.Render(c, nil, s.FollowTopic(req))
+ })
+ router.Handle("POST", "/topic/stick", func(c *gin.Context) {
+ select {
+ case <-c.Request.Context().Done():
+ return
+ default:
+ }
+ req := new(web.StickTopicReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
+ return
+ }
+ resp, err := s.StickTopic(req)
+ s.Render(c, resp, err)
+ })
+ router.Handle("POST", "/tweet/reply/thumbsdown", func(c *gin.Context) {
+ select {
+ case <-c.Request.Context().Done():
+ return
+ default:
+ }
+ req := new(web.TweetReplyThumbsReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
+ return
+ }
+ s.Render(c, nil, s.ThumbsDownTweetReply(req))
+ })
+ router.Handle("POST", "/tweet/reply/thumbsup", func(c *gin.Context) {
+ select {
+ case <-c.Request.Context().Done():
+ return
+ default:
+ }
+ req := new(web.TweetReplyThumbsReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
+ return
+ }
+ s.Render(c, nil, s.ThumbsUpTweetReply(req))
+ })
+ router.Handle("POST", "/tweet/comment/thumbsdown", func(c *gin.Context) {
+ select {
+ case <-c.Request.Context().Done():
+ return
+ default:
+ }
+ req := new(web.TweetCommentThumbsReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
+ return
+ }
+ s.Render(c, nil, s.ThumbsDownTweetComment(req))
+ })
+ router.Handle("POST", "/tweet/comment/thumbsup", func(c *gin.Context) {
+ select {
+ case <-c.Request.Context().Done():
+ return
+ default:
+ }
+ req := new(web.TweetCommentThumbsReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
+ return
+ }
+ s.Render(c, nil, s.ThumbsUpTweetComment(req))
+ })
router.Handle("DELETE", "/post/comment/reply", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindDeleteCommentReply(c)
- if err != nil {
- r.RenderDeleteCommentReply(c, err)
+ req := new(web.DeleteCommentReplyReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
return
}
- r.RenderDeleteCommentReply(c, s.DeleteCommentReply(req))
+ s.Render(c, nil, s.DeleteCommentReply(req))
})
-
router.Handle("POST", "/post/comment/reply", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindCreateCommentReply(c)
- if err != nil {
- r.RenderCreateCommentReply(c, nil, err)
+ req := new(web.CreateCommentReplyReq)
+ var bv _binding_ = req
+ if err := bv.Bind(c); err != nil {
+ s.Render(c, nil, err)
return
}
resp, err := s.CreateCommentReply(req)
- r.RenderCreateCommentReply(c, resp, err)
+ s.Render(c, resp, err)
})
-
router.Handle("DELETE", "/post/comment", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindDeleteComment(c)
- if err != nil {
- r.RenderDeleteComment(c, err)
+ req := new(web.DeleteCommentReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
return
}
- r.RenderDeleteComment(c, s.DeleteComment(req))
+ s.Render(c, nil, s.DeleteComment(req))
})
-
router.Handle("POST", "/post/comment", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindCreateComment(c)
- if err != nil {
- r.RenderCreateComment(c, nil, err)
+ req := new(web.CreateCommentReq)
+ var bv _binding_ = req
+ if err := bv.Bind(c); err != nil {
+ s.Render(c, nil, err)
return
}
resp, err := s.CreateComment(req)
- r.RenderCreateComment(c, resp, err)
+ s.Render(c, resp, err)
})
-
router.Handle("POST", "/post/visibility", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindVisibleTweet(c)
- if err != nil {
- r.RenderVisibleTweet(c, nil, err)
+ req := new(web.VisibleTweetReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
return
}
resp, err := s.VisibleTweet(req)
- r.RenderVisibleTweet(c, resp, err)
+ s.Render(c, resp, err)
+ })
+ router.Handle("POST", "/post/highlight", func(c *gin.Context) {
+ select {
+ case <-c.Request.Context().Done():
+ return
+ default:
+ }
+ req := new(web.HighlightTweetReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
+ return
+ }
+ resp, err := s.HighlightTweet(req)
+ s.Render(c, resp, err)
})
-
router.Handle("POST", "/post/stick", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindStickTweet(c)
- if err != nil {
- r.RenderStickTweet(c, nil, err)
+ req := new(web.StickTweetReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
return
}
resp, err := s.StickTweet(req)
- r.RenderStickTweet(c, resp, err)
+ s.Render(c, resp, err)
})
-
router.Handle("POST", "/post/lock", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindLockTweet(c)
- if err != nil {
- r.RenderLockTweet(c, nil, err)
+ req := new(web.LockTweetReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
return
}
resp, err := s.LockTweet(req)
- r.RenderLockTweet(c, resp, err)
+ s.Render(c, resp, err)
})
-
router.Handle("POST", "/post/collection", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindCollectionTweet(c)
- if err != nil {
- r.RenderCollectionTweet(c, nil, err)
+ req := new(web.CollectionTweetReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
return
}
resp, err := s.CollectionTweet(req)
- r.RenderCollectionTweet(c, resp, err)
+ s.Render(c, resp, err)
})
-
- router.Handle("POST", "/post/start", func(c *gin.Context) {
+ router.Handle("POST", "/post/star", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindStarTweet(c)
- if err != nil {
- r.RenderStarTweet(c, nil, err)
+ req := new(web.StarTweetReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
return
}
resp, err := s.StarTweet(req)
- r.RenderStarTweet(c, resp, err)
+ s.Render(c, resp, err)
})
-
router.Handle("DELETE", "/post", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindDeleteTweet(c)
- if err != nil {
- r.RenderDeleteTweet(c, err)
+ req := new(web.DeleteTweetReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
return
}
- r.RenderDeleteTweet(c, s.DeleteTweet(req))
+ s.Render(c, nil, s.DeleteTweet(req))
})
-
router.Handle("POST", "/post", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindCreateTweet(c)
- if err != nil {
- r.RenderCreateTweet(c, nil, err)
+ req := new(web.CreateTweetReq)
+ var bv _binding_ = req
+ if err := bv.Bind(c); err != nil {
+ s.Render(c, nil, err)
return
}
resp, err := s.CreateTweet(req)
- r.RenderCreateTweet(c, resp, err)
+ s.Render(c, resp, err)
})
-
router.Handle("GET", "/attachment", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindDownloadAttachment(c)
- if err != nil {
- r.RenderDownloadAttachment(c, nil, err)
+ req := new(web.DownloadAttachmentReq)
+ var bv _binding_ = req
+ if err := bv.Bind(c); err != nil {
+ s.Render(c, nil, err)
return
}
resp, err := s.DownloadAttachment(req)
- r.RenderDownloadAttachment(c, resp, err)
+ s.Render(c, resp, err)
})
-
router.Handle("GET", "/attachment/precheck", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindDownloadAttachmentPrecheck(c)
- if err != nil {
- r.RenderDownloadAttachmentPrecheck(c, nil, err)
+ req := new(web.DownloadAttachmentPrecheckReq)
+ var bv _binding_ = req
+ if err := bv.Bind(c); err != nil {
+ s.Render(c, nil, err)
return
}
resp, err := s.DownloadAttachmentPrecheck(req)
- r.RenderDownloadAttachmentPrecheck(c, resp, err)
+ s.Render(c, resp, err)
})
-
router.Handle("POST", "/attachment", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindUploadAttachment(c)
- if err != nil {
- r.RenderUploadAttachment(c, nil, err)
+ req := new(web.UploadAttachmentReq)
+ var bv _binding_ = req
+ if err := bv.Bind(c); err != nil {
+ s.Render(c, nil, err)
return
}
resp, err := s.UploadAttachment(req)
- r.RenderUploadAttachment(c, resp, err)
+ s.Render(c, resp, err)
})
-
}
// UnimplementedPrivServant can be embedded to have forward compatible implementations.
-type UnimplementedPrivServant struct {
-}
+type UnimplementedPrivServant struct{}
func (UnimplementedPrivServant) Chain() gin.HandlersChain {
return nil
}
+func (UnimplementedPrivServant) UnfollowTopic(req *web.UnfollowTopicReq) mir.Error {
+ return mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented))
+}
+
+func (UnimplementedPrivServant) FollowTopic(req *web.FollowTopicReq) mir.Error {
+ return mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented))
+}
+
+func (UnimplementedPrivServant) StickTopic(req *web.StickTopicReq) (*web.StickTopicResp, mir.Error) {
+ return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented))
+}
+
+func (UnimplementedPrivServant) ThumbsDownTweetReply(req *web.TweetReplyThumbsReq) mir.Error {
+ return mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented))
+}
+
+func (UnimplementedPrivServant) ThumbsUpTweetReply(req *web.TweetReplyThumbsReq) mir.Error {
+ return mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented))
+}
+
+func (UnimplementedPrivServant) ThumbsDownTweetComment(req *web.TweetCommentThumbsReq) mir.Error {
+ return mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented))
+}
+
+func (UnimplementedPrivServant) ThumbsUpTweetComment(req *web.TweetCommentThumbsReq) mir.Error {
+ return mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented))
+}
+
func (UnimplementedPrivServant) DeleteCommentReply(req *web.DeleteCommentReplyReq) mir.Error {
return mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented))
}
@@ -329,6 +414,10 @@ func (UnimplementedPrivServant) VisibleTweet(req *web.VisibleTweetReq) (*web.Vis
return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented))
}
+func (UnimplementedPrivServant) HighlightTweet(req *web.HighlightTweetReq) (*web.HighlightTweetResp, mir.Error) {
+ return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented))
+}
+
func (UnimplementedPrivServant) StickTweet(req *web.StickTweetReq) (*web.StickTweetResp, mir.Error) {
return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented))
}
@@ -366,157 +455,3 @@ func (UnimplementedPrivServant) UploadAttachment(req *web.UploadAttachmentReq) (
}
func (UnimplementedPrivServant) mustEmbedUnimplementedPrivServant() {}
-
-// UnimplementedPrivRender can be embedded to have forward compatible implementations.
-type UnimplementedPrivRender struct {
- RenderAny func(*gin.Context, any, mir.Error)
-}
-
-func (r *UnimplementedPrivRender) RenderDeleteCommentReply(c *gin.Context, err mir.Error) {
- r.RenderAny(c, nil, err)
-}
-
-func (r *UnimplementedPrivRender) RenderCreateCommentReply(c *gin.Context, data *web.CreateCommentReplyResp, err mir.Error) {
- r.RenderAny(c, data, err)
-}
-
-func (r *UnimplementedPrivRender) RenderDeleteComment(c *gin.Context, err mir.Error) {
- r.RenderAny(c, nil, err)
-}
-
-func (r *UnimplementedPrivRender) RenderCreateComment(c *gin.Context, data *web.CreateCommentResp, err mir.Error) {
- r.RenderAny(c, data, err)
-}
-
-func (r *UnimplementedPrivRender) RenderVisibleTweet(c *gin.Context, data *web.VisibleTweetResp, err mir.Error) {
- r.RenderAny(c, data, err)
-}
-
-func (r *UnimplementedPrivRender) RenderStickTweet(c *gin.Context, data *web.StickTweetResp, err mir.Error) {
- r.RenderAny(c, data, err)
-}
-
-func (r *UnimplementedPrivRender) RenderLockTweet(c *gin.Context, data *web.LockTweetResp, err mir.Error) {
- r.RenderAny(c, data, err)
-}
-
-func (r *UnimplementedPrivRender) RenderCollectionTweet(c *gin.Context, data *web.CollectionTweetResp, err mir.Error) {
- r.RenderAny(c, data, err)
-}
-
-func (r *UnimplementedPrivRender) RenderStarTweet(c *gin.Context, data *web.StarTweetResp, err mir.Error) {
- r.RenderAny(c, data, err)
-}
-
-func (r *UnimplementedPrivRender) RenderDeleteTweet(c *gin.Context, err mir.Error) {
- r.RenderAny(c, nil, err)
-}
-
-func (r *UnimplementedPrivRender) RenderCreateTweet(c *gin.Context, data *web.CreateTweetResp, err mir.Error) {
- r.RenderAny(c, data, err)
-}
-
-func (r *UnimplementedPrivRender) RenderDownloadAttachment(c *gin.Context, data *web.DownloadAttachmentResp, err mir.Error) {
- r.RenderAny(c, data, err)
-}
-
-func (r *UnimplementedPrivRender) RenderDownloadAttachmentPrecheck(c *gin.Context, data *web.DownloadAttachmentPrecheckResp, err mir.Error) {
- r.RenderAny(c, data, err)
-}
-
-func (r *UnimplementedPrivRender) RenderUploadAttachment(c *gin.Context, data *web.UploadAttachmentResp, err mir.Error) {
- r.RenderAny(c, data, err)
-}
-
-func (r *UnimplementedPrivRender) mustEmbedUnimplementedPrivRender() {}
-
-// UnimplementedPrivBinding can be embedded to have forward compatible implementations.
-type UnimplementedPrivBinding struct {
- BindAny func(*gin.Context, any) mir.Error
-}
-
-func (b *UnimplementedPrivBinding) BindDeleteCommentReply(c *gin.Context) (*web.DeleteCommentReplyReq, mir.Error) {
- obj := new(web.DeleteCommentReplyReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedPrivBinding) BindCreateCommentReply(c *gin.Context) (*web.CreateCommentReplyReq, mir.Error) {
- obj := new(web.CreateCommentReplyReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedPrivBinding) BindDeleteComment(c *gin.Context) (*web.DeleteCommentReq, mir.Error) {
- obj := new(web.DeleteCommentReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedPrivBinding) BindCreateComment(c *gin.Context) (*web.CreateCommentReq, mir.Error) {
- obj := new(web.CreateCommentReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedPrivBinding) BindVisibleTweet(c *gin.Context) (*web.VisibleTweetReq, mir.Error) {
- obj := new(web.VisibleTweetReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedPrivBinding) BindStickTweet(c *gin.Context) (*web.StickTweetReq, mir.Error) {
- obj := new(web.StickTweetReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedPrivBinding) BindLockTweet(c *gin.Context) (*web.LockTweetReq, mir.Error) {
- obj := new(web.LockTweetReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedPrivBinding) BindCollectionTweet(c *gin.Context) (*web.CollectionTweetReq, mir.Error) {
- obj := new(web.CollectionTweetReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedPrivBinding) BindStarTweet(c *gin.Context) (*web.StarTweetReq, mir.Error) {
- obj := new(web.StarTweetReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedPrivBinding) BindDeleteTweet(c *gin.Context) (*web.DeleteTweetReq, mir.Error) {
- obj := new(web.DeleteTweetReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedPrivBinding) BindCreateTweet(c *gin.Context) (*web.CreateTweetReq, mir.Error) {
- obj := new(web.CreateTweetReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedPrivBinding) BindDownloadAttachment(c *gin.Context) (*web.DownloadAttachmentReq, mir.Error) {
- obj := new(web.DownloadAttachmentReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedPrivBinding) BindDownloadAttachmentPrecheck(c *gin.Context) (*web.DownloadAttachmentPrecheckReq, mir.Error) {
- obj := new(web.DownloadAttachmentPrecheckReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedPrivBinding) BindUploadAttachment(c *gin.Context) (*web.UploadAttachmentReq, mir.Error) {
- obj := new(web.UploadAttachmentReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedPrivBinding) mustEmbedUnimplementedPrivBinding() {}
diff --git a/auto/api/v1/pub.go b/auto/api/v1/pub.go
index 7fe417e7..850a7906 100644
--- a/auto/api/v1/pub.go
+++ b/auto/api/v1/pub.go
@@ -1,18 +1,20 @@
// Code generated by go-mir. DO NOT EDIT.
+// versions:
+// - mir v4.0.0
package v1
import (
"net/http"
- "github.com/alimy/mir/v3"
+ "github.com/alimy/mir/v4"
"github.com/gin-gonic/gin"
"github.com/rocboss/paopao-ce/internal/model/web"
)
type Pub interface {
- TopicList(*web.TopicListReq) (*web.TopicListResp, mir.Error)
- TweetComments(*web.TweetCommentsReq) (*web.TweetCommentsResp, mir.Error)
+ _default_
+
TweetDetail(*web.TweetDetailReq) (*web.TweetDetailResp, mir.Error)
SendCaptcha(*web.SendCaptchaReq) mir.Error
GetCaptcha() (*web.GetCaptchaResp, mir.Error)
@@ -23,98 +25,38 @@ type Pub interface {
mustEmbedUnimplementedPubServant()
}
-type PubBinding interface {
- BindTopicList(*gin.Context) (*web.TopicListReq, mir.Error)
- BindTweetComments(*gin.Context) (*web.TweetCommentsReq, mir.Error)
- BindTweetDetail(*gin.Context) (*web.TweetDetailReq, mir.Error)
- BindSendCaptcha(*gin.Context) (*web.SendCaptchaReq, mir.Error)
- BindRegister(*gin.Context) (*web.RegisterReq, mir.Error)
- BindLogin(*gin.Context) (*web.LoginReq, mir.Error)
-
- mustEmbedUnimplementedPubBinding()
-}
-
-type PubRender interface {
- RenderTopicList(*gin.Context, *web.TopicListResp, mir.Error)
- RenderTweetComments(*gin.Context, *web.TweetCommentsResp, mir.Error)
- RenderTweetDetail(*gin.Context, *web.TweetDetailResp, mir.Error)
- RenderSendCaptcha(*gin.Context, mir.Error)
- RenderGetCaptcha(*gin.Context, *web.GetCaptchaResp, mir.Error)
- RenderRegister(*gin.Context, *web.RegisterResp, mir.Error)
- RenderLogin(*gin.Context, *web.LoginResp, mir.Error)
- RenderVersion(*gin.Context, *web.VersionResp, mir.Error)
-
- mustEmbedUnimplementedPubRender()
-}
-
// RegisterPubServant register Pub servant to gin
-func RegisterPubServant(e *gin.Engine, s Pub, b PubBinding, r PubRender) {
+func RegisterPubServant(e *gin.Engine, s Pub) {
router := e.Group("v1")
// register routes info to router
- router.Handle("GET", "/tags", func(c *gin.Context) {
- select {
- case <-c.Request.Context().Done():
- return
- default:
- }
-
- req, err := b.BindTopicList(c)
- if err != nil {
- r.RenderTopicList(c, nil, err)
- return
- }
- resp, err := s.TopicList(req)
- r.RenderTopicList(c, resp, err)
- })
-
- router.Handle("GET", "/post/comments", func(c *gin.Context) {
- select {
- case <-c.Request.Context().Done():
- return
- default:
- }
-
- req, err := b.BindTweetComments(c)
- if err != nil {
- r.RenderTweetComments(c, nil, err)
- return
- }
- resp, err := s.TweetComments(req)
- r.RenderTweetComments(c, resp, err)
- })
-
router.Handle("GET", "/post", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindTweetDetail(c)
- if err != nil {
- r.RenderTweetDetail(c, nil, err)
+ req := new(web.TweetDetailReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
return
}
resp, err := s.TweetDetail(req)
- r.RenderTweetDetail(c, resp, err)
+ s.Render(c, resp, err)
})
-
router.Handle("POST", "/captcha", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindSendCaptcha(c)
- if err != nil {
- r.RenderSendCaptcha(c, err)
+ req := new(web.SendCaptchaReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
return
}
- r.RenderSendCaptcha(c, s.SendCaptcha(req))
+ s.Render(c, nil, s.SendCaptcha(req))
})
-
router.Handle("GET", "/captcha", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
@@ -123,41 +65,36 @@ func RegisterPubServant(e *gin.Engine, s Pub, b PubBinding, r PubRender) {
}
resp, err := s.GetCaptcha()
- r.RenderGetCaptcha(c, resp, err)
+ s.Render(c, resp, err)
})
-
router.Handle("POST", "/auth/register", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindRegister(c)
- if err != nil {
- r.RenderRegister(c, nil, err)
+ req := new(web.RegisterReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
return
}
resp, err := s.Register(req)
- r.RenderRegister(c, resp, err)
+ s.Render(c, resp, err)
})
-
router.Handle("POST", "/auth/login", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindLogin(c)
- if err != nil {
- r.RenderLogin(c, nil, err)
+ req := new(web.LoginReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
return
}
resp, err := s.Login(req)
- r.RenderLogin(c, resp, err)
+ s.Render(c, resp, err)
})
-
router.Handle("GET", "/", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
@@ -166,22 +103,12 @@ func RegisterPubServant(e *gin.Engine, s Pub, b PubBinding, r PubRender) {
}
resp, err := s.Version()
- r.RenderVersion(c, resp, err)
+ s.Render(c, resp, err)
})
-
}
// UnimplementedPubServant can be embedded to have forward compatible implementations.
-type UnimplementedPubServant struct {
-}
-
-func (UnimplementedPubServant) TopicList(req *web.TopicListReq) (*web.TopicListResp, mir.Error) {
- return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented))
-}
-
-func (UnimplementedPubServant) TweetComments(req *web.TweetCommentsReq) (*web.TweetCommentsResp, mir.Error) {
- return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented))
-}
+type UnimplementedPubServant struct{}
func (UnimplementedPubServant) TweetDetail(req *web.TweetDetailReq) (*web.TweetDetailResp, mir.Error) {
return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented))
@@ -208,85 +135,3 @@ func (UnimplementedPubServant) Version() (*web.VersionResp, mir.Error) {
}
func (UnimplementedPubServant) mustEmbedUnimplementedPubServant() {}
-
-// UnimplementedPubRender can be embedded to have forward compatible implementations.
-type UnimplementedPubRender struct {
- RenderAny func(*gin.Context, any, mir.Error)
-}
-
-func (r *UnimplementedPubRender) RenderTopicList(c *gin.Context, data *web.TopicListResp, err mir.Error) {
- r.RenderAny(c, data, err)
-}
-
-func (r *UnimplementedPubRender) RenderTweetComments(c *gin.Context, data *web.TweetCommentsResp, err mir.Error) {
- r.RenderAny(c, data, err)
-}
-
-func (r *UnimplementedPubRender) RenderTweetDetail(c *gin.Context, data *web.TweetDetailResp, err mir.Error) {
- r.RenderAny(c, data, err)
-}
-
-func (r *UnimplementedPubRender) RenderSendCaptcha(c *gin.Context, err mir.Error) {
- r.RenderAny(c, nil, err)
-}
-
-func (r *UnimplementedPubRender) RenderGetCaptcha(c *gin.Context, data *web.GetCaptchaResp, err mir.Error) {
- r.RenderAny(c, data, err)
-}
-
-func (r *UnimplementedPubRender) RenderRegister(c *gin.Context, data *web.RegisterResp, err mir.Error) {
- r.RenderAny(c, data, err)
-}
-
-func (r *UnimplementedPubRender) RenderLogin(c *gin.Context, data *web.LoginResp, err mir.Error) {
- r.RenderAny(c, data, err)
-}
-
-func (r *UnimplementedPubRender) RenderVersion(c *gin.Context, data *web.VersionResp, err mir.Error) {
- r.RenderAny(c, data, err)
-}
-
-func (r *UnimplementedPubRender) mustEmbedUnimplementedPubRender() {}
-
-// UnimplementedPubBinding can be embedded to have forward compatible implementations.
-type UnimplementedPubBinding struct {
- BindAny func(*gin.Context, any) mir.Error
-}
-
-func (b *UnimplementedPubBinding) BindTopicList(c *gin.Context) (*web.TopicListReq, mir.Error) {
- obj := new(web.TopicListReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedPubBinding) BindTweetComments(c *gin.Context) (*web.TweetCommentsReq, mir.Error) {
- obj := new(web.TweetCommentsReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedPubBinding) BindTweetDetail(c *gin.Context) (*web.TweetDetailReq, mir.Error) {
- obj := new(web.TweetDetailReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedPubBinding) BindSendCaptcha(c *gin.Context) (*web.SendCaptchaReq, mir.Error) {
- obj := new(web.SendCaptchaReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedPubBinding) BindRegister(c *gin.Context) (*web.RegisterReq, mir.Error) {
- obj := new(web.RegisterReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedPubBinding) BindLogin(c *gin.Context) (*web.LoginReq, mir.Error) {
- obj := new(web.LoginReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedPubBinding) mustEmbedUnimplementedPubBinding() {}
diff --git a/auto/api/x/v1/user.go b/auto/api/x/v1/user.go
index 89a3b086..9de31b49 100644
--- a/auto/api/x/v1/user.go
+++ b/auto/api/x/v1/user.go
@@ -1,14 +1,29 @@
// Code generated by go-mir. DO NOT EDIT.
+// versions:
+// - mir v4.0.0
package v1
import (
"net/http"
- "github.com/alimy/mir/v3"
+ "github.com/alimy/mir/v4"
"github.com/gin-gonic/gin"
)
+type _binding_ interface {
+ Bind(*gin.Context) mir.Error
+}
+
+type _render_ interface {
+ Render(*gin.Context)
+}
+
+type _default_ interface {
+ Bind(*gin.Context, any) mir.Error
+ Render(*gin.Context, any, mir.Error)
+}
+
type LoginReq struct {
AgentInfo AgentInfo `json:"agent_info"`
Name string `json:"name"`
@@ -35,6 +50,8 @@ type UserInfo struct {
}
type User interface {
+ _default_
+
// Chain provide handlers chain for gin
Chain() gin.HandlersChain
@@ -44,21 +61,8 @@ type User interface {
mustEmbedUnimplementedUserServant()
}
-type UserBinding interface {
- BindLogin(*gin.Context) (*LoginReq, mir.Error)
-
- mustEmbedUnimplementedUserBinding()
-}
-
-type UserRender interface {
- RenderLogout(*gin.Context, mir.Error)
- RenderLogin(*gin.Context, *LoginResp, mir.Error)
-
- mustEmbedUnimplementedUserRender()
-}
-
// RegisterUserServant register User servant to gin
-func RegisterUserServant(e *gin.Engine, s User, b UserBinding, r UserRender) {
+func RegisterUserServant(e *gin.Engine, s User) {
router := e.Group("x/v1")
// use chain for router
middlewares := s.Chain()
@@ -72,30 +76,26 @@ func RegisterUserServant(e *gin.Engine, s User, b UserBinding, r UserRender) {
default:
}
- r.RenderLogout(c, s.Logout())
+ s.Render(c, nil, s.Logout())
})
-
router.Handle("POST", "/user/login/", func(c *gin.Context) {
select {
case <-c.Request.Context().Done():
return
default:
}
-
- req, err := b.BindLogin(c)
- if err != nil {
- r.RenderLogin(c, nil, err)
+ req := new(LoginReq)
+ if err := s.Bind(c, req); err != nil {
+ s.Render(c, nil, err)
return
}
resp, err := s.Login(req)
- r.RenderLogin(c, resp, err)
+ s.Render(c, resp, err)
})
-
}
// UnimplementedUserServant can be embedded to have forward compatible implementations.
-type UnimplementedUserServant struct {
-}
+type UnimplementedUserServant struct{}
func (UnimplementedUserServant) Chain() gin.HandlersChain {
return nil
@@ -110,31 +110,3 @@ func (UnimplementedUserServant) Login(req *LoginReq) (*LoginResp, mir.Error) {
}
func (UnimplementedUserServant) mustEmbedUnimplementedUserServant() {}
-
-// UnimplementedUserRender can be embedded to have forward compatible implementations.
-type UnimplementedUserRender struct {
- RenderAny func(*gin.Context, any, mir.Error)
-}
-
-func (r *UnimplementedUserRender) RenderLogout(c *gin.Context, err mir.Error) {
- r.RenderAny(c, nil, err)
-}
-
-func (r *UnimplementedUserRender) RenderLogin(c *gin.Context, data *LoginResp, err mir.Error) {
- r.RenderAny(c, data, err)
-}
-
-func (r *UnimplementedUserRender) mustEmbedUnimplementedUserRender() {}
-
-// UnimplementedUserBinding can be embedded to have forward compatible implementations.
-type UnimplementedUserBinding struct {
- BindAny func(*gin.Context, any) mir.Error
-}
-
-func (b *UnimplementedUserBinding) BindLogin(c *gin.Context) (*LoginReq, mir.Error) {
- obj := new(LoginReq)
- err := b.BindAny(c, obj)
- return obj, err
-}
-
-func (b *UnimplementedUserBinding) mustEmbedUnimplementedUserBinding() {}
diff --git a/auto/connect/core/v1/corev1connect/auth.connect.go b/auto/connect/core/v1/corev1connect/auth.connect.go
new file mode 100644
index 00000000..f15ea068
--- /dev/null
+++ b/auto/connect/core/v1/corev1connect/auth.connect.go
@@ -0,0 +1,159 @@
+// Code generated by protoc-gen-connect-go. DO NOT EDIT.
+//
+// Source: core/v1/auth.proto
+
+package corev1connect
+
+import (
+ context "context"
+ errors "errors"
+ connect_go "github.com/bufbuild/connect-go"
+ v1 "github.com/rocboss/paopao-ce/auto/rpc/core/v1"
+ http "net/http"
+ strings "strings"
+)
+
+// This is a compile-time assertion to ensure that this generated file and the connect package are
+// compatible. If you get a compiler error that this constant is not defined, this code was
+// generated with a version of connect newer than the one compiled into your binary. You can fix the
+// problem by either regenerating this code with an older version of connect or updating the connect
+// version compiled into your binary.
+const _ = connect_go.IsAtLeastVersion0_1_0
+
+const (
+ // AuthenticateServiceName is the fully-qualified name of the AuthenticateService service.
+ AuthenticateServiceName = "core.v1.AuthenticateService"
+)
+
+// These constants are the fully-qualified names of the RPCs defined in this package. They're
+// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
+//
+// Note that these are different from the fully-qualified method names used by
+// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to
+// reflection-formatted method names, remove the leading slash and convert the remaining slash to a
+// period.
+const (
+ // AuthenticateServicePreLoginProcedure is the fully-qualified name of the AuthenticateService's
+ // preLogin RPC.
+ AuthenticateServicePreLoginProcedure = "/core.v1.AuthenticateService/preLogin"
+ // AuthenticateServiceLoginProcedure is the fully-qualified name of the AuthenticateService's login
+ // RPC.
+ AuthenticateServiceLoginProcedure = "/core.v1.AuthenticateService/login"
+ // AuthenticateServiceLogoutProcedure is the fully-qualified name of the AuthenticateService's
+ // logout RPC.
+ AuthenticateServiceLogoutProcedure = "/core.v1.AuthenticateService/logout"
+)
+
+// AuthenticateServiceClient is a client for the core.v1.AuthenticateService service.
+type AuthenticateServiceClient interface {
+ PreLogin(context.Context, *connect_go.Request[v1.User]) (*connect_go.Response[v1.ActionReply], error)
+ Login(context.Context, *connect_go.Request[v1.User]) (*connect_go.Response[v1.LoginReply], error)
+ Logout(context.Context, *connect_go.Request[v1.User]) (*connect_go.Response[v1.ActionReply], error)
+}
+
+// NewAuthenticateServiceClient constructs a client for the core.v1.AuthenticateService service. By
+// default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses,
+// and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the
+// connect.WithGRPC() or connect.WithGRPCWeb() options.
+//
+// The URL supplied here should be the base URL for the Connect or gRPC server (for example,
+// http://api.acme.com or https://acme.com/grpc).
+func NewAuthenticateServiceClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) AuthenticateServiceClient {
+ baseURL = strings.TrimRight(baseURL, "/")
+ return &authenticateServiceClient{
+ preLogin: connect_go.NewClient[v1.User, v1.ActionReply](
+ httpClient,
+ baseURL+AuthenticateServicePreLoginProcedure,
+ opts...,
+ ),
+ login: connect_go.NewClient[v1.User, v1.LoginReply](
+ httpClient,
+ baseURL+AuthenticateServiceLoginProcedure,
+ opts...,
+ ),
+ logout: connect_go.NewClient[v1.User, v1.ActionReply](
+ httpClient,
+ baseURL+AuthenticateServiceLogoutProcedure,
+ opts...,
+ ),
+ }
+}
+
+// authenticateServiceClient implements AuthenticateServiceClient.
+type authenticateServiceClient struct {
+ preLogin *connect_go.Client[v1.User, v1.ActionReply]
+ login *connect_go.Client[v1.User, v1.LoginReply]
+ logout *connect_go.Client[v1.User, v1.ActionReply]
+}
+
+// PreLogin calls core.v1.AuthenticateService.preLogin.
+func (c *authenticateServiceClient) PreLogin(ctx context.Context, req *connect_go.Request[v1.User]) (*connect_go.Response[v1.ActionReply], error) {
+ return c.preLogin.CallUnary(ctx, req)
+}
+
+// Login calls core.v1.AuthenticateService.login.
+func (c *authenticateServiceClient) Login(ctx context.Context, req *connect_go.Request[v1.User]) (*connect_go.Response[v1.LoginReply], error) {
+ return c.login.CallUnary(ctx, req)
+}
+
+// Logout calls core.v1.AuthenticateService.logout.
+func (c *authenticateServiceClient) Logout(ctx context.Context, req *connect_go.Request[v1.User]) (*connect_go.Response[v1.ActionReply], error) {
+ return c.logout.CallUnary(ctx, req)
+}
+
+// AuthenticateServiceHandler is an implementation of the core.v1.AuthenticateService service.
+type AuthenticateServiceHandler interface {
+ PreLogin(context.Context, *connect_go.Request[v1.User]) (*connect_go.Response[v1.ActionReply], error)
+ Login(context.Context, *connect_go.Request[v1.User]) (*connect_go.Response[v1.LoginReply], error)
+ Logout(context.Context, *connect_go.Request[v1.User]) (*connect_go.Response[v1.ActionReply], error)
+}
+
+// NewAuthenticateServiceHandler builds an HTTP handler from the service implementation. It returns
+// the path on which to mount the handler and the handler itself.
+//
+// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf
+// and JSON codecs. They also support gzip compression.
+func NewAuthenticateServiceHandler(svc AuthenticateServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler) {
+ authenticateServicePreLoginHandler := connect_go.NewUnaryHandler(
+ AuthenticateServicePreLoginProcedure,
+ svc.PreLogin,
+ opts...,
+ )
+ authenticateServiceLoginHandler := connect_go.NewUnaryHandler(
+ AuthenticateServiceLoginProcedure,
+ svc.Login,
+ opts...,
+ )
+ authenticateServiceLogoutHandler := connect_go.NewUnaryHandler(
+ AuthenticateServiceLogoutProcedure,
+ svc.Logout,
+ opts...,
+ )
+ return "/core.v1.AuthenticateService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ switch r.URL.Path {
+ case AuthenticateServicePreLoginProcedure:
+ authenticateServicePreLoginHandler.ServeHTTP(w, r)
+ case AuthenticateServiceLoginProcedure:
+ authenticateServiceLoginHandler.ServeHTTP(w, r)
+ case AuthenticateServiceLogoutProcedure:
+ authenticateServiceLogoutHandler.ServeHTTP(w, r)
+ default:
+ http.NotFound(w, r)
+ }
+ })
+}
+
+// UnimplementedAuthenticateServiceHandler returns CodeUnimplemented from all methods.
+type UnimplementedAuthenticateServiceHandler struct{}
+
+func (UnimplementedAuthenticateServiceHandler) PreLogin(context.Context, *connect_go.Request[v1.User]) (*connect_go.Response[v1.ActionReply], error) {
+ return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("core.v1.AuthenticateService.preLogin is not implemented"))
+}
+
+func (UnimplementedAuthenticateServiceHandler) Login(context.Context, *connect_go.Request[v1.User]) (*connect_go.Response[v1.LoginReply], error) {
+ return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("core.v1.AuthenticateService.login is not implemented"))
+}
+
+func (UnimplementedAuthenticateServiceHandler) Logout(context.Context, *connect_go.Request[v1.User]) (*connect_go.Response[v1.ActionReply], error) {
+ return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("core.v1.AuthenticateService.logout is not implemented"))
+}
diff --git a/auto/connect/greet/v1/greetv1connect/greet.connect.go b/auto/connect/greet/v1/greetv1connect/greet.connect.go
new file mode 100644
index 00000000..c06f8e69
--- /dev/null
+++ b/auto/connect/greet/v1/greetv1connect/greet.connect.go
@@ -0,0 +1,104 @@
+// Code generated by protoc-gen-connect-go. DO NOT EDIT.
+//
+// Source: greet/v1/greet.proto
+
+package greetv1connect
+
+import (
+ context "context"
+ errors "errors"
+ connect_go "github.com/bufbuild/connect-go"
+ v1 "github.com/rocboss/paopao-ce/auto/rpc/greet/v1"
+ http "net/http"
+ strings "strings"
+)
+
+// This is a compile-time assertion to ensure that this generated file and the connect package are
+// compatible. If you get a compiler error that this constant is not defined, this code was
+// generated with a version of connect newer than the one compiled into your binary. You can fix the
+// problem by either regenerating this code with an older version of connect or updating the connect
+// version compiled into your binary.
+const _ = connect_go.IsAtLeastVersion0_1_0
+
+const (
+ // GreetServiceName is the fully-qualified name of the GreetService service.
+ GreetServiceName = "greet.v1.GreetService"
+)
+
+// These constants are the fully-qualified names of the RPCs defined in this package. They're
+// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
+//
+// Note that these are different from the fully-qualified method names used by
+// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to
+// reflection-formatted method names, remove the leading slash and convert the remaining slash to a
+// period.
+const (
+ // GreetServiceGreetProcedure is the fully-qualified name of the GreetService's Greet RPC.
+ GreetServiceGreetProcedure = "/greet.v1.GreetService/Greet"
+)
+
+// GreetServiceClient is a client for the greet.v1.GreetService service.
+type GreetServiceClient interface {
+ Greet(context.Context, *connect_go.Request[v1.GreetRequest]) (*connect_go.Response[v1.GreetResponse], error)
+}
+
+// NewGreetServiceClient constructs a client for the greet.v1.GreetService service. By default, it
+// uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends
+// uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or
+// connect.WithGRPCWeb() options.
+//
+// The URL supplied here should be the base URL for the Connect or gRPC server (for example,
+// http://api.acme.com or https://acme.com/grpc).
+func NewGreetServiceClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) GreetServiceClient {
+ baseURL = strings.TrimRight(baseURL, "/")
+ return &greetServiceClient{
+ greet: connect_go.NewClient[v1.GreetRequest, v1.GreetResponse](
+ httpClient,
+ baseURL+GreetServiceGreetProcedure,
+ opts...,
+ ),
+ }
+}
+
+// greetServiceClient implements GreetServiceClient.
+type greetServiceClient struct {
+ greet *connect_go.Client[v1.GreetRequest, v1.GreetResponse]
+}
+
+// Greet calls greet.v1.GreetService.Greet.
+func (c *greetServiceClient) Greet(ctx context.Context, req *connect_go.Request[v1.GreetRequest]) (*connect_go.Response[v1.GreetResponse], error) {
+ return c.greet.CallUnary(ctx, req)
+}
+
+// GreetServiceHandler is an implementation of the greet.v1.GreetService service.
+type GreetServiceHandler interface {
+ Greet(context.Context, *connect_go.Request[v1.GreetRequest]) (*connect_go.Response[v1.GreetResponse], error)
+}
+
+// NewGreetServiceHandler builds an HTTP handler from the service implementation. It returns the
+// path on which to mount the handler and the handler itself.
+//
+// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf
+// and JSON codecs. They also support gzip compression.
+func NewGreetServiceHandler(svc GreetServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler) {
+ greetServiceGreetHandler := connect_go.NewUnaryHandler(
+ GreetServiceGreetProcedure,
+ svc.Greet,
+ opts...,
+ )
+ return "/greet.v1.GreetService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ switch r.URL.Path {
+ case GreetServiceGreetProcedure:
+ greetServiceGreetHandler.ServeHTTP(w, r)
+ default:
+ http.NotFound(w, r)
+ }
+ })
+}
+
+// UnimplementedGreetServiceHandler returns CodeUnimplemented from all methods.
+type UnimplementedGreetServiceHandler struct{}
+
+func (UnimplementedGreetServiceHandler) Greet(context.Context, *connect_go.Request[v1.GreetRequest]) (*connect_go.Response[v1.GreetResponse], error) {
+ return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("greet.v1.GreetService.Greet is not implemented"))
+}
diff --git a/auto/rpc/core/v1/auth.pb.go b/auto/rpc/core/v1/auth.pb.go
new file mode 100644
index 00000000..c3f6fdae
--- /dev/null
+++ b/auto/rpc/core/v1/auth.pb.go
@@ -0,0 +1,375 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// protoc-gen-go v1.31.0
+// protoc (unknown)
+// source: core/v1/auth.proto
+
+package corev1
+
+import (
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+ reflect "reflect"
+ sync "sync"
+)
+
+const (
+ // Verify that this generated code is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+type User struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ PhoneNum string `protobuf:"bytes,1,opt,name=phone_num,json=phoneNum,proto3" json:"phone_num,omitempty"`
+}
+
+func (x *User) Reset() {
+ *x = User{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_core_v1_auth_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *User) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*User) ProtoMessage() {}
+
+func (x *User) ProtoReflect() protoreflect.Message {
+ mi := &file_core_v1_auth_proto_msgTypes[0]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use User.ProtoReflect.Descriptor instead.
+func (*User) Descriptor() ([]byte, []int) {
+ return file_core_v1_auth_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *User) GetPhoneNum() string {
+ if x != nil {
+ return x.PhoneNum
+ }
+ return ""
+}
+
+type UserVerify struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ PhoneNum string `protobuf:"bytes,1,opt,name=phone_num,json=phoneNum,proto3" json:"phone_num,omitempty"`
+ VerificationCode string `protobuf:"bytes,2,opt,name=verification_code,json=verificationCode,proto3" json:"verification_code,omitempty"`
+}
+
+func (x *UserVerify) Reset() {
+ *x = UserVerify{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_core_v1_auth_proto_msgTypes[1]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *UserVerify) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*UserVerify) ProtoMessage() {}
+
+func (x *UserVerify) ProtoReflect() protoreflect.Message {
+ mi := &file_core_v1_auth_proto_msgTypes[1]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use UserVerify.ProtoReflect.Descriptor instead.
+func (*UserVerify) Descriptor() ([]byte, []int) {
+ return file_core_v1_auth_proto_rawDescGZIP(), []int{1}
+}
+
+func (x *UserVerify) GetPhoneNum() string {
+ if x != nil {
+ return x.PhoneNum
+ }
+ return ""
+}
+
+func (x *UserVerify) GetVerificationCode() string {
+ if x != nil {
+ return x.VerificationCode
+ }
+ return ""
+}
+
+type LoginReply struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ StatusCode int32 `protobuf:"varint,1,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"`
+ Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"`
+}
+
+func (x *LoginReply) Reset() {
+ *x = LoginReply{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_core_v1_auth_proto_msgTypes[2]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *LoginReply) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*LoginReply) ProtoMessage() {}
+
+func (x *LoginReply) ProtoReflect() protoreflect.Message {
+ mi := &file_core_v1_auth_proto_msgTypes[2]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use LoginReply.ProtoReflect.Descriptor instead.
+func (*LoginReply) Descriptor() ([]byte, []int) {
+ return file_core_v1_auth_proto_rawDescGZIP(), []int{2}
+}
+
+func (x *LoginReply) GetStatusCode() int32 {
+ if x != nil {
+ return x.StatusCode
+ }
+ return 0
+}
+
+func (x *LoginReply) GetToken() string {
+ if x != nil {
+ return x.Token
+ }
+ return ""
+}
+
+type ActionReply struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ StatusCode int32 `protobuf:"varint,1,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"`
+}
+
+func (x *ActionReply) Reset() {
+ *x = ActionReply{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_core_v1_auth_proto_msgTypes[3]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ActionReply) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ActionReply) ProtoMessage() {}
+
+func (x *ActionReply) ProtoReflect() protoreflect.Message {
+ mi := &file_core_v1_auth_proto_msgTypes[3]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use ActionReply.ProtoReflect.Descriptor instead.
+func (*ActionReply) Descriptor() ([]byte, []int) {
+ return file_core_v1_auth_proto_rawDescGZIP(), []int{3}
+}
+
+func (x *ActionReply) GetStatusCode() int32 {
+ if x != nil {
+ return x.StatusCode
+ }
+ return 0
+}
+
+var File_core_v1_auth_proto protoreflect.FileDescriptor
+
+var file_core_v1_auth_proto_rawDesc = []byte{
+ 0x0a, 0x12, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x70,
+ 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x22, 0x23, 0x0a,
+ 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x5f, 0x6e,
+ 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e,
+ 0x75, 0x6d, 0x22, 0x56, 0x0a, 0x0a, 0x55, 0x73, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79,
+ 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x01, 0x20,
+ 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x2b, 0x0a,
+ 0x11, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f,
+ 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x22, 0x43, 0x0a, 0x0a, 0x4c, 0x6f,
+ 0x67, 0x69, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74,
+ 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x73,
+ 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b,
+ 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22,
+ 0x2e, 0x0a, 0x0b, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x1f,
+ 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20,
+ 0x01, 0x28, 0x05, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x32,
+ 0xa2, 0x01, 0x0a, 0x13, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65,
+ 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x2f, 0x0a, 0x08, 0x70, 0x72, 0x65, 0x4c, 0x6f,
+ 0x67, 0x69, 0x6e, 0x12, 0x0d, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73,
+ 0x65, 0x72, 0x1a, 0x14, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x2b, 0x0a, 0x05, 0x6c, 0x6f, 0x67, 0x69,
+ 0x6e, 0x12, 0x0d, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72,
+ 0x1a, 0x13, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e,
+ 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x2d, 0x0a, 0x06, 0x6c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x12,
+ 0x0d, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x1a, 0x14,
+ 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52,
+ 0x65, 0x70, 0x6c, 0x79, 0x42, 0x8b, 0x01, 0x0a, 0x0b, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72,
+ 0x65, 0x2e, 0x76, 0x31, 0x42, 0x09, 0x41, 0x75, 0x74, 0x68, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50,
+ 0x01, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x6f,
+ 0x63, 0x62, 0x6f, 0x73, 0x73, 0x2f, 0x70, 0x61, 0x6f, 0x70, 0x61, 0x6f, 0x2d, 0x63, 0x65, 0x2f,
+ 0x61, 0x75, 0x74, 0x6f, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31,
+ 0x3b, 0x63, 0x6f, 0x72, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x58, 0x58, 0xaa, 0x02, 0x07,
+ 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x07, 0x43, 0x6f, 0x72, 0x65, 0x5c, 0x56,
+ 0x31, 0xe2, 0x02, 0x13, 0x43, 0x6f, 0x72, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d,
+ 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x08, 0x43, 0x6f, 0x72, 0x65, 0x3a, 0x3a,
+ 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+}
+
+var (
+ file_core_v1_auth_proto_rawDescOnce sync.Once
+ file_core_v1_auth_proto_rawDescData = file_core_v1_auth_proto_rawDesc
+)
+
+func file_core_v1_auth_proto_rawDescGZIP() []byte {
+ file_core_v1_auth_proto_rawDescOnce.Do(func() {
+ file_core_v1_auth_proto_rawDescData = protoimpl.X.CompressGZIP(file_core_v1_auth_proto_rawDescData)
+ })
+ return file_core_v1_auth_proto_rawDescData
+}
+
+var file_core_v1_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
+var file_core_v1_auth_proto_goTypes = []interface{}{
+ (*User)(nil), // 0: core.v1.User
+ (*UserVerify)(nil), // 1: core.v1.UserVerify
+ (*LoginReply)(nil), // 2: core.v1.LoginReply
+ (*ActionReply)(nil), // 3: core.v1.ActionReply
+}
+var file_core_v1_auth_proto_depIdxs = []int32{
+ 0, // 0: core.v1.AuthenticateService.preLogin:input_type -> core.v1.User
+ 0, // 1: core.v1.AuthenticateService.login:input_type -> core.v1.User
+ 0, // 2: core.v1.AuthenticateService.logout:input_type -> core.v1.User
+ 3, // 3: core.v1.AuthenticateService.preLogin:output_type -> core.v1.ActionReply
+ 2, // 4: core.v1.AuthenticateService.login:output_type -> core.v1.LoginReply
+ 3, // 5: core.v1.AuthenticateService.logout:output_type -> core.v1.ActionReply
+ 3, // [3:6] is the sub-list for method output_type
+ 0, // [0:3] is the sub-list for method input_type
+ 0, // [0:0] is the sub-list for extension type_name
+ 0, // [0:0] is the sub-list for extension extendee
+ 0, // [0:0] is the sub-list for field type_name
+}
+
+func init() { file_core_v1_auth_proto_init() }
+func file_core_v1_auth_proto_init() {
+ if File_core_v1_auth_proto != nil {
+ return
+ }
+ if !protoimpl.UnsafeEnabled {
+ file_core_v1_auth_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*User); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_core_v1_auth_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*UserVerify); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_core_v1_auth_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*LoginReply); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_core_v1_auth_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ActionReply); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ }
+ type x struct{}
+ out := protoimpl.TypeBuilder{
+ File: protoimpl.DescBuilder{
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+ RawDescriptor: file_core_v1_auth_proto_rawDesc,
+ NumEnums: 0,
+ NumMessages: 4,
+ NumExtensions: 0,
+ NumServices: 1,
+ },
+ GoTypes: file_core_v1_auth_proto_goTypes,
+ DependencyIndexes: file_core_v1_auth_proto_depIdxs,
+ MessageInfos: file_core_v1_auth_proto_msgTypes,
+ }.Build()
+ File_core_v1_auth_proto = out.File
+ file_core_v1_auth_proto_rawDesc = nil
+ file_core_v1_auth_proto_goTypes = nil
+ file_core_v1_auth_proto_depIdxs = nil
+}
diff --git a/auto/rpc/core/v1/auth_grpc.pb.go b/auto/rpc/core/v1/auth_grpc.pb.go
new file mode 100644
index 00000000..7cec3d85
--- /dev/null
+++ b/auto/rpc/core/v1/auth_grpc.pb.go
@@ -0,0 +1,183 @@
+// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
+// versions:
+// - protoc-gen-go-grpc v1.3.0
+// - protoc (unknown)
+// source: core/v1/auth.proto
+
+package corev1
+
+import (
+ context "context"
+ grpc "google.golang.org/grpc"
+ codes "google.golang.org/grpc/codes"
+ status "google.golang.org/grpc/status"
+)
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the grpc package it is being compiled against.
+// Requires gRPC-Go v1.32.0 or later.
+const _ = grpc.SupportPackageIsVersion7
+
+const (
+ AuthenticateService_PreLogin_FullMethodName = "/core.v1.AuthenticateService/preLogin"
+ AuthenticateService_Login_FullMethodName = "/core.v1.AuthenticateService/login"
+ AuthenticateService_Logout_FullMethodName = "/core.v1.AuthenticateService/logout"
+)
+
+// AuthenticateServiceClient is the client API for AuthenticateService service.
+//
+// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
+type AuthenticateServiceClient interface {
+ PreLogin(ctx context.Context, in *User, opts ...grpc.CallOption) (*ActionReply, error)
+ Login(ctx context.Context, in *User, opts ...grpc.CallOption) (*LoginReply, error)
+ Logout(ctx context.Context, in *User, opts ...grpc.CallOption) (*ActionReply, error)
+}
+
+type authenticateServiceClient struct {
+ cc grpc.ClientConnInterface
+}
+
+func NewAuthenticateServiceClient(cc grpc.ClientConnInterface) AuthenticateServiceClient {
+ return &authenticateServiceClient{cc}
+}
+
+func (c *authenticateServiceClient) PreLogin(ctx context.Context, in *User, opts ...grpc.CallOption) (*ActionReply, error) {
+ out := new(ActionReply)
+ err := c.cc.Invoke(ctx, AuthenticateService_PreLogin_FullMethodName, in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *authenticateServiceClient) Login(ctx context.Context, in *User, opts ...grpc.CallOption) (*LoginReply, error) {
+ out := new(LoginReply)
+ err := c.cc.Invoke(ctx, AuthenticateService_Login_FullMethodName, in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *authenticateServiceClient) Logout(ctx context.Context, in *User, opts ...grpc.CallOption) (*ActionReply, error) {
+ out := new(ActionReply)
+ err := c.cc.Invoke(ctx, AuthenticateService_Logout_FullMethodName, in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+// AuthenticateServiceServer is the server API for AuthenticateService service.
+// All implementations must embed UnimplementedAuthenticateServiceServer
+// for forward compatibility
+type AuthenticateServiceServer interface {
+ PreLogin(context.Context, *User) (*ActionReply, error)
+ Login(context.Context, *User) (*LoginReply, error)
+ Logout(context.Context, *User) (*ActionReply, error)
+ mustEmbedUnimplementedAuthenticateServiceServer()
+}
+
+// UnimplementedAuthenticateServiceServer must be embedded to have forward compatible implementations.
+type UnimplementedAuthenticateServiceServer struct {
+}
+
+func (UnimplementedAuthenticateServiceServer) PreLogin(context.Context, *User) (*ActionReply, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method PreLogin not implemented")
+}
+func (UnimplementedAuthenticateServiceServer) Login(context.Context, *User) (*LoginReply, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method Login not implemented")
+}
+func (UnimplementedAuthenticateServiceServer) Logout(context.Context, *User) (*ActionReply, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method Logout not implemented")
+}
+func (UnimplementedAuthenticateServiceServer) mustEmbedUnimplementedAuthenticateServiceServer() {}
+
+// UnsafeAuthenticateServiceServer may be embedded to opt out of forward compatibility for this service.
+// Use of this interface is not recommended, as added methods to AuthenticateServiceServer will
+// result in compilation errors.
+type UnsafeAuthenticateServiceServer interface {
+ mustEmbedUnimplementedAuthenticateServiceServer()
+}
+
+func RegisterAuthenticateServiceServer(s grpc.ServiceRegistrar, srv AuthenticateServiceServer) {
+ s.RegisterService(&AuthenticateService_ServiceDesc, srv)
+}
+
+func _AuthenticateService_PreLogin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(User)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(AuthenticateServiceServer).PreLogin(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: AuthenticateService_PreLogin_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(AuthenticateServiceServer).PreLogin(ctx, req.(*User))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _AuthenticateService_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(User)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(AuthenticateServiceServer).Login(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: AuthenticateService_Login_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(AuthenticateServiceServer).Login(ctx, req.(*User))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _AuthenticateService_Logout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(User)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(AuthenticateServiceServer).Logout(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: AuthenticateService_Logout_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(AuthenticateServiceServer).Logout(ctx, req.(*User))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+// AuthenticateService_ServiceDesc is the grpc.ServiceDesc for AuthenticateService service.
+// It's only intended for direct use with grpc.RegisterService,
+// and not to be introspected or modified (even as a copy)
+var AuthenticateService_ServiceDesc = grpc.ServiceDesc{
+ ServiceName: "core.v1.AuthenticateService",
+ HandlerType: (*AuthenticateServiceServer)(nil),
+ Methods: []grpc.MethodDesc{
+ {
+ MethodName: "preLogin",
+ Handler: _AuthenticateService_PreLogin_Handler,
+ },
+ {
+ MethodName: "login",
+ Handler: _AuthenticateService_Login_Handler,
+ },
+ {
+ MethodName: "logout",
+ Handler: _AuthenticateService_Logout_Handler,
+ },
+ },
+ Streams: []grpc.StreamDesc{},
+ Metadata: "core/v1/auth.proto",
+}
diff --git a/auto/rpc/greet/v1/greet.pb.go b/auto/rpc/greet/v1/greet.pb.go
new file mode 100644
index 00000000..ca79b86e
--- /dev/null
+++ b/auto/rpc/greet/v1/greet.pb.go
@@ -0,0 +1,220 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// protoc-gen-go v1.31.0
+// protoc (unknown)
+// source: greet/v1/greet.proto
+
+package greetv1
+
+import (
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+ reflect "reflect"
+ sync "sync"
+)
+
+const (
+ // Verify that this generated code is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+type GreetRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+}
+
+func (x *GreetRequest) Reset() {
+ *x = GreetRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_greet_v1_greet_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *GreetRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*GreetRequest) ProtoMessage() {}
+
+func (x *GreetRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_greet_v1_greet_proto_msgTypes[0]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use GreetRequest.ProtoReflect.Descriptor instead.
+func (*GreetRequest) Descriptor() ([]byte, []int) {
+ return file_greet_v1_greet_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *GreetRequest) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+type GreetResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ Greeting string `protobuf:"bytes,1,opt,name=greeting,proto3" json:"greeting,omitempty"`
+}
+
+func (x *GreetResponse) Reset() {
+ *x = GreetResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_greet_v1_greet_proto_msgTypes[1]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *GreetResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*GreetResponse) ProtoMessage() {}
+
+func (x *GreetResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_greet_v1_greet_proto_msgTypes[1]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use GreetResponse.ProtoReflect.Descriptor instead.
+func (*GreetResponse) Descriptor() ([]byte, []int) {
+ return file_greet_v1_greet_proto_rawDescGZIP(), []int{1}
+}
+
+func (x *GreetResponse) GetGreeting() string {
+ if x != nil {
+ return x.Greeting
+ }
+ return ""
+}
+
+var File_greet_v1_greet_proto protoreflect.FileDescriptor
+
+var file_greet_v1_greet_proto_rawDesc = []byte{
+ 0x0a, 0x14, 0x67, 0x72, 0x65, 0x65, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x72, 0x65, 0x65, 0x74,
+ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x67, 0x72, 0x65, 0x65, 0x74, 0x2e, 0x76, 0x31,
+ 0x22, 0x22, 0x0a, 0x0c, 0x47, 0x72, 0x65, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
+ 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
+ 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x2b, 0x0a, 0x0d, 0x47, 0x72, 0x65, 0x65, 0x74, 0x52, 0x65, 0x73,
+ 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x72, 0x65, 0x65, 0x74, 0x69, 0x6e,
+ 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x67, 0x72, 0x65, 0x65, 0x74, 0x69, 0x6e,
+ 0x67, 0x32, 0x4a, 0x0a, 0x0c, 0x47, 0x72, 0x65, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
+ 0x65, 0x12, 0x3a, 0x0a, 0x05, 0x47, 0x72, 0x65, 0x65, 0x74, 0x12, 0x16, 0x2e, 0x67, 0x72, 0x65,
+ 0x65, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x65, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65,
+ 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x67, 0x72, 0x65, 0x65, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72,
+ 0x65, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x93, 0x01,
+ 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x72, 0x65, 0x65, 0x74, 0x2e, 0x76, 0x31, 0x42, 0x0a,
+ 0x47, 0x72, 0x65, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x67, 0x69,
+ 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x6f, 0x63, 0x62, 0x6f, 0x73, 0x73,
+ 0x2f, 0x70, 0x61, 0x6f, 0x70, 0x61, 0x6f, 0x2d, 0x63, 0x65, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x2f,
+ 0x72, 0x70, 0x63, 0x2f, 0x67, 0x72, 0x65, 0x65, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x67, 0x72, 0x65,
+ 0x65, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x47, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x47, 0x72, 0x65,
+ 0x65, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x08, 0x47, 0x72, 0x65, 0x65, 0x74, 0x5c, 0x56, 0x31,
+ 0xe2, 0x02, 0x14, 0x47, 0x72, 0x65, 0x65, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d,
+ 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x47, 0x72, 0x65, 0x65, 0x74, 0x3a,
+ 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+}
+
+var (
+ file_greet_v1_greet_proto_rawDescOnce sync.Once
+ file_greet_v1_greet_proto_rawDescData = file_greet_v1_greet_proto_rawDesc
+)
+
+func file_greet_v1_greet_proto_rawDescGZIP() []byte {
+ file_greet_v1_greet_proto_rawDescOnce.Do(func() {
+ file_greet_v1_greet_proto_rawDescData = protoimpl.X.CompressGZIP(file_greet_v1_greet_proto_rawDescData)
+ })
+ return file_greet_v1_greet_proto_rawDescData
+}
+
+var file_greet_v1_greet_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
+var file_greet_v1_greet_proto_goTypes = []interface{}{
+ (*GreetRequest)(nil), // 0: greet.v1.GreetRequest
+ (*GreetResponse)(nil), // 1: greet.v1.GreetResponse
+}
+var file_greet_v1_greet_proto_depIdxs = []int32{
+ 0, // 0: greet.v1.GreetService.Greet:input_type -> greet.v1.GreetRequest
+ 1, // 1: greet.v1.GreetService.Greet:output_type -> greet.v1.GreetResponse
+ 1, // [1:2] is the sub-list for method output_type
+ 0, // [0:1] is the sub-list for method input_type
+ 0, // [0:0] is the sub-list for extension type_name
+ 0, // [0:0] is the sub-list for extension extendee
+ 0, // [0:0] is the sub-list for field type_name
+}
+
+func init() { file_greet_v1_greet_proto_init() }
+func file_greet_v1_greet_proto_init() {
+ if File_greet_v1_greet_proto != nil {
+ return
+ }
+ if !protoimpl.UnsafeEnabled {
+ file_greet_v1_greet_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*GreetRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_greet_v1_greet_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*GreetResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ }
+ type x struct{}
+ out := protoimpl.TypeBuilder{
+ File: protoimpl.DescBuilder{
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+ RawDescriptor: file_greet_v1_greet_proto_rawDesc,
+ NumEnums: 0,
+ NumMessages: 2,
+ NumExtensions: 0,
+ NumServices: 1,
+ },
+ GoTypes: file_greet_v1_greet_proto_goTypes,
+ DependencyIndexes: file_greet_v1_greet_proto_depIdxs,
+ MessageInfos: file_greet_v1_greet_proto_msgTypes,
+ }.Build()
+ File_greet_v1_greet_proto = out.File
+ file_greet_v1_greet_proto_rawDesc = nil
+ file_greet_v1_greet_proto_goTypes = nil
+ file_greet_v1_greet_proto_depIdxs = nil
+}
diff --git a/auto/rpc/greet/v1/greet_grpc.pb.go b/auto/rpc/greet/v1/greet_grpc.pb.go
new file mode 100644
index 00000000..f1667a54
--- /dev/null
+++ b/auto/rpc/greet/v1/greet_grpc.pb.go
@@ -0,0 +1,109 @@
+// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
+// versions:
+// - protoc-gen-go-grpc v1.3.0
+// - protoc (unknown)
+// source: greet/v1/greet.proto
+
+package greetv1
+
+import (
+ context "context"
+ grpc "google.golang.org/grpc"
+ codes "google.golang.org/grpc/codes"
+ status "google.golang.org/grpc/status"
+)
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the grpc package it is being compiled against.
+// Requires gRPC-Go v1.32.0 or later.
+const _ = grpc.SupportPackageIsVersion7
+
+const (
+ GreetService_Greet_FullMethodName = "/greet.v1.GreetService/Greet"
+)
+
+// GreetServiceClient is the client API for GreetService service.
+//
+// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
+type GreetServiceClient interface {
+ Greet(ctx context.Context, in *GreetRequest, opts ...grpc.CallOption) (*GreetResponse, error)
+}
+
+type greetServiceClient struct {
+ cc grpc.ClientConnInterface
+}
+
+func NewGreetServiceClient(cc grpc.ClientConnInterface) GreetServiceClient {
+ return &greetServiceClient{cc}
+}
+
+func (c *greetServiceClient) Greet(ctx context.Context, in *GreetRequest, opts ...grpc.CallOption) (*GreetResponse, error) {
+ out := new(GreetResponse)
+ err := c.cc.Invoke(ctx, GreetService_Greet_FullMethodName, in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+// GreetServiceServer is the server API for GreetService service.
+// All implementations must embed UnimplementedGreetServiceServer
+// for forward compatibility
+type GreetServiceServer interface {
+ Greet(context.Context, *GreetRequest) (*GreetResponse, error)
+ mustEmbedUnimplementedGreetServiceServer()
+}
+
+// UnimplementedGreetServiceServer must be embedded to have forward compatible implementations.
+type UnimplementedGreetServiceServer struct {
+}
+
+func (UnimplementedGreetServiceServer) Greet(context.Context, *GreetRequest) (*GreetResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method Greet not implemented")
+}
+func (UnimplementedGreetServiceServer) mustEmbedUnimplementedGreetServiceServer() {}
+
+// UnsafeGreetServiceServer may be embedded to opt out of forward compatibility for this service.
+// Use of this interface is not recommended, as added methods to GreetServiceServer will
+// result in compilation errors.
+type UnsafeGreetServiceServer interface {
+ mustEmbedUnimplementedGreetServiceServer()
+}
+
+func RegisterGreetServiceServer(s grpc.ServiceRegistrar, srv GreetServiceServer) {
+ s.RegisterService(&GreetService_ServiceDesc, srv)
+}
+
+func _GreetService_Greet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(GreetRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(GreetServiceServer).Greet(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: GreetService_Greet_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(GreetServiceServer).Greet(ctx, req.(*GreetRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+// GreetService_ServiceDesc is the grpc.ServiceDesc for GreetService service.
+// It's only intended for direct use with grpc.RegisterService,
+// and not to be introspected or modified (even as a copy)
+var GreetService_ServiceDesc = grpc.ServiceDesc{
+ ServiceName: "greet.v1.GreetService",
+ HandlerType: (*GreetServiceServer)(nil),
+ Methods: []grpc.MethodDesc{
+ {
+ MethodName: "Greet",
+ Handler: _GreetService_Greet_Handler,
+ },
+ },
+ Streams: []grpc.StreamDesc{},
+ Metadata: "greet/v1/greet.proto",
+}
diff --git a/auto/rpc/v1/auth.pb.go b/auto/rpc/v1/auth.pb.go
deleted file mode 100644
index ab5109a6..00000000
--- a/auto/rpc/v1/auth.pb.go
+++ /dev/null
@@ -1,371 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// versions:
-// protoc-gen-go v1.28.1
-// protoc (unknown)
-// source: v1/auth.proto
-
-package v1
-
-import (
- protoreflect "google.golang.org/protobuf/reflect/protoreflect"
- protoimpl "google.golang.org/protobuf/runtime/protoimpl"
- reflect "reflect"
- sync "sync"
-)
-
-const (
- // Verify that this generated code is sufficiently up-to-date.
- _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
- // Verify that runtime/protoimpl is sufficiently up-to-date.
- _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
-)
-
-type User struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- PhoneNum string `protobuf:"bytes,1,opt,name=phoneNum,proto3" json:"phoneNum,omitempty"`
-}
-
-func (x *User) Reset() {
- *x = User{}
- if protoimpl.UnsafeEnabled {
- mi := &file_v1_auth_proto_msgTypes[0]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *User) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*User) ProtoMessage() {}
-
-func (x *User) ProtoReflect() protoreflect.Message {
- mi := &file_v1_auth_proto_msgTypes[0]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use User.ProtoReflect.Descriptor instead.
-func (*User) Descriptor() ([]byte, []int) {
- return file_v1_auth_proto_rawDescGZIP(), []int{0}
-}
-
-func (x *User) GetPhoneNum() string {
- if x != nil {
- return x.PhoneNum
- }
- return ""
-}
-
-type UserVerify struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- PhoneNum string `protobuf:"bytes,1,opt,name=phoneNum,proto3" json:"phoneNum,omitempty"`
- VerificationCode string `protobuf:"bytes,2,opt,name=VerificationCode,proto3" json:"VerificationCode,omitempty"`
-}
-
-func (x *UserVerify) Reset() {
- *x = UserVerify{}
- if protoimpl.UnsafeEnabled {
- mi := &file_v1_auth_proto_msgTypes[1]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *UserVerify) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*UserVerify) ProtoMessage() {}
-
-func (x *UserVerify) ProtoReflect() protoreflect.Message {
- mi := &file_v1_auth_proto_msgTypes[1]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use UserVerify.ProtoReflect.Descriptor instead.
-func (*UserVerify) Descriptor() ([]byte, []int) {
- return file_v1_auth_proto_rawDescGZIP(), []int{1}
-}
-
-func (x *UserVerify) GetPhoneNum() string {
- if x != nil {
- return x.PhoneNum
- }
- return ""
-}
-
-func (x *UserVerify) GetVerificationCode() string {
- if x != nil {
- return x.VerificationCode
- }
- return ""
-}
-
-type LoginReply struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- StatuCode int32 `protobuf:"varint,1,opt,name=statuCode,proto3" json:"statuCode,omitempty"`
- Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"`
-}
-
-func (x *LoginReply) Reset() {
- *x = LoginReply{}
- if protoimpl.UnsafeEnabled {
- mi := &file_v1_auth_proto_msgTypes[2]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *LoginReply) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*LoginReply) ProtoMessage() {}
-
-func (x *LoginReply) ProtoReflect() protoreflect.Message {
- mi := &file_v1_auth_proto_msgTypes[2]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use LoginReply.ProtoReflect.Descriptor instead.
-func (*LoginReply) Descriptor() ([]byte, []int) {
- return file_v1_auth_proto_rawDescGZIP(), []int{2}
-}
-
-func (x *LoginReply) GetStatuCode() int32 {
- if x != nil {
- return x.StatuCode
- }
- return 0
-}
-
-func (x *LoginReply) GetToken() string {
- if x != nil {
- return x.Token
- }
- return ""
-}
-
-type ActionReply struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- StatusCode int32 `protobuf:"varint,1,opt,name=statusCode,proto3" json:"statusCode,omitempty"`
-}
-
-func (x *ActionReply) Reset() {
- *x = ActionReply{}
- if protoimpl.UnsafeEnabled {
- mi := &file_v1_auth_proto_msgTypes[3]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *ActionReply) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*ActionReply) ProtoMessage() {}
-
-func (x *ActionReply) ProtoReflect() protoreflect.Message {
- mi := &file_v1_auth_proto_msgTypes[3]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use ActionReply.ProtoReflect.Descriptor instead.
-func (*ActionReply) Descriptor() ([]byte, []int) {
- return file_v1_auth_proto_rawDescGZIP(), []int{3}
-}
-
-func (x *ActionReply) GetStatusCode() int32 {
- if x != nil {
- return x.StatusCode
- }
- return 0
-}
-
-var File_v1_auth_proto protoreflect.FileDescriptor
-
-var file_v1_auth_proto_rawDesc = []byte{
- 0x0a, 0x0d, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
- 0x04, 0x61, 0x75, 0x74, 0x68, 0x22, 0x22, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1a, 0x0a,
- 0x08, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
- 0x08, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x22, 0x54, 0x0a, 0x0a, 0x55, 0x73, 0x65,
- 0x72, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x68, 0x6f, 0x6e, 0x65,
- 0x4e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x68, 0x6f, 0x6e, 0x65,
- 0x4e, 0x75, 0x6d, 0x12, 0x2a, 0x0a, 0x10, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74,
- 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x56,
- 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x22,
- 0x40, 0x0a, 0x0a, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x1c, 0x0a,
- 0x09, 0x73, 0x74, 0x61, 0x74, 0x75, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
- 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x75, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74,
- 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65,
- 0x6e, 0x22, 0x2d, 0x0a, 0x0b, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79,
- 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01,
- 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65,
- 0x32, 0x89, 0x01, 0x0a, 0x0c, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74,
- 0x65, 0x12, 0x29, 0x0a, 0x08, 0x70, 0x72, 0x65, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x0a, 0x2e,
- 0x61, 0x75, 0x74, 0x68, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x1a, 0x11, 0x2e, 0x61, 0x75, 0x74, 0x68,
- 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x25, 0x0a, 0x05,
- 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x0a, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x55, 0x73, 0x65,
- 0x72, 0x1a, 0x10, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65,
- 0x70, 0x6c, 0x79, 0x12, 0x27, 0x0a, 0x06, 0x6c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x12, 0x0a, 0x2e,
- 0x61, 0x75, 0x74, 0x68, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x1a, 0x11, 0x2e, 0x61, 0x75, 0x74, 0x68,
- 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x42, 0x6f, 0x0a, 0x08,
- 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x42, 0x09, 0x41, 0x75, 0x74, 0x68, 0x50, 0x72,
- 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
- 0x6d, 0x2f, 0x72, 0x6f, 0x63, 0x62, 0x6f, 0x73, 0x73, 0x2f, 0x70, 0x61, 0x6f, 0x70, 0x61, 0x6f,
- 0x2d, 0x63, 0x65, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0xa2,
- 0x02, 0x03, 0x41, 0x58, 0x58, 0xaa, 0x02, 0x04, 0x41, 0x75, 0x74, 0x68, 0xca, 0x02, 0x04, 0x41,
- 0x75, 0x74, 0x68, 0xe2, 0x02, 0x10, 0x41, 0x75, 0x74, 0x68, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65,
- 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x04, 0x41, 0x75, 0x74, 0x68, 0x62, 0x06, 0x70,
- 0x72, 0x6f, 0x74, 0x6f, 0x33,
-}
-
-var (
- file_v1_auth_proto_rawDescOnce sync.Once
- file_v1_auth_proto_rawDescData = file_v1_auth_proto_rawDesc
-)
-
-func file_v1_auth_proto_rawDescGZIP() []byte {
- file_v1_auth_proto_rawDescOnce.Do(func() {
- file_v1_auth_proto_rawDescData = protoimpl.X.CompressGZIP(file_v1_auth_proto_rawDescData)
- })
- return file_v1_auth_proto_rawDescData
-}
-
-var file_v1_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
-var file_v1_auth_proto_goTypes = []interface{}{
- (*User)(nil), // 0: auth.User
- (*UserVerify)(nil), // 1: auth.UserVerify
- (*LoginReply)(nil), // 2: auth.LoginReply
- (*ActionReply)(nil), // 3: auth.ActionReply
-}
-var file_v1_auth_proto_depIdxs = []int32{
- 0, // 0: auth.Authenticate.preLogin:input_type -> auth.User
- 0, // 1: auth.Authenticate.login:input_type -> auth.User
- 0, // 2: auth.Authenticate.logout:input_type -> auth.User
- 3, // 3: auth.Authenticate.preLogin:output_type -> auth.ActionReply
- 2, // 4: auth.Authenticate.login:output_type -> auth.LoginReply
- 3, // 5: auth.Authenticate.logout:output_type -> auth.ActionReply
- 3, // [3:6] is the sub-list for method output_type
- 0, // [0:3] is the sub-list for method input_type
- 0, // [0:0] is the sub-list for extension type_name
- 0, // [0:0] is the sub-list for extension extendee
- 0, // [0:0] is the sub-list for field type_name
-}
-
-func init() { file_v1_auth_proto_init() }
-func file_v1_auth_proto_init() {
- if File_v1_auth_proto != nil {
- return
- }
- if !protoimpl.UnsafeEnabled {
- file_v1_auth_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*User); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_v1_auth_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*UserVerify); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_v1_auth_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*LoginReply); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_v1_auth_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*ActionReply); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- }
- type x struct{}
- out := protoimpl.TypeBuilder{
- File: protoimpl.DescBuilder{
- GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
- RawDescriptor: file_v1_auth_proto_rawDesc,
- NumEnums: 0,
- NumMessages: 4,
- NumExtensions: 0,
- NumServices: 1,
- },
- GoTypes: file_v1_auth_proto_goTypes,
- DependencyIndexes: file_v1_auth_proto_depIdxs,
- MessageInfos: file_v1_auth_proto_msgTypes,
- }.Build()
- File_v1_auth_proto = out.File
- file_v1_auth_proto_rawDesc = nil
- file_v1_auth_proto_goTypes = nil
- file_v1_auth_proto_depIdxs = nil
-}
diff --git a/auto/rpc/v1/auth_grpc.pb.go b/auto/rpc/v1/auth_grpc.pb.go
deleted file mode 100644
index 64fdc1d1..00000000
--- a/auto/rpc/v1/auth_grpc.pb.go
+++ /dev/null
@@ -1,177 +0,0 @@
-// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
-// versions:
-// - protoc-gen-go-grpc v1.2.0
-// - protoc (unknown)
-// source: v1/auth.proto
-
-package v1
-
-import (
- context "context"
- grpc "google.golang.org/grpc"
- codes "google.golang.org/grpc/codes"
- status "google.golang.org/grpc/status"
-)
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the grpc package it is being compiled against.
-// Requires gRPC-Go v1.32.0 or later.
-const _ = grpc.SupportPackageIsVersion7
-
-// AuthenticateClient is the client API for Authenticate service.
-//
-// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
-type AuthenticateClient interface {
- PreLogin(ctx context.Context, in *User, opts ...grpc.CallOption) (*ActionReply, error)
- Login(ctx context.Context, in *User, opts ...grpc.CallOption) (*LoginReply, error)
- Logout(ctx context.Context, in *User, opts ...grpc.CallOption) (*ActionReply, error)
-}
-
-type authenticateClient struct {
- cc grpc.ClientConnInterface
-}
-
-func NewAuthenticateClient(cc grpc.ClientConnInterface) AuthenticateClient {
- return &authenticateClient{cc}
-}
-
-func (c *authenticateClient) PreLogin(ctx context.Context, in *User, opts ...grpc.CallOption) (*ActionReply, error) {
- out := new(ActionReply)
- err := c.cc.Invoke(ctx, "/auth.Authenticate/preLogin", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *authenticateClient) Login(ctx context.Context, in *User, opts ...grpc.CallOption) (*LoginReply, error) {
- out := new(LoginReply)
- err := c.cc.Invoke(ctx, "/auth.Authenticate/login", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *authenticateClient) Logout(ctx context.Context, in *User, opts ...grpc.CallOption) (*ActionReply, error) {
- out := new(ActionReply)
- err := c.cc.Invoke(ctx, "/auth.Authenticate/logout", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-// AuthenticateServer is the server API for Authenticate service.
-// All implementations must embed UnimplementedAuthenticateServer
-// for forward compatibility
-type AuthenticateServer interface {
- PreLogin(context.Context, *User) (*ActionReply, error)
- Login(context.Context, *User) (*LoginReply, error)
- Logout(context.Context, *User) (*ActionReply, error)
- mustEmbedUnimplementedAuthenticateServer()
-}
-
-// UnimplementedAuthenticateServer must be embedded to have forward compatible implementations.
-type UnimplementedAuthenticateServer struct {
-}
-
-func (UnimplementedAuthenticateServer) PreLogin(context.Context, *User) (*ActionReply, error) {
- return nil, status.Errorf(codes.Unimplemented, "method PreLogin not implemented")
-}
-func (UnimplementedAuthenticateServer) Login(context.Context, *User) (*LoginReply, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Login not implemented")
-}
-func (UnimplementedAuthenticateServer) Logout(context.Context, *User) (*ActionReply, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Logout not implemented")
-}
-func (UnimplementedAuthenticateServer) mustEmbedUnimplementedAuthenticateServer() {}
-
-// UnsafeAuthenticateServer may be embedded to opt out of forward compatibility for this service.
-// Use of this interface is not recommended, as added methods to AuthenticateServer will
-// result in compilation errors.
-type UnsafeAuthenticateServer interface {
- mustEmbedUnimplementedAuthenticateServer()
-}
-
-func RegisterAuthenticateServer(s grpc.ServiceRegistrar, srv AuthenticateServer) {
- s.RegisterService(&Authenticate_ServiceDesc, srv)
-}
-
-func _Authenticate_PreLogin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(User)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(AuthenticateServer).PreLogin(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/auth.Authenticate/preLogin",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(AuthenticateServer).PreLogin(ctx, req.(*User))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Authenticate_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(User)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(AuthenticateServer).Login(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/auth.Authenticate/login",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(AuthenticateServer).Login(ctx, req.(*User))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Authenticate_Logout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(User)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(AuthenticateServer).Logout(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/auth.Authenticate/logout",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(AuthenticateServer).Logout(ctx, req.(*User))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-// Authenticate_ServiceDesc is the grpc.ServiceDesc for Authenticate service.
-// It's only intended for direct use with grpc.RegisterService,
-// and not to be introspected or modified (even as a copy)
-var Authenticate_ServiceDesc = grpc.ServiceDesc{
- ServiceName: "auth.Authenticate",
- HandlerType: (*AuthenticateServer)(nil),
- Methods: []grpc.MethodDesc{
- {
- MethodName: "preLogin",
- Handler: _Authenticate_PreLogin_Handler,
- },
- {
- MethodName: "login",
- Handler: _Authenticate_Login_Handler,
- },
- {
- MethodName: "logout",
- Handler: _Authenticate_Logout_Handler,
- },
- },
- Streams: []grpc.StreamDesc{},
- Metadata: "v1/auth.proto",
-}
diff --git a/buf.gen.yaml b/buf.gen.yaml
index bf9ba452..5de35a1f 100644
--- a/buf.gen.yaml
+++ b/buf.gen.yaml
@@ -14,3 +14,6 @@ plugins:
opt:
- paths=source_relative
- require_unimplemented_servers=true
+ - plugin: connect-go
+ out: auto/connect
+ opt: paths=source_relative
diff --git a/build-image.sh b/build-image.sh
new file mode 100755
index 00000000..dba722d3
--- /dev/null
+++ b/build-image.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+# eg.1 : sh build-image.sh
+# eg.2, set image: sh build-image.sh bitbus/paopao-ce
+
+VERSION=`git describe --tags --always | cut -f1 -f2 -d "-"` # eg.: 0.2.5
+IMAGE="bitbus/paopao-ce"
+
+if [ -n "$1" ]; then
+ IMAGE="$1"
+fi
+if [ -n "$2" ]; then
+ VERSION="$2"
+fi
+
+# build image
+docker buildx build \
+ --build-arg USE_DIST="yes" \
+ --tag "$IMAGE:${VERSION}" \
+ --tag "$IMAGE:latest" \
+ . -f Dockerfile
+
+# push to image rep
+# if [ -n "$1" ]; then
+# docker push "$IMAGE:${VERSION}"
+# docker push "$IMAGE:latest"
+# fi
diff --git a/build-release.sh b/build-release.sh
new file mode 100755
index 00000000..9530c07f
--- /dev/null
+++ b/build-release.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+# eg.1 : sh build-image.sh
+# eg.2, set tags: sh build-image.sh 'embed go_json'
+
+TAGS='embed go_json'
+
+if [ -n "$1" ]; then
+ TAGS="$1"
+fi
+
+make release CGO_ENABLED=0 TAGS="$TAGS"
diff --git a/config.yaml.sample b/config.yaml.sample
index ec33d9eb..0617a717 100644
--- a/config.yaml.sample
+++ b/config.yaml.sample
@@ -8,23 +8,23 @@ App: # APP基础设置项
Server: # 服务设置
RunMode: debug
HttpIp: 0.0.0.0
- HttpPort: 8008
+ HttpPort: 8010
ReadTimeout: 60
WriteTimeout: 60
Features:
- Default: ["Base", "MySQL", "Option", "Zinc", "LocalOSS", "LoggerFile", "Friendship", "Deprecated"]
+ Default: ["Web", "Frontend:EmbedWeb", "Zinc", "LocalOSS", "MySQL", "BigCacheIndex", "LoggerZinc", "Friendship"]
Develop: ["Base", "MySQL", "BigCacheIndex", "Meili", "Sms", "AliOSS", "LoggerMeili", "OSS:Retention"]
Demo: ["Base", "MySQL", "Option", "Zinc", "Sms", "MinIO", "LoggerZinc", "Migration"]
Slim: ["Base", "Sqlite3", "LocalOSS", "LoggerFile", "OSS:TempDir"]
Base: ["Redis", "PhoneBind"]
Docs: ["Docs:OpenAPI"]
Deprecated: ["Deprecated:OldWeb"]
- Service: ["Web", "Admin", "SpaceX", "Bot", "LocalOSS", "Mobile", "Frontend:Web", "Fronetend:EmbedWeb", "Docs"]
+ Service: ["Web", "Admin", "SpaceX", "Bot", "LocalOSS", "Mobile", "Frontend:Web", "Frontend:EmbedWeb", "Docs"]
Option: ["SimpleCacheIndex"]
Sms: "SmsJuhe"
WebServer: # Web服务
HttpIp: 0.0.0.0
- HttpPort: 8010
+ HttpPort: 8008
ReadTimeout: 60
WriteTimeout: 60
AdminServer: # Admin后台运维服务
@@ -84,7 +84,7 @@ BigCacheIndex: # 使用BigCache缓存泡泡广场消息流
Logger: # 日志通用配置
Level: debug # 日志级别 panic|fatal|error|warn|info|debug|trace
LoggerFile: # 使用File写日志
- SavePath: data/paopao-ce/logs
+ SavePath: custom/data/paopao-ce/logs
FileName: app
FileExt: .log
LoggerZinc: # 使用Zinc写日志
@@ -154,7 +154,7 @@ S3: # Amazon S3 存储配置
Bucket: paopao
Domain:
LocalOSS: # 本地文件OSS存储配置
- SavePath: data/paopao-ce/oss
+ SavePath: custom/data/paopao-ce/oss
Secure: False
Bucket: paopao
Domain: 127.0.0.1:8008
@@ -179,9 +179,8 @@ Postgres: # PostgreSQL数据库
SSLMode: disable
TimeZone: Asia/Shanghai
Sqlite3: # Sqlite3数据库
- Path: data/sqlite3/paopao-ce.db
+ Path: custom/data/sqlite3/paopao-ce.db
Redis:
- Host: redis:6379
- Password:
- DB:
+ InitAddress:
+ - redis:6379
\ No newline at end of file
diff --git a/default.pgo b/default.pgo
new file mode 100644
index 00000000..a4f2bc98
Binary files /dev/null and b/default.pgo differ
diff --git a/deployed-sites.md b/deployed-sites.md
new file mode 100644
index 00000000..a5ea4e8d
--- /dev/null
+++ b/deployed-sites.md
@@ -0,0 +1,9 @@
+## 部署站点
+PaoPao部署站点信息。
+
+| 名称 | 网址 | 站长 | 备注 |
+| ----- | ----- | ----- | ----- |
+|泡泡|[www.paopao.info](https://www.paopao.info)|[ROC](https://www.paopao.info/#/user?username=roc 'roc(@paopao.info)')|PaoPao官方站点|
+|布里塔|[bulita.cn](https://bulita.cn)|[chendong](https://www.paopao.info/#/user?username=chendong 'chendong(@paopao.info)')|招聘求职等信息|
+|提示词社区|[promptser.cn](https://promptser.cn)|[henryspace](https://paopao.info/#/user?username=henryspace 'henryspace(@paopao.info)')|提示词社区|
+|iiBiuBiu|[iibiubiu.com](https://iibiubiu.com)|[北野](https://www.paopao.info/#/user?username=alimy 'alimy(@paopao.info)')|开发、测试备用机,可以体验最新版本paopao-ce|
diff --git a/docker-compose.yaml b/docker-compose.yaml
index d458f94e..45bb0d82 100644
--- a/docker-compose.yaml
+++ b/docker-compose.yaml
@@ -11,9 +11,9 @@ services:
MYSQL_RANDOM_ROOT_PASSWORD: yes
volumes:
- ./scripts/paopao-mysql.sql:/docker-entrypoint-initdb.d/paopao.sql
- - ./data/mysql/data:/var/lib/mysql
+ - ./custom/data/mysql/data:/var/lib/mysql
ports:
- - 127.0.0.1::3306
+ - 3306:3306
networks:
- paopao-network
@@ -28,15 +28,26 @@ services:
# - 9000:9000
# - 9001:9001
# volumes:
- # - ./data/minio/data:/data
+ # - ./custom/data/minio/data:/data
+ # networks:
+ # - paopao-network
+
+ # redis:
+ # image: redis:7.0-alpine
+ # restart: always
+ # ports:
+ # - 6379:6379
# networks:
# - paopao-network
redis:
- image: redis:7.0-alpine
+ image: redis/redis-stack:7.0.6-RC8
restart: always
ports:
- 6379:6379
+ - 8001:8001
+ environment:
+ REDISEARCH_ARGS: "MAXSEARCHRESULTS 5"
networks:
- paopao-network
@@ -47,7 +58,7 @@ services:
ports:
- 4080:4080
volumes:
- - ./data/zinc/data:/data
+ - ./custom/data/zinc/data:/data
environment:
ZINC_FIRST_ADMIN_USER: admin
ZINC_FIRST_ADMIN_PASSWORD: admin
@@ -56,23 +67,24 @@ services:
- paopao-network
# meili:
- # image: getmeili/meilisearch:v0.29.0
+ # image: getmeili/meilisearch:v1.2
# restart: always
# ports:
# - 7700:7700
# volumes:
- # - ./data/meili/data:/meili_data
+ # - ./custom/data/meili/data:/meili_data
# environment:
# - MEILI_MASTER_KEY=paopao-meilisearch
# networks:
# - paopao-network
-
- # # a ui for managing your meilisearch instances
- # uirecord:
- # image: bitriory/uirecord:latest
+
+ # pyroscope:
+ # image: pyroscope/pyroscope:latest
# restart: always
# ports:
- # - 7701:3000
+ # - 4040:4040
+ # command:
+ # - 'server'
# networks:
# - paopao-network
@@ -90,8 +102,7 @@ services:
- paopao-network
backend:
- build:
- context: .
+ image: bitbus/paopao-ce:0.3
restart: always
depends_on:
- db
@@ -100,7 +111,7 @@ services:
# modify below to reflect your custom configure
volumes:
- ./config.yaml.sample:/app/paopao-ce/config.yaml
- - ./data/paopao-ce/data:/app/paopao-ce/data
+ - ./custom:/app/paopao-ce/custom
ports:
- 8008:8008
networks:
diff --git a/docs/deploy/core/001-配置文件说明.md b/docs/deploy/core/001-配置文件说明.md
index b1af7e2b..29282f01 100644
--- a/docs/deploy/core/001-配置文件说明.md
+++ b/docs/deploy/core/001-配置文件说明.md
@@ -56,13 +56,15 @@ release/paopao-ce --no-default-features --features sqlite3,localoss,loggerfile,r
目前支持的功能集合:
| 功能项 | 类别 | 状态 | 备注 |
| ----- | ----- | ----- | ----- |
-|`OldWeb` | 子服务 | 稳定(默认) | 开启旧的Web服务 |
-|`Web` | 子服务 | WIP | 开启Web服务|
+|`Web` | 子服务 | 内测 | 开启Web服务|
|`Admin` | 子服务 | WIP | 开启Admin后台运维服务|
|`SpaceX` | 子服务 | WIP | 开启SpaceX服务|
|`Bot` | 子服务 | WIP | 开启Bot服务|
|`NativeOBS` | 子服务 | WIP | 开启NativeOBS服务|
-|`Deprecated:Web` | 子服务 | 稳定 | Deprecated(关闭) OldWeb服务|
+|`Docs` | 子服务 | WIP | 开启开发者文档服务|
+|`Frontend:Web` | 子服务 | 稳定 | 开启独立前端服务|
+|`Frontend:EmbedWeb` | 子服务 | 稳定 | 开启内嵌于后端Web API服务中的前端服务|
+|`Deprecated:Web` | 子服务 | 稳定 | 开启旧的Web服务|
|`Gorm` | 数据库 | 稳定(默认) | 使用[gorm](https://github.com/go-gorm/gorm)作为数据库的ORM,默认使用 `Gorm` + `MySQL`组合|
|`Sqlx`| 数据库 | WIP | 使用[sqlx](https://github.com/jmoiron/sqlx)作为数据库的ORM|
|`MySQL`| 数据库 | 稳定(默认) | 使用MySQL作为数据库|
@@ -77,7 +79,7 @@ release/paopao-ce --no-default-features --features sqlite3,localoss,loggerfile,r
|`OSS:Retention` | 对象存储 | 内测 |基于对象存储系统的对象过期自动删除特性实现 先创建临时对象再持久化的功能|
|`OSS:TempDir` | 对象存储 | 内测 |基于对象存储系统的对象拷贝/移动特性实现 先创建临时对象再持久化的功能|
|`Redis` | 缓存 | 稳定 | Redis缓存功能 |
-|`SimpleCacheIndex` | 缓存 | 稳定 | 提供简单的 广场推文列表 的缓存功能 |
+|`SimpleCacheIndex` | 缓存 | Deprecated | 提供简单的 广场推文列表 的缓存功能 |
|`BigCacheIndex` | 缓存 | 稳定(推荐) | 使用[BigCache](https://github.com/allegro/bigcache)缓存 广场推文列表,缓存每个用户每一页,简单做到千人千面 |
|`Zinc` | 搜索 | 稳定(推荐) | 基于[Zinc](https://github.com/zinclabs/zinc)搜索引擎提供推文搜索服务 |
|`Meili` | 搜索 | 稳定(推荐) | 基于[Meilisearch](https://github.com/meilisearch/meilisearch)搜索引擎提供推文搜索服务 |
@@ -85,11 +87,65 @@ release/paopao-ce --no-default-features --features sqlite3,localoss,loggerfile,r
|`LoggerFile` | 日志 | 稳定 | 使用文件写日志 |
|`LoggerZinc` | 日志 | 稳定(推荐) | 使用[Zinc](https://github.com/zinclabs/zinc)写日志 |
|`LoggerMeili` | 日志 | 内测 | 使用[Meilisearch](https://github.com/meilisearch/meilisearch)写日志 |
-|`Friendship` | 关系模式 | 内测(默认) | 弱关系好友模式,类似微信朋友圈 |
-|`Followship` | 关系模式 | WIP | 关注者模式,类似Twitter的Follow模式 |
+|[`Friendship`](../../docs/proposal/002-关于Friendship功能项的设计.md) | 关系模式 | 内测 | 弱关系好友模式,类似微信朋友圈 |
+|[`Followship`](../../docs/proposal/003-关于Followship功能项的设计.md) | 关系模式 | WIP | 关注者模式,类似Twitter的Follow模式 |
+|[`Lightship`](../../docs/proposal/011-关于Lightship功能项的设计.md) | 关系模式 | 内测(默认) | 开放模式,所有推文都公开可见 |
|`Alipay` | 支付 | 稳定 | 开启基于[支付宝开放平台](https://open.alipay.com/)的钱包功能 |
|`Sms` | 短信验证 | 稳定 | 开启短信验证码功能,用于手机绑定验证手机是否注册者的;功能如果没有开启,手机绑定时任意短信验证码都可以绑定手机 |
|`Docs:OpenAPI` | 开发文档 | 稳定 | 开启openapi文档功能,提供web api文档说明(visit http://127.0.0.1:8008/docs/openapi) |
|`PhoneBind` | 其他 | 稳定 | 手机绑定功能 |
+|`Web:DisallowUserRegister` | 功能特性 | 稳定 | 不允许用户注册 |
> 功能项状态详情参考 [features-status](../../../features-status.md).
+
+### 按需添加自定义配置
+paopao-ce提供了按需添加配置的机制,paopao-ce在internal/conf/config.yaml中内嵌了一份完整的默认配置,内嵌的默认配置与自定义配置config.yaml在paopao-ce启动时自动进行了配置项合并,自定义的配置(./config.yaml或者./custom/config.yaml)中只需要自定义 运行时 声明Features 的相应配置即可。比如只运行Web 子服务,config.yaml可以只包含如下配置(其他配置使用默认值):
+```yaml
+# file: config.yaml
+
+Features:
+ Default: ["Sqlite3", "Zinc", "LocalOSS", "BigCacheIndex", "Web"]
+WebServer: # Web服务
+ HttpIp: 0.0.0.0
+ HttpPort: 8010
+ ReadTimeout: 60
+ WriteTimeout: 60
+LocalOSS: # 本地文件OSS存储配置
+ SavePath: data/paopao-ce/oss
+ Secure: True
+ Bucket: paopao
+ Domain: api.paopao.info
+Zinc: # Zinc搜索配置
+ Host: 127.0.0.1:4080
+ Index: paopao-data
+ User: admin
+ Password: admin
+ Secure: False
+```
+部署paopao-ce实例时,可以按需自定义配置运行时所需的配置项, 多个实例部署可以使用不同配置项组合,运行不同的子服务,再通过一个统一的 Proxy(Nginx或云端proxy) 将请求桥接到具体的paopao-ce部署实例。
+
+### 多服务同端口运行
+paopao-ce提供的机制是各个子服务(gRPC/RESTful API服务)可以在一个独立端口提供业务服务,也可以多个同类型的子服务(RESTful API服务 或者 gRPC 服务)共享同一个端口提供服务,比如 Web/Admin/Bot 三个子服务在8010端口提供服务, 只需要配置三个子服务的HttpIp/HttpPort为相同值即可:
+```yaml
+# file: config.yaml
+
+Features:
+ Default: ["Sqlite3", "Zinc", "LocalOSS", "BigCacheIndex", "Web", "Admin", "Bot"]
+WebServer: # Web服务
+ HttpIp: 0.0.0.0
+ HttpPort: 8010
+ ReadTimeout: 60
+ WriteTimeout: 60
+AdminServer: # Admin后台运维服务
+ HttpIp: 0.0.0.0
+ HttpPort: 8010
+ ReadTimeout: 60
+ WriteTimeout: 60
+BotServer: # Bot服务
+ HttpIp: 0.0.0.0
+ HttpPort: 8010
+ ReadTimeout: 60
+ WriteTimeout: 60
+
+...
+```
diff --git a/docs/deploy/local/custom/config.yaml b/docs/deploy/local/custom/config.yaml
new file mode 100644
index 00000000..fa9b1b41
--- /dev/null
+++ b/docs/deploy/local/custom/config.yaml
@@ -0,0 +1,30 @@
+Features:
+ Default: ["Sqlite3", "Zinc", "LocalOSS", "LoggerFile", "BigCacheIndex", "Friendship", "Frontend:EmbedWeb", "Web"]
+BigCacheIndex: # 使用BigCache缓存泡泡广场消息流
+ MaxIndexPage: 1024 # 最大缓存页数,必须是2^n, 代表最大同时缓存多少页数据
+ HardMaxCacheSize: 256 # 最大缓存大小(MB),0表示无限制
+WebServer: # Web服务
+ HttpIp: 0.0.0.0
+ HttpPort: 8008
+ ReadTimeout: 60
+ WriteTimeout: 60
+JWT: # 鉴权加密
+ Secret: 18a6413dc4fe394c66345ebe501b2f26
+ Issuer: paopao-api
+ Expire: 86400
+Zinc: # Zinc搜索配置
+ Host: 127.0.0.1:4080
+ Index: paopao-data
+ User: admin
+ Password: admin
+ Secure: False
+LocalOSS: # 本地文件OSS存储配置
+ SavePath: custom/data/oss
+ Secure: True
+ Bucket: paopao
+ Domain: api.alimy.me
+Sqlite3: # Sqlite3数据库
+ Path: custom/data/sqlite3/paopao-ce.db
+Redis:
+ InitAddress:
+ - 127.0.0.1:6379
diff --git a/docs/discuss/README.md b/docs/discuss/README.md
index 3b983ca6..7412cf4a 100644
--- a/docs/discuss/README.md
+++ b/docs/discuss/README.md
@@ -3,3 +3,6 @@
* [0000-讨论样式模版](./0000-讨论样式模版.md "讨论样式模版")
* [0001-FAQs](./0001-FAQs.md "FAQs")
+
+### paopao.info
+关于paopao-ce的交流、反馈,也可以直接在我们官网[paopao.info](https://www.paopao.info)进行,发布动态时记得加上标签`#paopao-ce`或类似主题相关的标签,方便话题查找。欢迎大家在[paopao.info](https://www.paopao.info)畅快愉悦的交流,一起让paopao-ce的用户体验更好、更便捷。
diff --git a/docs/proposal/.proposal.md b/docs/proposal/.proposal.md
index 10a33c29..5b372cd4 100644
--- a/docs/proposal/.proposal.md
+++ b/docs/proposal/.proposal.md
@@ -1,6 +1,6 @@
| 编号 | 作者 | 发表时间 | 变更时间 | 版本 | 状态 |
| ----- | ----- | ----- | ----- | ----- | ----- |
-| 000 | 北野 | 2022-11-04 |2022-11-04 | v1.0| 提议 |
+| YYMMDDHH | 北野 | 2022-11-04 |2022-11-04 | v1.0| 提议 |
## <我是标题>
---- 这里写简要介绍 ----
diff --git a/docs/proposal/003-关于Followship功能项的设计.md b/docs/proposal/22110409-关于Followship功能项的设计.md
similarity index 97%
rename from docs/proposal/003-关于Followship功能项的设计.md
rename to docs/proposal/22110409-关于Followship功能项的设计.md
index 6ccf15c7..4fb4ef4e 100644
--- a/docs/proposal/003-关于Followship功能项的设计.md
+++ b/docs/proposal/22110409-关于Followship功能项的设计.md
@@ -1,6 +1,6 @@
| 编号 | 作者 | 发表时间 | 变更时间 | 版本 | 状态 |
| ----- | ----- | ----- | ----- | ----- | ----- |
-| 003| 北野 | 2022-11-04 | 2022-11-21 | v0.1 | 提议 |
+| 22110409| 北野 | 2022-11-04 | 2022-11-21 | v0.1 | 提议 |
### 关于Followship功能项的设计
Followship是实现类似Twitter Timeline模式**关注者模型**的时间线信息流,广场推文列表的生成将主要与推文时间、用户的关注者相关。Twitter的推文消息流是非常智能的,用户体验也非常好,这得益于其背后的智能推荐算法以及完善的关注者模型体系,当然还有很多其他机制共同作用下的结果。本提按作为一个总纲为paopao-ce引入类似的机制,这将是一个持续完善的缓慢过程,一切都是为了用户体验,用户就是上帝,用户需要什么,paopao-ce就努力提供什么!
diff --git a/docs/proposal/002-关于Friendship功能项的设计.md b/docs/proposal/22110410-关于Friendship功能项的设计.md
similarity index 98%
rename from docs/proposal/002-关于Friendship功能项的设计.md
rename to docs/proposal/22110410-关于Friendship功能项的设计.md
index f0c1a35a..c90b6002 100644
--- a/docs/proposal/002-关于Friendship功能项的设计.md
+++ b/docs/proposal/22110410-关于Friendship功能项的设计.md
@@ -1,6 +1,6 @@
| 编号 | 作者 | 发表时间 | 变更时间 | 版本 | 状态 |
| ----- | ----- | ----- | ----- | ----- | ----- |
-| 002| 北野 | 2022-11-04 | 2023-01-04 | v1.0 | 提议 |
+| 22110410 | 北野 | 2022-11-04 | 2023-01-04 | v1.0 | 提议 |
### Friendship功能项的设计概要
Friendship功能提供好友间分享推文信息的机制,更好的帮助用户建立自己的推文分享小圈子。Friendship本质上想优化的是泡泡广场页面推文列表的生成机制,开启功能后,推文列表只能获取 `公开/私密/好友` 的推文,每个用户都有属于自己的个性化推文列表。在提供个性化推文列表生成机制的同时,好友体系的建立也顺便帮助用户建立自己的个性化有限范围内的灵魂社交小圈子,只有相互间拥有个性化认同感的用户才能互为好友。
diff --git a/docs/proposal/001-关于paopao-ce的设计定位.md b/docs/proposal/22110411-关于paopao-ce的设计定位.md
similarity index 78%
rename from docs/proposal/001-关于paopao-ce的设计定位.md
rename to docs/proposal/22110411-关于paopao-ce的设计定位.md
index 8d11911f..e98e2e3c 100644
--- a/docs/proposal/001-关于paopao-ce的设计定位.md
+++ b/docs/proposal/22110411-关于paopao-ce的设计定位.md
@@ -1,6 +1,6 @@
| 编号 | 作者 | 发表时间 | 变更时间 | 版本 | 状态 |
| ----- | ----- | ----- | ----- | ----- | ----- |
-| 001| 北野 | 2022-11-04 | 2022-12-19 | v1.0 | 提议 |
+| 22110411 | 北野 | 2022-11-04 | 2023-01-13 | v1.1 | 提议 |
## 概述
paopao-ce是一个清新文艺的微社区,提供类似Twiter/微博的推文分享服务。paopao-ce的运营形态有点类似WordPress,只不过WordPress是使用PHP语言开发的博客平台,提供的是博客服务,而paopao-ce提供的是类似Twitter的推文分享服务。paopao-ce 让 **个人或小组织** 可以快速、方便的部署一个提供**推文分享服务**的小站点,在有限范围内形成一个友善的社交小圈子微社区。
@@ -37,6 +37,10 @@ paopao-ce目前支持Redis作为缓存存储引擎提供缓存服务,请参考
paopao-ce在代码实现上采用 **单体架构模式、分层设计、功能模块化**,架构设计上可能略显保守,但是在使用新技术上却非常积极,比如搜索引擎就采用了近来新星[Zinc](https://github.com/zinclabs/zinc) /[Meilisearch](https://github.com/meilisearch/meilisearch),同时也不排斥各种云端服务,包括阿里云、腾讯云、华为云的对象存储服务、关系数据库服务等。paopao-ce始终秉持着 **包容并蓄、能用就上、去繁就简** 的架构思维,努力打造一个能 **稳定运行、代码清晰、功能可扩展** 的开源项目。
![](.assets/006-01.png)
+## 从技术探索角度思考
+IT世界是非常激动人心的,新技术层出不穷,在各自领域大展身手、大放异彩。作为开发者的我们首要目标当然是以产品为核心,不断的优化服务体验,也不吝啬于新技术的采用以达到更好的产品服务质量。新技术或者某种技术本身,是需要一个环境来支撑其运行、演进,脱离实际环境的技术演进,犹如纸上谈兵,实际效果是存疑的。开发者在研究一项(新)技术时,首先当然是知其然,了解其功能特性、适用场景;再而知其所以然,深入了解其设计原理、知悉其存在的局限等;进而知其不以为然,通过实践,找到技术的最适合场景、知悉其不适合的场景,或与其他技术配合使用,扬长避短,发挥各自的最佳效力以解决具体的事务。这些都是技术探索的通用流程,可以看出,一项技术的探索从陌生到一知半解再到了如指掌,需要一个漫长的过程以及一个技术探索的环境。有些技术的探索,确实需要一个具体的环境,才能更好的研究与实践,比如OBS、Search、Recommended discovery亦或各种云服务的使用、k8s的服务部署等,都需要一个具体的环境来进行技术探索。可以说以需求驱动的技术探索,也更能推进技术本身的不断演进。
+说这么多,这就引出了本节所要说的一个观点了,paopao-ce不仅仅是作为一个提供推文分享服务的产品,也能作为一些(新)技术的探索环境。比如OBS(对象存储服务)、推文搜索服务、推文/用户推荐发现服务、广场推文消息流服务等,都可以作为相应技术领域的技术探索环境,从实践中去检验技术的有效性,更好的推进技术的学习、实践、演进。作为开发者/学习者,也能在理论学习与实际环境中实践(新)技术找到一个平衡,更好、更快的掌握一项(新)技术,这也是paopao-ce的另一价值所在。**路漫漫其修远兮,吾将上下而求索**,用我们开发者的话来说,带着 **上下文(环境/需求)** 去探索(新)技术,或能事半功倍、得心应手。
+
## 从人文角度思考
现在的互联网世界已经非常精彩,各种社交媒体平台琳琅满目,使用体验也非常友好。每个社交平台都有自己的运营方式,都有自己的核心用户群体,也有自己的产品灵魂,都在不断的进行生态演进。比如Twitter、微博都已经从最初的推文分享服务演进到一个成熟的传媒平台,注册用户非常庞大,日均访问PV也是一个惊人的数字,这就注定了平台的运营思维是多维度考量均衡的结果,只能做到让用户群体的大多数人用户体验友好,并不能满足所有人的需求。大平台有大平台的运营模式,小站点有小站点的维系空间。对于类似Twitter这样的推文分享服务,paopao-ce提供一种小站点部署模式,采用类似WordPress的运维模式,让 **个人/小组织** 能快速、便捷的拥有一个提供推文分享服务的小站点,以填补那些在大平台下难以享受到的用户体验,享受小圈子内的自由空间。
@@ -71,3 +75,6 @@ paopao-ce在代码实现上采用 **单体架构模式、分层设计、功能
#### v1.0(2022-12-19) - 北野
* 补充部分内容
+
+#### v1.1(2023-01-13) - 北野
+* 补充 从技术探索角度思考 描述
diff --git a/docs/proposal/005-引入go-mir优化后端架构设计.md b/docs/proposal/22112109-引入go-mir优化后端架构设计.md
similarity index 97%
rename from docs/proposal/005-引入go-mir优化后端架构设计.md
rename to docs/proposal/22112109-引入go-mir优化后端架构设计.md
index ae696ca3..5e0b903d 100644
--- a/docs/proposal/005-引入go-mir优化后端架构设计.md
+++ b/docs/proposal/22112109-引入go-mir优化后端架构设计.md
@@ -1,6 +1,6 @@
| 编号 | 作者 | 发表时间 | 变更时间 | 版本 | 状态 |
| ----- | ----- | ----- | ----- | ----- | ----- |
-| 005| 北野 | 2022-11-21 | 2023-01-04 | v1.1 | 提议 |
+| 22112109 | 北野 | 2022-11-21 | 2023-01-04 | v1.1 | 提议 |
### 引入go-mir优化后端架构设计
引入[github.com/alimy/mir/v3](https://github.com/alimy/mir)优化后端的架构设计,使得后端代码更具扩展型。
diff --git a/docs/proposal/006-关于paopao-ce的结构设计.md b/docs/proposal/22112309-关于paopao-ce的结构设计.md
similarity index 98%
rename from docs/proposal/006-关于paopao-ce的结构设计.md
rename to docs/proposal/22112309-关于paopao-ce的结构设计.md
index 3f3c8ed8..c418fb74 100644
--- a/docs/proposal/006-关于paopao-ce的结构设计.md
+++ b/docs/proposal/22112309-关于paopao-ce的结构设计.md
@@ -1,6 +1,6 @@
| 编号 | 作者 | 发表时间 | 变更时间 | 版本 | 状态 |
| ----- | ----- | ----- | ----- | ----- | ----- |
-| 006| 北野 | 2022-11-23 | 2022-01-01 | v1.0 | 提议 |
+| 22112309 | 北野 | 2022-11-23 | 2022-01-01 | v1.0 | 提议 |
### 关于paopao-ce的结构设计
本文档主要讨论paopao-ce目前的代码结构,简要清晰的描述一个**API请求**从 **接受解析->逻辑处理->结果响应**的大概路径,帮助开发人员快速了解paopao-ce代码基的基本面,更好的融入paopao-ce的开发中做出PR贡献。
@@ -63,7 +63,9 @@ RESTful服务与gRPC服务各自有擅长的场景,在合适的场景使用最
### 更新记录
#### v0.0(2022-11-23) - 北野
* 初始文档, 先占个位置
+
#### v0.1(2022-12-23) - 北野
* 添加部分内容
+
#### v1.0(2023-01-01) - 北野
* 添加部分内容
diff --git a/docs/proposal/22121409-关于Lightship功能项的设计.md b/docs/proposal/22121409-关于Lightship功能项的设计.md
new file mode 100644
index 00000000..a4063640
--- /dev/null
+++ b/docs/proposal/22121409-关于Lightship功能项的设计.md
@@ -0,0 +1,47 @@
+| 编号 | 作者 | 发表时间 | 变更时间 | 版本 | 状态 |
+| ----- | ----- | ----- | ----- | ----- | ----- |
+| 22121409 | 北野 | 2022-12-14 | 2022-01-09 | v1.1 | 提议 |
+
+### 关于Lightship功能项的设计
+Lightship(开放模式)功能提供完全公开的推文分享服务,有别于[Friendship](002-关于Friendship功能项的设计.md "关于Friendship功能项的设计")、[Followship](003-关于Followship功能项的设计.md "关于Followship功能项的设计"),使用Lightship用户模式部署paopao-ce,用户发布的所有推文都是公开可访问的,广场推文列表展示的是全站所有公开推文的Timeline Tweets。
+
+### 场景
+一般用于非常小的站点,或者推文更新不频繁的站点。
+* 推文更新不频繁站点;
+* 个人推文站点;
+* 单纯想要所有推文公开访问;
+
+### 需求
+* 广场推文列表只展示公开可访问推文;
+* 推文访问权限只能是 `公开/私密`;
+
+### 方案
+
+#### 实现细节
+* 广场推文列表只展示公开可访问推文 - 前端/后端
+* 推文访问权限只能是 `公开/私密` - 前端/后端
+
+#### 参考实现(PR):
+[add Lightship feature support #198](https://github.com/rocboss/paopao-ce/pull/198)
+
+### 疑问
+
+1. 公开模式为什么命名为Lightship?
+Lightship有灯塔的意思,灯塔是为航行船只指明方向的公共设施,这里取其公有设施的属性指喻 开放模式下paopao-ce不需要授权公开访问推 文的意思。
+1. 如何开启这个功能?
+在配置文件config.yaml中的`Features`中添加`Lightship`功能项开启该功能:
+```yaml
+...
+# features中加上 Lightship
+Features:
+ Default: ["Meili", "LoggerMeili", "Base", "Sqlite3", "BigCacheIndex", "MinIO", "Lightship"]
+ Base: ["Redis", "PhoneBind"]
+...
+```
+
+### 更新记录
+#### v1.0(2022-12-14) - 北野
+* 初始文档
+
+#### v1.1(2022-01-09) - 北野
+* 添加参考实现PR信息
diff --git a/docs/proposal/23011309-优化paopao-ce前后端国际化i18n的设计.md b/docs/proposal/23011309-优化paopao-ce前后端国际化i18n的设计.md
new file mode 100644
index 00000000..19c57f1b
--- /dev/null
+++ b/docs/proposal/23011309-优化paopao-ce前后端国际化i18n的设计.md
@@ -0,0 +1,21 @@
+| 编号 | 作者 | 发表时间 | 变更时间 | 版本 | 状态 |
+| ----- | ----- | ----- | ----- | ----- | ----- |
+| 23011309 | 北野 | 2023-01-13 | 2023-01-13 | v0.0 | 提议 |
+
+### 概述
+目前paopao-ce前端/后端 都使用中文提供业务服务,暂时还没有提供国际化i18n机制提供国际化的业务服务。本提按提议提过在前端/后端中引入i8n机制,以提供国际化业务服务。 本提按建立在[012-优化前端运行时配置获取机制的设计](012-优化前端运行时配置获取机制的设计.md)基础之上。
+
+### 需求
+* 提供i18n机制以实现业务服务的国际化 - 前端/后端
+
+### 方案
+TODO;
+
+### 疑问
+
+1. 为什么要提供这种机制?
+TODO;
+
+### 更新记录
+#### v0.0(2023-01-13) - 北野
+* 初始文档, 先占个位置
diff --git a/docs/proposal/23011310-优化前端运行时配置获取机制的设计.md b/docs/proposal/23011310-优化前端运行时配置获取机制的设计.md
new file mode 100644
index 00000000..58d308cc
--- /dev/null
+++ b/docs/proposal/23011310-优化前端运行时配置获取机制的设计.md
@@ -0,0 +1,28 @@
+| 编号 | 作者 | 发表时间 | 变更时间 | 版本 | 状态 |
+| ----- | ----- | ----- | ----- | ----- | ----- |
+| 23011310 | 北野 | 2023-01-13 | 2023-01-13 | v0.0 | 提议 |
+
+### 概述
+目前的Web前端运行时配置是通过编译时配置[.env](../../web/.env)进行静态配置,虽然能满足简单的功能需求,但是非常不灵活。本提按提议一种由paopao-ce后端服务控制的前端运行时配置获取机制,让前端更灵活的依据运行时配置提供产品服务。
+
+### 场景
+前端依据paopao-ce后端服务提供的运行时配置按需提供产品服务,也可以扩展到按用户喜好自定义的配置提供产品服务,比如用户设置的语言、Theme、功能特性等。
+
+### 需求
+* 前端依据运行时配置提供业务服务 - 前端
+* 前端在启动时从paopao-ce后端服务获取运行时配置 - 前端/后端
+* 用户可以自定义前端运行时配置,如语言、Theme、功能特性等 - 前端/后端
+* 用户自定义的前端运行时配置可以 创建/更新 - 前端/后端
+* 后端服务提供默认前端运行时配置 - 后端
+
+### 方案
+TODO;
+
+### 疑问
+
+1. 为什么要提供这种机制?
+TODO;
+
+### 更新记录
+#### v0.0(2023-01-13) - 北野
+* 初始文档, 先占个位置
diff --git a/docs/proposal/23020910-关于paopao-ce引入sqlx与sqlc作为数据逻辑层ORM的构想 copy.md b/docs/proposal/23020910-关于paopao-ce引入sqlx与sqlc作为数据逻辑层ORM的构想 copy.md
new file mode 100644
index 00000000..45f22cc2
--- /dev/null
+++ b/docs/proposal/23020910-关于paopao-ce引入sqlx与sqlc作为数据逻辑层ORM的构想 copy.md
@@ -0,0 +1,21 @@
+| 编号 | 作者 | 发表时间 | 变更时间 | 版本 | 状态 |
+| ----- | ----- | ----- | ----- | ----- | ----- |
+| 23020910| 北野 | 2023-02-09 | 2023-02-09 | v0.0 | 提议 |
+
+### 概述
+TODO;
+
+### 需求
+TODO;
+
+### 方案
+TODO;
+
+### 疑问
+
+1. 为什么要引入sqlx/sqlc?
+TODO;
+
+### 更新记录
+#### v0.0(2023-02-09) - 北野
+* 初始文档, 先占个位置
diff --git a/docs/proposal/23021310-关于paopao-ce引入bcrypt作为用户密码加密算法的设计.md b/docs/proposal/23021310-关于paopao-ce引入bcrypt作为用户密码加密算法的设计.md
new file mode 100644
index 00000000..9e992b54
--- /dev/null
+++ b/docs/proposal/23021310-关于paopao-ce引入bcrypt作为用户密码加密算法的设计.md
@@ -0,0 +1,25 @@
+| 编号 | 作者 | 发表时间 | 变更时间 | 版本 | 状态 |
+| ----- | ----- | ----- | ----- | ----- | ----- |
+| 23021310| 北野 | 2023-02-13 | 2023-02-13 | v0.0 | 提议 |
+
+### 概述
+TODO;
+
+### 需求
+TODO;
+
+### 方案
+TODO;
+
+### 疑问
+
+1. 为什么要引入bcrypt?
+TODO;
+
+### 参考文档
+* [bcrypt](https://github.com/golang/crypto/blob/master/bcrypt/bcrypt.go)
+* [bcrypt module](https://pkg.go.dev/golang.org/x/crypto@v0.6.0/bcrypt)
+
+### 更新记录
+#### v0.0(2023-02-13) - 北野
+* 初始文档, 先占个位置
diff --git a/docs/proposal/23021510-关于使用pyroscope用于性能调试的设计.md b/docs/proposal/23021510-关于使用pyroscope用于性能调试的设计.md
new file mode 100644
index 00000000..5b225dd3
--- /dev/null
+++ b/docs/proposal/23021510-关于使用pyroscope用于性能调试的设计.md
@@ -0,0 +1,53 @@
+| 编号 | 作者 | 发表时间 | 变更时间 | 版本 | 状态 |
+| ----- | ----- | ----- | ----- | ----- | ----- |
+| 23021510| 北野 | 2023-02-15 | 2023-02-16 | v1.1 | 提议 |
+
+### 概述
+Pyroscope 是一个开源的持续性能剖析平台。它能够帮你:
+* 找出源代码中的性能问题和瓶颈
+* 解决 CPU 利用率高的问题
+* 理解应用程序的调用树(call tree)
+* 追踪随一段时间内变化的情况
+
+### 需求
+* 开发环境下启用Pyroscope,但是部署环境下禁用。
+
+### 方案
+#### 设计要点
+* 使用//go:build pyroscope 可选编译app集成Pyroscope功能
+* config.yaml中添加`Pyroscope` 功能来启用Pyroscope
+
+#### 设计细节
+* 参考实现(PR):
+[add Pyroscope support #199](https://github.com/rocboss/paopao-ce/pull/199)
+
+### 疑问
+
+1. 为什么要引入Pyroscope?
+用于开发环境下对paopao-ce进行性能优化。
+
+2. 如何开启这个功能?
+* 构建时将 `pyroscope` 添加到TAGS中:
+ ```sh
+ make run TAGS='pyroscope'
+ ```
+* 在配置文件config.yaml中的`Features`中添加`Pyroscope`功能项开启该功能:
+ ```yaml
+ ...
+ # features中加上 Friendship
+ Features:
+ Default: ["Meili", "LoggerMeili", "Base", "Sqlite3", "BigCacheIndex", "MinIO", "Pyroscope"]
+ Base: ["Redis", "PhoneBind"]
+ ...
+ ```
+
+### 参考文档
+* [pyroscope](https://github.com/pyroscope-io/pyroscope)
+* [pyroscope client](https://github.com/pyroscope-io/client)
+
+### 更新记录
+#### v1.0(2023-02-15) - 北野
+* 初始文档
+
+#### v1.1(2023-02-16) - 北野
+* 添加参考实现
diff --git a/docs/proposal/23040412-关于使用sentry用于错误追踪与性能检测的设计.md b/docs/proposal/23040412-关于使用sentry用于错误追踪与性能检测的设计.md
new file mode 100644
index 00000000..e687de2f
--- /dev/null
+++ b/docs/proposal/23040412-关于使用sentry用于错误追踪与性能检测的设计.md
@@ -0,0 +1,49 @@
+| 编号 | 作者 | 发表时间 | 变更时间 | 版本 | 状态 |
+| ----- | ----- | ----- | ----- | ----- | ----- |
+| 23040412| 北野 | 2023-04-04 | 2023-04-04 | v1.0 | 提议 |
+
+### 概述
+[Sentry](https://github.com/getsentry/sentry) Sentry is a developer-first error tracking and performance monitoring platform that helps developers see what actually matters, solve quicker, and learn continuously about their applications.
+
+### 需求
+* 通过配置文件开启Sentry功能
+
+### 方案
+#### 设计要点
+* config.yaml中添加`Sentry` 功能来启用Sentry功能
+
+#### 设计细节
+* 参考实现(PR):
+[add Sentry feature support #258](https://github.com/rocboss/paopao-ce/pull/258)
+
+### 疑问
+
+1. 为什么要引入Sentry?
+添加一种对paopao-ce的错误追踪与性能检测机制。
+
+2. 如何开启这个功能?
+* 在配置文件config.yaml中的`Features`中添加`Sentry`功能项开启该功能:
+ ```yaml
+ ...
+ # features中加上 Sentry
+ Features:
+ Default: ["Meili", "LoggerMeili", "Base", "Sqlite3", "BigCacheIndex", "MinIO", "Sentry"]
+ Base: ["Redis", "PhoneBind"]
+ Sentry:
+ Sentry: # Sentry配置
+ Dsn: "http://4ea0af5cd88d4512b7e52070506c80ec@localhost:9000/2"
+ Debug: True
+ AttachStacktrace: True
+ TracesSampleRate: 1.0
+ AttachLogrus: True # logrus是否附加到Sentry
+ AttachGin: True # gin是否附加到Sentry
+ ...
+ ```
+
+### 参考文档
+* [sentry](https://github.com/getsentry/sentry)
+* [self-hosted](https://develop.sentry.dev/self-hosted/)
+
+### 更新记录
+#### v1.0(2023-04-04) - 北野
+* 初始文档
diff --git a/docs/proposal/23062120-关于多媒体资源URI信息存储优化.md b/docs/proposal/23062120-关于多媒体资源URI信息存储优化.md
new file mode 100644
index 00000000..31a305f2
--- /dev/null
+++ b/docs/proposal/23062120-关于多媒体资源URI信息存储优化.md
@@ -0,0 +1,30 @@
+| 编号 | 作者 | 发表时间 | 变更时间 | 版本 | 状态 |
+| ----- | ----- | ----- | ----- | ----- | ----- |
+| 23062120| 北野 | 2023-06-21 | 2023-06-21 | v0.1 | 提议 |
+
+### 概述
+目前图片、视频、附件资源的位置信息是使用完整url的形式存储在sql表中,也就是对外可取的url链接,这就造成这些多媒体资源与一个网站的网址进行了
+绑定,如果网站变更网址后,这些媒体资源将访问不了,除非使用原先的网址。
+
+### 需求
+* 变更网址不影响图片、视频、附件资源的获取;
+* 图片、视频、附件资源的存储位置应该对外透明,内部如何存储已经具体的存储位置信息不应该暴露到对外url链接中;
+* 图片、视频、附件资源的存储位置信息在sql表中应该存储为相对地址;
+
+### 方案
+#### 设计要点
+* 图片、视频、附件资源的相对位置信息存储在sql表中;
+* 图片、视频、附件资源的对外url地址采用动态生成的方式,可以采用服务端生成或者客户端生成的方式或者通过api的参数来自定义;
+
+#### 设计细节
+TODO;
+
+### 疑问
+
+1. 为什么要优化?
+解绑网站地址与图片、视频、附件资源的对应关系。
+
+
+### 更新记录
+#### v0.1(2023-06-21) - 北野
+* 初始文档
diff --git a/docs/proposal/23062121-关于Migration的优化.md b/docs/proposal/23062121-关于Migration的优化.md
new file mode 100644
index 00000000..fed6bb05
--- /dev/null
+++ b/docs/proposal/23062121-关于Migration的优化.md
@@ -0,0 +1,25 @@
+| 编号 | 作者 | 发表时间 | 变更时间 | 版本 | 状态 |
+| ----- | ----- | ----- | ----- | ----- | ----- |
+| 23062121| 北野 | 2023-06-21 | 2023-06-21 | v0.1 | 提议 |
+
+### 概述
+数据库表的Migration优化。
+
+### 需求
+TODO;
+
+### 方案
+TODO;
+
+#### 设计细节
+TODO;
+
+### 疑问
+
+1. 为什么要优化?
+TODO;
+
+
+### 更新记录
+#### v0.1(2023-06-21) - 北野
+* 初始文档
diff --git a/docs/proposal/23062905-添加Pprof功能特性用于获取Profile.md b/docs/proposal/23062905-添加Pprof功能特性用于获取Profile.md
new file mode 100644
index 00000000..5763c5a8
--- /dev/null
+++ b/docs/proposal/23062905-添加Pprof功能特性用于获取Profile.md
@@ -0,0 +1,67 @@
+| 编号 | 作者 | 发表时间 | 变更时间 | 版本 | 状态 |
+| ----- | ----- | ----- | ----- | ----- | ----- |
+| 23062905| 北野 | 2023-06-29 | 2023-06-29 | v1.0 | 提议 |
+
+### 概述
+使用net/http/pprof获取Profile信息。添加`Pprof`功能特性用于开启PprofServer服务。
+
+### 需求
+- 只在开发环境下获取profile信息
+- 可以在配置文件中开启获取profile的服务
+
+### 方案
+- 添加`Pprof`功能特性
+- 添加`PprofServer`服务
+
+#### 设计细节
+- 配置文件中添加`PprofServer`项用于配制http server
+- 添加`Pprof`功能特性
+- 添加`PprofServer`服务
+- 使用`//go:build pprof`按需编译profile功能
+- `PprofServer` 不能和其他服务共用一个端口
+
+### 疑问
+
+1. 为什么要添加`pprof`功能特性?
+使用 net/http/pprof 在线获取CPU profile信息,用于 [PGO](https://go.dev/doc/pgo) 编译优化。
+
+2. 如何开启`Pprof`服务?
+* 构建时将 `pprof` 添加到TAGS中:
+ ```sh
+ make run TAGS='pprof'
+ ```
+* 在配置文件config.yaml中的`Features`中添加`Pprof`功能项开启该功能:
+ ```yaml
+ ...
+ # features中加上 Friendship
+ Features:
+ Default: ["Meili", "LoggerMeili", "Base", "Sqlite3", "BigCacheIndex", "MinIO", "Pprof"]
+ Base: ["Redis", "PhoneBind"]
+ ...
+ ```
+
+3. 常见命令
+
+#### Merging profiles
+The pprof tool can merge multiple profiles like this:
+```sh
+$ go tool pprof -proto a.pprof b.pprof > merged.pprof
+```
+This merge is effectively a straightforward sum of samples in the input, regardless of wall duration of the profile. As a result, when profiling a small time slice of an application (e.g., a server that runs indefinitely), you likely want to ensure that all profiles have the same wall duration (i.e., all profiles are collected for 30s). Otherwise, profiles with longer wall duration will be overrepresented in the merged profile.
+
+#### look at a 30-second CPU profile:
+```sh
+go tool pprof http://localhost:6060/debug/pprof/profile?seconds=30
+```
+
+### 参考文档
+* [PGO](https://go.dev/doc/pgo)
+* [net/http/pprof](https://pkg.go.dev/net/http/pprof)
+* [runtime/pprof](https://pkg.go.dev/runtime/pprof)
+
+### 参考实现
+- [#327](https://github.com/rocboss/paopao-ce/pull/327)
+
+### 更新记录
+#### v1.0(2023-06-20) - 北野
+* 初始文档
diff --git a/docs/proposal/23062906-关于开启pgo编译优化.md b/docs/proposal/23062906-关于开启pgo编译优化.md
new file mode 100644
index 00000000..7622c3f4
--- /dev/null
+++ b/docs/proposal/23062906-关于开启pgo编译优化.md
@@ -0,0 +1,38 @@
+| 编号 | 作者 | 发表时间 | 变更时间 | 版本 | 状态 |
+| ----- | ----- | ----- | ----- | ----- | ----- |
+| 23062906| 北野 | 2023-06-29 | 2023-06-29 | v1.0 | 提议 |
+
+### 概述
+Beginning in Go 1.20, the Go compiler supports profile-guided optimization ([PGO](https://go.dev/doc/pgo)) to further optimize builds.
+
+
+### 疑问
+
+1. 为什么要添加`pprof`功能特性?
+使用 net/http/pprof 在线获取CPU profile信息,用于 [PGO](https://go.dev/doc/pgo) 编译优化。
+
+2. 如何开启`pgo`编译优化?
+The standard approach is to store a pprof CPU profile with filename default.pgo in the main package directory of the profiled binary, and build with go build -pgo=auto, which will pick up default.pgo files automatically.
+
+3. 常见命令
+
+#### Merging profiles
+The pprof tool can merge multiple profiles like this:
+```sh
+$ go tool pprof -proto a.pprof b.pprof > default.pgo
+```
+This merge is effectively a straightforward sum of samples in the input, regardless of wall duration of the profile. As a result, when profiling a small time slice of an application (e.g., a server that runs indefinitely), you likely want to ensure that all profiles have the same wall duration (i.e., all profiles are collected for 30s). Otherwise, profiles with longer wall duration will be overrepresented in the merged profile.
+
+#### look at a 30-second CPU profile:
+```sh
+go tool pprof http://localhost:6060/debug/pprof/profile?seconds=30
+```
+
+### 参考文档
+* [PGO](https://go.dev/doc/pgo)
+* [net/http/pprof](https://pkg.go.dev/net/http/pprof)
+* [runtime/pprof](https://pkg.go.dev/runtime/pprof)
+
+### 更新记录
+#### v1.0(2023-06-20) - 北野
+* 初始文档
diff --git a/docs/proposal/README.md b/docs/proposal/README.md
index 12f8096e..2b807a56 100644
--- a/docs/proposal/README.md
+++ b/docs/proposal/README.md
@@ -1,6 +1,6 @@
## Draft
-* [001-关于paopao-ce的设计定位](001-关于paopao-ce的设计定位.md "关于paopao-ce的设计定位")
-* [002-关于Friendship功能项的设计](002-关于Friendship功能项的设计.md "关于Friendship功能项的设计")
-* [003-关于Followship功能项的设计](003-关于Followship功能项的设计.md "关于Followship功能项的设计")
-* [005-引入go-mir优化后端架构设计](005-引入go-mir优化后端架构设计.md "引入go-mir优化后端架构设计")
-* [006-关于paopao-ce的结构设计](006-关于paopao-ce的结构设计.md "关于paopao-ce的结构设计")
+* [22110411-关于paopao-ce的设计定位](22110411-关于paopao-ce的设计定位.md "关于paopao-ce的设计定位")
+* [22110410-关于Friendship功能项的设计](22110410-关于Friendship功能项的设计.md "关于Friendship功能项的设计")
+* [22110409-关于Followship功能项的设计](22110409-关于Followship功能项的设计.md "关于Followship功能项的设计")
+* [22112109-引入go-mir优化后端架构设计](22112109-引入go-mir优化后端架构设计.md "引入go-mir优化后端架构设计")
+* [22112309-关于paopao-ce的结构设计](22112309-关于paopao-ce的结构设计.md "关于paopao-ce的结构设计")
diff --git a/docs/proposal/提案模板.md b/docs/proposal/提案模板.md
index 4d44a79d..29fc7474 100644
--- a/docs/proposal/提案模板.md
+++ b/docs/proposal/提案模板.md
@@ -1,8 +1,8 @@
| 编号 | 作者 | 发表时间 | 变更时间 | 版本 | 状态 |
| ----- | ----- | ----- | ----- | ----- | ----- |
-| <编号000> | <作者> | <发表时间> | <变更时间> | <版本号v1.0> | <提议/提案/决议/冻结> |
+| <编号YYMMDDHH> | <作者> | <发表时间> | <变更时间> | <版本号v1.0> | <提议/提案/决议/冻结> |
-* 编号: 填写提案编号,三位数,比如001。
+* 编号: 填写提案编号,六位数,格式为YYMMDDHH,即:年(后两位)+月+日+时。
* 作者: 填写发表者。
* 发表时间: 填写首次发表时间,之后保持不变。
* 变更时间: 填写变更时间,首次发表时,变更时间和发表时间一样。
diff --git a/features-status.md b/features-status.md
index 8937a2bc..60f17aff 100644
--- a/features-status.md
+++ b/features-status.md
@@ -42,7 +42,7 @@
* `Frontend:EmbedWeb` 开启内嵌于后端Web API服务中的前端服务(目前状态: 内测)
* [ ] 提按文档
* [x] 服务初始化逻辑
-* `Deprecated:OldWeb` 开启旧的Web服务(目前状态: 内测)
+* `Deprecated:OldWeb` 开启旧的Web服务(目前状态: 已弃,不可用)
* [ ] 提按文档
* [x] 服务初始化逻辑
@@ -97,7 +97,7 @@
* [ ] 提按文档
* [x] 接口定义
* [x] 业务逻辑实现
-* `SimpleCacheIndex` 提供简单的 广场推文列表 的缓存功能能;
+* `SimpleCacheIndex` 提供简单的 广场推文列表 的缓存功能能(目前状态: Deprecated);
* [ ] 提按文档
* [x] 接口定义
* [x] 业务逻辑实现
@@ -105,6 +105,10 @@
* [ ] 提按文档
* [x] 接口定义
* [x] 业务逻辑实现
+* `RedisCacheIndex` 使用Redis缓存 广场推文列表,缓存每个用户每一页,简单做到千人千面(目前状态: 内测阶段,推荐使用);
+ * [ ] 提按文档
+ * [x] 接口定义
+ * [x] 业务逻辑实现
#### 搜索:
* `Zinc` 基于[Zinc](https://github.com/zinclabs/zinc)搜索引擎提供推文搜索服务(目前状态: 稳定,推荐使用);
@@ -119,6 +123,7 @@
* [ ] 提按文档
* [ ] 接口定义
* [ ] 业务逻辑实现
+
#### 日志:
* `LoggerFile` 使用文件写日志(目前状态: 稳定);
* [ ] 提按文档
@@ -133,15 +138,25 @@
* [x] 接口定义
* [x] 业务逻辑实现
+#### 监控:
+* `Sentry` 使用Sentry进行错误跟踪与性能监控(目前状态: 内测);
+ * [x] [提按文档](docs/proposal/23040412-关于使用sentry用于错误追踪与性能检测的设计.md)
+ * [x] 接口定义
+ * [x] 业务逻辑实现
+
#### 关系模式:
-* `Friendship` 弱关系好友模式,类似微信朋友圈(目前状态: 开发阶段);
- * [x] 提按文档
+* `Friendship` 弱关系好友模式,类似微信朋友圈(目前状态: 内测);
+ * [x] [提按文档](docs/proposal/22110410-关于Friendship功能项的设计.md)
* [x] 接口定义
* [x] 业务逻辑实现
* `Followship` 关注者模式,类似Twitter的Follow模式(目前状态: WIP);
- * [ ] 提按文档
+ * [ ] [提按文档](docs/proposal/22110409-关于Followship功能项的设计.md)
* [ ] 接口定义
* [ ] 业务逻辑实现
+* `Lightship` 开放模式,所有推文都公开可见(目前状态: 内测、默认);
+ * [x] [提按文档](docs/proposal/22121409-关于Lightship功能项的设计.md)
+ * [x] 接口定义
+ * [x] 业务逻辑实现
### 支付:
* `Alipay` 开启基于[支付宝开放平台](https://open.alipay.com/)的钱包功能;
@@ -160,13 +175,27 @@
* [x] 业务逻辑实现
### 开发文档:
-* `Docs:OpenAPI` 开启openapi文档功能,提供web api文档说明(visit http://127.0.0.1:8008/docs/openapi);
+* `Docs:OpenAPI` 开启openapi文档功能,提供web api文档说明(visit http://127.0.0.1:8008/docs/openapi);
* [ ] 提按文档
* [x] 接口定义
- * [x] 业务逻辑实现
-
+ * [x] 业务逻辑实现
+
+### 性能优化
+* [`Pyroscope`](docs/proposal/23021510-关于使用pyroscope用于性能调试的设计.md) 开启Pyroscope功能用于性能调试(目前状态: 内测);
+ * [x] 提按文档
+ * [x] 业务逻辑实现
+* [`Pprof`](docs/proposal/23062905-添加Pprof功能特性用于获取Profile.md) 开启Pprof功能收集Profile信息(目前状态: 内测);
+ * [x] 提按文档
+ * [x] 业务逻辑实现
+
### 其他:
* `PhoneBind` 手机绑定功能;
* [ ] 提按文档
* [x] 接口定义
- * [x] 业务逻辑实现
+ * [x] 业务逻辑实现
+
+### 功能特性:
+* `Web:DisallowUserRegister` 不允许用户注册;
+ * [ ] 提按文档
+ * [x] 接口定义
+ * [x] 业务逻辑实现
diff --git a/go.mod b/go.mod
index 4be05e53..f73ef15c 100644
--- a/go.mod
+++ b/go.mod
@@ -1,134 +1,143 @@
module github.com/rocboss/paopao-ce
-go 1.18
+go 1.20
require (
- github.com/Masterminds/semver/v3 v3.1.1
+ github.com/Masterminds/semver/v3 v3.2.1
github.com/afocus/captcha v0.0.0-20191010092841-4bd1f21c8868
- github.com/alimy/cfg v0.3.0
- github.com/alimy/mir/v3 v3.0.0
- github.com/aliyun/aliyun-oss-go-sdk v2.2.2+incompatible
- github.com/allegro/bigcache/v3 v3.0.2
- github.com/bytedance/sonic v1.5.0
+ github.com/alimy/cfg v0.4.0
+ github.com/alimy/mir/v4 v4.0.0
+ github.com/aliyun/aliyun-oss-go-sdk v2.2.8+incompatible
+ github.com/allegro/bigcache/v3 v3.1.0
+ github.com/bufbuild/connect-go v1.10.0
+ github.com/bytedance/sonic v1.9.2
+ github.com/cockroachdb/errors v1.10.0
github.com/disintegration/imaging v1.6.2
- github.com/ethereum/go-ethereum v1.10.16
- github.com/fatih/color v1.13.0
- github.com/fbsobreira/gotron-sdk v0.0.0-20211102183839-58a64f4da5f4
- github.com/gin-contrib/cors v1.3.1
- github.com/gin-gonic/gin v1.8.1
- github.com/go-redis/redis/v8 v8.11.4
+ github.com/fatih/color v1.15.0
+ github.com/getsentry/sentry-go v0.23.0
+ github.com/gin-contrib/cors v1.4.0
+ github.com/gin-gonic/gin v1.9.1
github.com/go-resty/resty/v2 v2.7.0
- github.com/goccy/go-json v0.9.7
- github.com/gofrs/uuid v4.0.0+incompatible
- github.com/golang-jwt/jwt/v4 v4.4.2
+ github.com/goccy/go-json v0.10.2
+ github.com/gofrs/uuid/v5 v5.0.0
+ github.com/golang-jwt/jwt/v4 v4.5.0
github.com/golang-migrate/migrate/v4 v4.15.2
- github.com/huaweicloud/huaweicloud-sdk-go-obs v3.21.12+incompatible
+ github.com/huaweicloud/huaweicloud-sdk-go-obs v3.23.4+incompatible
github.com/json-iterator/go v1.1.12
- github.com/meilisearch/meilisearch-go v0.21.0
- github.com/minio/minio-go/v7 v7.0.45
- github.com/sirupsen/logrus v1.9.0
- github.com/smartwalle/alipay/v3 v3.1.7
- github.com/spf13/viper v1.14.0
- github.com/tencentyun/cos-go-sdk-v5 v0.7.35
+ github.com/meilisearch/meilisearch-go v0.25.0
+ github.com/minio/minio-go/v7 v7.0.61
+ github.com/onsi/ginkgo/v2 v2.11.0
+ github.com/onsi/gomega v1.27.10
+ github.com/pyroscope-io/client v0.7.1
+ github.com/redis/rueidis v1.0.14
+ github.com/sirupsen/logrus v1.9.3
+ github.com/smartwalle/alipay/v3 v3.2.15
+ github.com/sourcegraph/conc v0.3.0
+ github.com/spf13/viper v1.16.0
+ github.com/tencentyun/cos-go-sdk-v5 v0.7.42
github.com/yinheli/mahonia v0.0.0-20131226213531-0eef680515cc
- google.golang.org/grpc v1.50.1
- google.golang.org/protobuf v1.28.1
- gopkg.in/natefinch/lumberjack.v2 v2.0.0
+ go.uber.org/automaxprocs v1.5.3
+ google.golang.org/grpc v1.57.0
+ google.golang.org/protobuf v1.31.0
+ gopkg.in/natefinch/lumberjack.v2 v2.2.1
gopkg.in/resty.v1 v1.12.0
- gorm.io/driver/mysql v1.3.4
- gorm.io/driver/postgres v1.3.7
- gorm.io/driver/sqlite v1.3.4
- gorm.io/gorm v1.23.4
- gorm.io/plugin/dbresolver v1.1.0
- gorm.io/plugin/soft_delete v1.1.0
- modernc.org/sqlite v1.17.3
+ gorm.io/driver/mysql v1.5.1
+ gorm.io/driver/postgres v1.5.2
+ gorm.io/driver/sqlite v1.5.2
+ gorm.io/gorm v1.25.2
+ gorm.io/plugin/dbresolver v1.4.2
+ gorm.io/plugin/soft_delete v1.2.1
+ modernc.org/sqlite v1.25.0
)
require (
- github.com/andybalholm/brotli v1.0.4 // indirect
- github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f // indirect
- github.com/btcsuite/btcd v0.22.0-beta // indirect
- github.com/cespare/xxhash/v2 v2.1.2 // indirect
- github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06 // indirect
+ github.com/andybalholm/brotli v1.0.5 // indirect
+ github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
github.com/clbanning/mxj v1.8.4 // indirect
- github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
- github.com/dustin/go-humanize v1.0.0 // indirect
+ github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
+ github.com/cockroachdb/redact v1.1.5 // indirect
+ github.com/dustin/go-humanize v1.0.1 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
+ github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
- github.com/go-playground/locales v0.14.0 // indirect
- github.com/go-playground/universal-translator v0.18.0 // indirect
- github.com/go-playground/validator/v10 v10.10.1 // indirect
- github.com/go-sql-driver/mysql v1.6.0 // indirect
+ github.com/go-logr/logr v1.2.4 // indirect
+ github.com/go-playground/locales v0.14.1 // indirect
+ github.com/go-playground/universal-translator v0.18.1 // indirect
+ github.com/go-playground/validator/v10 v10.14.0 // indirect
+ github.com/go-sql-driver/mysql v1.7.0 // indirect
+ github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
+ github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
- github.com/golang/protobuf v1.5.2 // indirect
+ github.com/golang/protobuf v1.5.3 // indirect
+ github.com/google/go-cmp v0.5.9 // indirect
github.com/google/go-querystring v1.1.0 // indirect
+ github.com/google/pprof v0.0.0-20230207041349-798e818bf904 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
- github.com/jackc/chunkreader/v2 v2.0.1 // indirect
- github.com/jackc/pgconn v1.12.1 // indirect
- github.com/jackc/pgio v1.0.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
- github.com/jackc/pgproto3/v2 v2.3.0 // indirect
- github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect
- github.com/jackc/pgtype v1.11.0 // indirect
- github.com/jackc/pgx/v4 v4.16.1 // indirect
+ github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
+ github.com/jackc/pgx/v5 v5.3.1 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
- github.com/klauspost/compress v1.15.9 // indirect
- github.com/klauspost/cpuid/v2 v2.1.0 // indirect
- github.com/leodido/go-urn v1.2.1 // indirect
- github.com/lib/pq v1.10.2 // indirect
- github.com/magiconair/properties v1.8.6 // indirect
+ github.com/klauspost/compress v1.16.7 // indirect
+ github.com/klauspost/cpuid/v2 v2.2.5 // indirect
+ github.com/kr/pretty v0.3.1 // indirect
+ github.com/kr/text v0.2.0 // indirect
+ github.com/leodido/go-urn v1.2.4 // indirect
+ github.com/lib/pq v1.10.0 // indirect
+ github.com/magiconair/properties v1.8.7 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
- github.com/mattn/go-colorable v0.1.12 // indirect
- github.com/mattn/go-isatty v0.0.14 // indirect
- github.com/mattn/go-sqlite3 v1.14.12 // indirect
+ github.com/mattn/go-colorable v0.1.13 // indirect
+ github.com/mattn/go-isatty v0.0.19 // indirect
+ github.com/mattn/go-sqlite3 v1.14.17 // indirect
github.com/minio/md5-simd v1.1.2 // indirect
- github.com/minio/sha256-simd v1.0.0 // indirect
+ github.com/minio/sha256-simd v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
- github.com/mozillazg/go-httpheader v0.3.1 // indirect
- github.com/pelletier/go-toml v1.9.5 // indirect
- github.com/pelletier/go-toml/v2 v2.0.5 // indirect
+ github.com/mozillazg/go-httpheader v0.2.1 // indirect
+ github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/pkg/errors v0.9.1 // indirect
- github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect
- github.com/rs/xid v1.4.0 // indirect
- github.com/smartwalle/crypto4go v1.0.2 // indirect
- github.com/spf13/afero v1.9.2 // indirect
- github.com/spf13/cast v1.5.0 // indirect
+ github.com/pyroscope-io/godeltaprof v0.1.0 // indirect
+ github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
+ github.com/rogpeppe/go-internal v1.9.0 // indirect
+ github.com/rs/xid v1.5.0 // indirect
+ github.com/smartwalle/ncrypto v1.0.2 // indirect
+ github.com/smartwalle/ngx v1.0.6 // indirect
+ github.com/smartwalle/nsign v1.0.8 // indirect
+ github.com/spf13/afero v1.9.5 // indirect
+ github.com/spf13/cast v1.5.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
- github.com/subosito/gotenv v1.4.1 // indirect
+ github.com/subosito/gotenv v1.4.2 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
- github.com/ugorji/go/codec v1.2.7 // indirect
+ github.com/ugorji/go/codec v1.2.11 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
- github.com/valyala/fasthttp v1.37.1-0.20220607072126-8a320890c08d // indirect
+ github.com/valyala/fasthttp v1.40.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
- golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect
- golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect
- golang.org/x/image v0.0.0-20220413100746-70e8d0d3baa9 // indirect
- golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
- golang.org/x/net v0.0.0-20221014081412-f15817d10f9b // indirect
- golang.org/x/sys v0.0.0-20220908164124-27713097b956 // indirect
- golang.org/x/text v0.4.0 // indirect
- golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect
- golang.org/x/tools v0.1.12 // indirect
- google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e // indirect
+ golang.org/x/arch v0.3.0 // indirect
+ golang.org/x/crypto v0.11.0 // indirect
+ golang.org/x/image v0.0.0-20210216034530-4410531fe030 // indirect
+ golang.org/x/mod v0.10.0 // indirect
+ golang.org/x/net v0.12.0 // indirect
+ golang.org/x/sys v0.10.0 // indirect
+ golang.org/x/text v0.11.0 // indirect
+ golang.org/x/time v0.3.0 // indirect
+ golang.org/x/tools v0.9.3 // indirect
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
- gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
- lukechampine.com/uint128 v1.1.1 // indirect
- modernc.org/cc/v3 v3.36.0 // indirect
- modernc.org/ccgo/v3 v3.16.6 // indirect
- modernc.org/libc v1.16.7 // indirect
- modernc.org/mathutil v1.4.1 // indirect
- modernc.org/memory v1.1.1 // indirect
- modernc.org/opt v0.1.1 // indirect
- modernc.org/strutil v1.1.1 // indirect
- modernc.org/token v1.0.0 // indirect
+ lukechampine.com/uint128 v1.2.0 // indirect
+ modernc.org/cc/v3 v3.40.0 // indirect
+ modernc.org/ccgo/v3 v3.16.13 // indirect
+ modernc.org/libc v1.24.1 // indirect
+ modernc.org/mathutil v1.5.0 // indirect
+ modernc.org/memory v1.6.0 // indirect
+ modernc.org/opt v0.1.3 // indirect
+ modernc.org/strutil v1.1.3 // indirect
+ modernc.org/token v1.0.1 // indirect
)
diff --git a/go.sum b/go.sum
index f009c99f..3cb171d4 100644
--- a/go.sum
+++ b/go.sum
@@ -3,14 +3,12 @@ bazil.org/fuse v0.0.0-20200407214033-5883e5a4b512/go.mod h1:FbcW6z/2VytnFDhZfumh
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
-cloud.google.com/go v0.43.0/go.mod h1:BOSR3VbTLkk6FDC/TcffxP4NF/FFBGA5ku+jvKOP7pg=
cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU=
cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc=
cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0=
cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To=
-cloud.google.com/go v0.51.0/go.mod h1:hWtGJ6gnXH+KgDv+V0zFGDvpi07n3z8ZNj3T1RW0Gcw=
cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4=
cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M=
cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc=
@@ -39,7 +37,6 @@ cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvf
cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg=
cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc=
cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ=
-cloud.google.com/go/bigtable v1.2.0/go.mod h1:JcVAOl45lrTmQfLj7T6TxyMzIN/3FGGcFm+2xVAli2o=
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk=
cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk=
@@ -54,15 +51,11 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
-collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8=
github.com/AdaLogics/go-fuzz-headers v0.0.0-20210715213245-6c3934b029d8/go.mod h1:CzsSbkDixRphAF5hS6wbMKq0eI6ccJRb7/A0M6JBnwg=
-github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4=
-github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc=
github.com/Azure/azure-pipeline-go v0.2.3/go.mod h1:x841ezTBIMG6O3lAcl8ATHnsOPVl2bqk7S3ta6S6u4k=
github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
-github.com/Azure/azure-storage-blob-go v0.7.0/go.mod h1:f9YQKtsG1nMisotuTPpO0tjNuEjKRYAcJU8/ydDI++4=
github.com/Azure/azure-storage-blob-go v0.14.0/go.mod h1:SMqIBi+SuiQH32bvyjngEewEeXoPfKMgWlBDaYf6fck=
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
@@ -70,35 +63,23 @@ github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOEl
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
github.com/Azure/go-autorest v10.8.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
-github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI=
github.com/Azure/go-autorest/autorest v0.11.1/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw=
github.com/Azure/go-autorest/autorest v0.11.18/go.mod h1:dSiJPy22c3u0OtOKDNttNgqpNFY/GeWa7GH/Pz56QRA=
-github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0=
-github.com/Azure/go-autorest/autorest/adal v0.8.0/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc=
github.com/Azure/go-autorest/autorest/adal v0.9.0/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg=
github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A=
github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M=
github.com/Azure/go-autorest/autorest/adal v0.9.16/go.mod h1:tGMin8I49Yij6AQ+rvV+Xa/zwxYQB5hmsd6DkfAx2+A=
-github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA=
-github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g=
github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74=
-github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0=
-github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0=
-github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM=
github.com/Azure/go-autorest/autorest/mocks v0.4.0/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k=
github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k=
-github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc=
github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8=
github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8=
-github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk=
github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU=
-github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/ClickHouse/clickhouse-go v1.4.3/go.mod h1:EaI/sW7Azgz9UATzd5ZdZHRUhHgv5+JMS9NSr2smCJI=
-github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
-github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc=
-github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
+github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0=
+github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ=
github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA=
github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA=
github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw=
@@ -132,9 +113,6 @@ github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdko
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/QcloudApi/qcloud_sign_golang v0.0.0-20141224014652-e4130a326409/go.mod h1:1pk82RBxDY/JZnPQrtqHlUFfCctgdorsd9M06fMynOM=
github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ=
-github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
-github.com/VictoriaMetrics/fastcache v1.6.0/go.mod h1:0qHz5QP0GMX4pfmMA/zt5RgfNuXJrTP0zS7DqpHGGTw=
-github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII=
github.com/afocus/captcha v0.0.0-20191010092841-4bd1f21c8868 h1:uFrPOl1VBt/Abfl2z+A/DFc+AwmFLxEHR1+Yq6cXvww=
github.com/afocus/captcha v0.0.0-20191010092841-4bd1f21c8868/go.mod h1:srphKZ1i+yGXxl/LpBS7ZIECTjCTPzZzAMtJWoG3sLo=
github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw=
@@ -145,20 +123,18 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
github.com/alexflint/go-filemutex v0.0.0-20171022225611-72bdc8eae2ae/go.mod h1:CgnQgUtFrFz9mxFNtED3jI5tLDjKlOM+oUF/sTk6ps0=
github.com/alexflint/go-filemutex v1.1.0/go.mod h1:7P4iRhttt/nUvUOrYIhcpMzv2G6CY9UnI16Z+UJqRyk=
-github.com/alimy/cfg v0.3.0 h1:9xgA0QWVCPSq9fFNRcYahVCAX22IL9ts2wrTQPfAStY=
-github.com/alimy/cfg v0.3.0/go.mod h1:rOxbasTH2srl6StAjNF5Vyi8bfrdkl3fLGmOYtSw81c=
-github.com/alimy/mir/v3 v3.0.0 h1:bUcT+SLs/BYHIuHzTCbYnxnEwbYDSCDJULU5a1YZDes=
-github.com/alimy/mir/v3 v3.0.0/go.mod h1:ybhT2ijOiDn0lLwWzIY6vXdv+uzZrctS7VFfczcXBWU=
-github.com/aliyun/aliyun-oss-go-sdk v2.2.2+incompatible h1:9gWa46nstkJ9miBReJcN8Gq34cBFbzSpQZVVT9N09TM=
-github.com/aliyun/aliyun-oss-go-sdk v2.2.2+incompatible/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8=
-github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM=
-github.com/allegro/bigcache/v3 v3.0.2 h1:AKZCw+5eAaVyNTBmI2fgyPVJhHkdWder3O9IrprcQfI=
-github.com/allegro/bigcache/v3 v3.0.2/go.mod h1:aPyh7jEvrog9zAwx5N7+JUQX5dZTSGpxF1LAR4dr35I=
-github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8=
-github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY=
+github.com/alimy/cfg v0.4.0 h1:SslKPndmxRViT1ePWLmNsEq7okYP0GVeuowQlRWZPkw=
+github.com/alimy/cfg v0.4.0/go.mod h1:rOxbasTH2srl6StAjNF5Vyi8bfrdkl3fLGmOYtSw81c=
+github.com/alimy/mir/v4 v4.0.0 h1:MzGfmoLjjvR69jbZEmpKJO3tUuqB0RGRv1UWPbtukBg=
+github.com/alimy/mir/v4 v4.0.0/go.mod h1:d58dBvw2KImcVbAUANrciEV/of0arMNsI9c/5UNCMMc=
+github.com/aliyun/aliyun-oss-go-sdk v2.2.8+incompatible h1:6JF1bjhT0WN2srEmijfOFtVWwV91KZ6dJY1/JbdtGrI=
+github.com/aliyun/aliyun-oss-go-sdk v2.2.8+incompatible/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8=
+github.com/allegro/bigcache/v3 v3.1.0 h1:H2Vp8VOvxcrB91o86fUSVJFqeuz8kpyyB02eH3bSzwk=
+github.com/allegro/bigcache/v3 v3.1.0/go.mod h1:aPyh7jEvrog9zAwx5N7+JUQX5dZTSGpxF1LAR4dr35I=
github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
+github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs=
+github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
-github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db/go.mod h1:VTxUBvSJ3s3eHAg65PNgrsn5BtqCRPdmyXh6rAfdxN0=
github.com/apache/arrow/go/arrow v0.0.0-20210818145353-234c94e4ce64/go.mod h1:2qMFB56yOP3KzkB3PbYZ4AlUFg3a88F67TIx5lB/WwY=
github.com/apache/arrow/go/arrow v0.0.0-20211013220434-5962184e7a30/go.mod h1:Q7yQnSMnLvcXlZ8RV+jwz/6y1rQTqbX6C82SndT52Zs=
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
@@ -168,16 +144,12 @@ github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0=
github.com/aws/aws-sdk-go v1.17.7/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
-github.com/aws/aws-sdk-go-v2 v1.2.0/go.mod h1:zEQs02YRBw1DjK0PoJv3ygDYOFTre1ejlJWl8FwAuQo=
github.com/aws/aws-sdk-go-v2 v1.8.0/go.mod h1:xEFuWz+3TYdlPRuo+CqATbeDWIWyaT5uAPwPaWtgse0=
github.com/aws/aws-sdk-go-v2 v1.9.2/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4=
-github.com/aws/aws-sdk-go-v2/config v1.1.1/go.mod h1:0XsVy9lBI/BCXm+2Tuvt39YmdHwS5unDQmxZOYe8F5Y=
github.com/aws/aws-sdk-go-v2/config v1.6.0/go.mod h1:TNtBVmka80lRPk5+S9ZqVfFszOQAGJJ9KbT3EM3CHNU=
github.com/aws/aws-sdk-go-v2/config v1.8.3/go.mod h1:4AEiLtAb8kLs7vgw2ZV3p2VZ1+hBavOc84hqxVNpCyw=
-github.com/aws/aws-sdk-go-v2/credentials v1.1.1/go.mod h1:mM2iIjwl7LULWtS6JCACyInboHirisUUdkBPoTHMOUo=
github.com/aws/aws-sdk-go-v2/credentials v1.3.2/go.mod h1:PACKuTJdt6AlXvEq8rFI4eDmoqDFC5DpVKQbWysaDgM=
github.com/aws/aws-sdk-go-v2/credentials v1.4.3/go.mod h1:FNNC6nQZQUuyhq5aE5c7ata8o9e4ECGmS4lAXC7o1mQ=
-github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.2/go.mod h1:3hGg3PpiEjHnrkrlasTfxFqUsZ2GCk/fMUn4CbKgSkM=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.4.0/go.mod h1:Mj/U8OpDbcVcoctrYwA2bak8k/HFPdcLzI/vaiXMwuM=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.6.0/go.mod h1:gqlclDEZp4aqJOancXK6TN24aKhT0W0Ae9MHk3wzTMM=
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.4.0/go.mod h1:eHwXu2+uE/T6gpnYWwBwqoeqRf9IXyCcolyOWDRAErQ=
@@ -186,25 +158,18 @@ github.com/aws/aws-sdk-go-v2/internal/ini v1.2.0/go.mod h1:Q5jATQc+f1MfZp3PDMhn6
github.com/aws/aws-sdk-go-v2/internal/ini v1.2.4/go.mod h1:ZcBrrI3zBKlhGFNYWvju0I3TR93I7YIgAfy82Fh4lcQ=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.2.2/go.mod h1:EASdTcM1lGhUe1/p4gkojHwlGJkeoRjjr1sRCzup3Is=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.3.0/go.mod h1:v8ygadNyATSm6elwJ/4gzJwcFhri9RqS8skgHKiwXPU=
-github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.2/go.mod h1:45MfaXZ0cNbeuT0KQ1XJylq8A6+OpVV2E5kvY/Kq+u8=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.2.2/go.mod h1:NXmNI41bdEsJMrD0v9rUvbGCB5GwdBEpKvUvIY3vTFg=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.3.2/go.mod h1:72HRZDLMtmVQiLG2tLfQcaWLCssELvGl+Zf2WVxMmR8=
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.5.2/go.mod h1:QuL2Ym8BkrLmN4lUofXYq6000/i5jPjosCNK//t6gak=
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.7.2/go.mod h1:np7TMuJNT83O0oDOSF8i4dF3dvGqA6hPYYo6YYkzgRA=
-github.com/aws/aws-sdk-go-v2/service/route53 v1.1.1/go.mod h1:rLiOUrPLW/Er5kRcQ7NkwbjlijluLsrIbu/iyl35RO4=
github.com/aws/aws-sdk-go-v2/service/s3 v1.12.0/go.mod h1:6J++A5xpo7QDsIeSqPK4UHqMSyPOCopa+zKtqAMhqVQ=
github.com/aws/aws-sdk-go-v2/service/s3 v1.16.1/go.mod h1:CQe/KvWV1AqRc65KqeJjrLzr5X2ijnFTTVzJW0VBRCI=
-github.com/aws/aws-sdk-go-v2/service/sso v1.1.1/go.mod h1:SuZJxklHxLAXgLTc1iFXbEWkXs7QRTQpCLGaKIprQW0=
github.com/aws/aws-sdk-go-v2/service/sso v1.3.2/go.mod h1:J21I6kF+d/6XHVk7kp/cx9YVD2TMD2TbLwtRGVcinXo=
github.com/aws/aws-sdk-go-v2/service/sso v1.4.2/go.mod h1:NBvT9R1MEF+Ud6ApJKM0G+IkPchKS7p7c2YPKwHmBOk=
-github.com/aws/aws-sdk-go-v2/service/sts v1.1.1/go.mod h1:Wi0EBZwiz/K44YliU0EKxqTCJGUfYTWXrrBwkq736bM=
github.com/aws/aws-sdk-go-v2/service/sts v1.6.1/go.mod h1:hLZ/AnkIKHLuPGjEiyghNEdvJ2PP0MgOxcmv9EBJ4xs=
github.com/aws/aws-sdk-go-v2/service/sts v1.7.2/go.mod h1:8EzeIqfWt2wWT4rJVu3f21TfrhJ8AEMzVybRNSb/b4g=
-github.com/aws/smithy-go v1.1.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw=
github.com/aws/smithy-go v1.7.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E=
github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E=
-github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f h1:ZNv7On9kyUzm7fvRZumSyy/IUiSC7AzL0I1jKKtwooA=
-github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc=
github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM=
github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
@@ -219,47 +184,33 @@ github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJm
github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4=
-github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c=
-github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps=
github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
github.com/bshuster-repo/logrus-logstash-hook v0.4.1/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk=
-github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ=
-github.com/btcsuite/btcd v0.22.0-beta h1:LTDpDKUM5EeOFBPM8IXpinEcmZ6FWfNZbE3lfrfdnWo=
-github.com/btcsuite/btcd v0.22.0-beta/go.mod h1:9n5ntfhhHQBIhUvlhDvD3Qg6fRUj4jkN0VB8L8svzOA=
-github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA=
-github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg=
-github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce/go.mod h1:0DVlHczLPewLcPGEIeUEzfOJhqGPQ0mJJRDBtD307+o=
-github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg=
-github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY=
-github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I=
-github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc=
-github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc=
-github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY=
-github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs=
+github.com/bufbuild/connect-go v1.10.0 h1:QAJ3G9A1OYQW2Jbk3DeoJbkCxuKArrvZgDt47mjdTbg=
+github.com/bufbuild/connect-go v1.10.0/go.mod h1:CAIePUgkDR5pAFaylSMtNK45ANQjp9JvpluG20rhpV8=
github.com/buger/jsonparser v0.0.0-20180808090653-f4dd9f5a6b44/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s=
github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0=
github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8=
github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0BsqsP2LwDJ9aOkm/6J86V6lyAXCoQWGw3K50=
github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE=
-github.com/bytedance/sonic v1.5.0 h1:XWdTi8bwPgxIML+eNV1IwNuTROK6EUrQ65ey8yd6fRQ=
github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM=
-github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34=
+github.com/bytedance/sonic v1.9.2 h1:GDaNjuWSGu09guE9Oql0MSTNhNCLlWwO8y/xM5BzcbM=
+github.com/bytedance/sonic v1.9.2/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U=
github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw=
github.com/cenkalti/backoff/v4 v4.1.2/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA=
github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA=
-github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
-github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE=
github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw=
github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d89JlCLQIfgVcNsNN0t6T2M=
github.com/checkpoint-restore/go-criu/v5 v5.3.0/go.mod h1:E/eQpaFtUKGOOSEBZgmKAcn+zUUwWxqcaKZlF54wK8E=
-github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06 h1:1sDoSuDPWzhkdzNVxCxtIaKiAe96ESVPv8coGwc1gZ4=
github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY=
+github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams=
+github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
@@ -272,7 +223,6 @@ github.com/cilium/ebpf v0.7.0/go.mod h1:/oI2+1shJiTGAMgl6/RgJr36Eo1jzrRcAWbcXO2u
github.com/clbanning/mxj v1.8.4 h1:HuhwZtbyvyOw+3Z1AowPkU87JkJUSv751ELWaiTpj8I=
github.com/clbanning/mxj v1.8.4/go.mod h1:BVjHeAH+rl9rs6f+QIpeRl0tfu10SXn1pUSa5PVGJng=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
-github.com/cloudflare/cloudflare-go v0.14.0/go.mod h1:EnwdgGMaFOruiPZRFSgn+TsQ3hQ7C/YWzIGLeu5c304=
github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58/go.mod h1:EOBUe0h4xcZ5GoxqC5SDxFQ8gwyZPKQoEzownBlhI80=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
@@ -284,15 +234,18 @@ github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWH
github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20211130200136-a8f946100490/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
-github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I=
github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ=
github.com/cockroachdb/cockroach-go/v2 v2.1.1/go.mod h1:7NtUnP6eK+l6k483WSYNrq3Kb23bWV10IRV1TyeSpwM=
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo=
github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA=
+github.com/cockroachdb/errors v1.10.0 h1:lfxS8zZz1+OjtV4MtNWgboi/W5tyLEB6VQZBXN+0VUU=
+github.com/cockroachdb/errors v1.10.0/go.mod h1:lknhIsEVQ9Ss/qKDBQS/UqFSvPQjOwNq2qyKAxtHRqE=
github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI=
-github.com/consensys/bavard v0.1.8-0.20210406032232-f3452dc9b572/go.mod h1:Bpd0/3mZuaj6Sj+PqrmIquiOKy397AKGThQPaGzNXAQ=
-github.com/consensys/gnark-crypto v0.4.1-0.20210426202927-39ac3d4b3f1f/go.mod h1:815PAHg3wvysy0SyIqanF8gZ0Y1wjk/hrDHD/iT88+Q=
+github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE=
+github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs=
+github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30=
+github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg=
github.com/containerd/aufs v0.0.0-20200908144142-dab0cbea06f4/go.mod h1:nukgQABAEopAHvB6j7cnP5zJ+/3aVcE7hCYqvIwAHyE=
github.com/containerd/aufs v0.0.0-20201003224125-76a6863f2989/go.mod h1:AkGGQs9NM2vtYHaUen+NljV0/baGCAPELGm2q9ZXpWU=
github.com/containerd/aufs v0.0.0-20210316121734-20793ff83c97/go.mod h1:kL5kd6KM5TzQjR79jljyi4olc1Vrx6XBlcyj3gNv2PU=
@@ -413,7 +366,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsr
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
-github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4=
github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4=
github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4=
github.com/cznic/mathutil v0.0.0-20180504122225-ca4c9f2c1369/go.mod h1:e6NPNENfs9mPDVNRekM7lKScauxd5kXTr1Mfyig6TDM=
@@ -421,28 +373,18 @@ github.com/d2g/dhcp4 v0.0.0-20170904100407-a1d1b6c41b1c/go.mod h1:Ct2BUK8SB0YC1S
github.com/d2g/dhcp4client v1.0.0/go.mod h1:j0hNfjhrt2SxUOw55nL0ATM/z4Yt3t2Kd1mW34z5W5s=
github.com/d2g/dhcp4server v0.0.0-20181031114812-7d4a0a7f59a5/go.mod h1:Eo87+Kg/IX2hfWJfwxMzLyuSZyxSoAug2nGa1G2QAi8=
github.com/d2g/hardwareaddr v0.0.0-20190221164911-e7d9fbe030e4/go.mod h1:bMl4RjIciD2oAxI7DmWRx6gbeqrkoLqv3MV0vzNad+I=
-github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg=
-github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo=
-github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218=
-github.com/deepmap/oapi-codegen v1.6.0/go.mod h1:ryDa9AgbELGeB+YEXE1dR53yAjHwFvE9iAUlWl9Al3M=
-github.com/deepmap/oapi-codegen v1.8.2/go.mod h1:YLgSKSDv/bZQB7N4ws6luhozi3cEdRktEqrX88CvjIw=
github.com/denisenkom/go-mssqldb v0.10.0/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0=
github.com/dgrijalva/jwt-go v0.0.0-20170104182250-a601269ab70c/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
-github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8/go.mod h1:VMaSuZ+SZcx/wljOQKvp5srsbCiKDEb6K2wC4+PiBmQ=
-github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
-github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
github.com/dhui/dktest v0.3.10 h1:0frpeeoM9pHouHjhLeZDuDTJ0PqjDTrycaHaMmkJAo8=
github.com/dhui/dktest v0.3.10/go.mod h1:h5Enh0nG3Qbo9WjNFRrwmKUaePEBhXMOygbz3Ww7Sz0=
github.com/disintegration/imaging v1.6.2 h1:w1LecBlG2Lnp8B3jk5zSuNqd7b4DXhcjwek1ei82L+c=
github.com/disintegration/imaging v1.6.2/go.mod h1:44/5580QXChDfwIclfc/PCwrr44amcmDAg8hxG0Ewe4=
-github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E=
github.com/docker/cli v0.0.0-20191017083524-a8ff7f821017/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/distribution v0.0.0-20190905152932-14b96e55d84c/go.mod h1:0+TTO4EOBfRPhZXAeF1Vu+W3hHZ8eLp8PgKVZlcvtFY=
@@ -450,7 +392,6 @@ github.com/docker/distribution v2.7.1-0.20190205005809-0d3efadf0154+incompatible
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68=
github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
-github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v1.4.2-0.20190924003213-a8608b5b67c7/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v20.10.13+incompatible h1:5s7uxnKZG+b8hYWlPYUi6x1Sjpq2MSt96d15eLZeHyw=
github.com/docker/docker v20.10.13+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
@@ -466,14 +407,11 @@ github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDD
github.com/docker/libtrust v0.0.0-20150114040149-fa567046d9b1/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE=
github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM=
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
-github.com/dop251/goja v0.0.0-20211011172007-d99e4b8cbf48/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk=
-github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y=
github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
-github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
-github.com/eclipse/paho.mqtt.golang v1.2.0/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7joQ8SYLhZwfeOo6Ts=
+github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
+github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M=
-github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M=
github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc=
github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
@@ -488,24 +426,19 @@ github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.
github.com/envoyproxy/go-control-plane v0.10.1/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPOWUZ7hQAEvzN5Pf27BkQQ=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E9/baC+qXE/TeeyBRzgJDws=
-github.com/ethereum/go-ethereum v1.10.16 h1:3oPrumn0bCW/idjcxMn5YYVCdK7VzJYIvwGZUGLEaoc=
-github.com/ethereum/go-ethereum v1.10.16/go.mod h1:Anj6cxczl+AHy63o4X9O8yWNHuN5wMpfb8MAnHkWn7Y=
github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
-github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=
-github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
-github.com/fbsobreira/gotron-sdk v0.0.0-20211102183839-58a64f4da5f4 h1:zlN+of+l+or/Y6CYgpX99wwaTf4zN0myVj6YAXiE3xk=
-github.com/fbsobreira/gotron-sdk v0.0.0-20211102183839-58a64f4da5f4/go.mod h1:h93/Km+mJz1q4a+4fjYE+dMxzTRTrJjxaVIc/Tm9uV0=
+github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs=
+github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw=
github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
-github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0=
github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k=
github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k=
github.com/form3tech-oss/jwt-go v3.2.5+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k=
github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k=
-github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE=
+github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
@@ -514,23 +447,22 @@ github.com/fsouza/fake-gcs-server v1.17.0/go.mod h1:D1rTE4YCyHFNa99oyJJ5HyclvN/0
github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa/go.mod h1:KnogPXtdwXqoenmZCw6S+25EAm2MkxbG0deNDu4cbSA=
github.com/gabriel-vasile/mimetype v1.3.1/go.mod h1:fA8fi6KUiG7MgQQ+mEWotXoEOvmxRtOJlERCzSmRvr8=
github.com/gabriel-vasile/mimetype v1.4.0/go.mod h1:fA8fi6KUiG7MgQQ+mEWotXoEOvmxRtOJlERCzSmRvr8=
+github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU=
+github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA=
github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY=
-github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww=
-github.com/getkin/kin-openapi v0.53.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4=
-github.com/getkin/kin-openapi v0.61.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4=
github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ=
+github.com/getsentry/sentry-go v0.23.0 h1:dn+QRCeJv4pPt9OjVXiMcGIBIefaTJPw/h0bZWO05nE=
+github.com/getsentry/sentry-go v0.23.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY=
github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
-github.com/gin-contrib/cors v1.3.1 h1:doAsuITavI4IOcd0Y19U4B+O0dNWihRyX//nn4sEmgA=
-github.com/gin-contrib/cors v1.3.1/go.mod h1:jjEJ4268OPZUcU7k9Pm653S7lXUGcqMADzFA61xsmDk=
+github.com/gin-contrib/cors v1.4.0 h1:oJ6gwtUl3lqV0WEIwM/LxPF1QZ5qe2lGWdY2+bz7y0g=
+github.com/gin-contrib/cors v1.4.0/go.mod h1:bs9pNM0x/UsmHPBWT2xZz9ROh8xYjYkiURUfmBoMlcs=
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
-github.com/gin-gonic/gin v1.5.0/go.mod h1:Nd6IXA8m5kNZdNEHMBd93KT+mdY3+bewLgRvmCsR2Do=
-github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8=
github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk=
-github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE=
-github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24=
-github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs=
+github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg=
+github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU=
+github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=
github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g=
github.com/go-fonts/latin-modern v0.2.0/go.mod h1:rQVLdDMK+mK1xscDwsqM5J8U2jrRa3T0ecnM9pNujks=
github.com/go-fonts/liberation v0.1.1/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY=
@@ -552,9 +484,10 @@ github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTg
github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.2.1/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
+github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ=
+github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/stdr v1.2.0/go.mod h1:YkVgnZu1ZjjL7xTxrfm/LLZBfkhTqSR1ydtm6jTKKwI=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
-github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8=
github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0=
github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg=
github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
@@ -569,28 +502,28 @@ github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dp
github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ=
-github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A=
github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
-github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM=
-github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU=
+github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs=
-github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEKwgtJRd2xk99HeFyHw3yid4rvQIY=
-github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho=
+github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
+github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA=
-github.com/go-playground/validator/v10 v10.10.1 h1:uA0+amWMiglNZKZ9FJRKUAe9U3RX91eVn1JYXMWt7ig=
-github.com/go-playground/validator/v10 v10.10.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU=
-github.com/go-redis/redis/v8 v8.11.4 h1:kHoYkfZP6+pe04aFTnhDH6GDROa5yJdHJVNxV3F46Tg=
-github.com/go-redis/redis/v8 v8.11.4/go.mod h1:2Z2wHZXdQpCDXEGzqMockDpNyYvi2l4Pxt6RJr792+w=
+github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
+github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
+github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos=
+github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js=
+github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU=
github.com/go-resty/resty/v2 v2.7.0 h1:me+K9p3uhSmXtrBZ4k9jcEAfJmuC8IivWHwaLZwPrFY=
github.com/go-resty/resty/v2 v2.7.0/go.mod h1:9PWDzw47qPphMRFfhsyk0NnSgvluHcljSMVIq3w7q0I=
-github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg=
github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
-github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
-github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE=
github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
+github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc=
+github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
+github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
+github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0=
github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY=
github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg=
@@ -616,8 +549,9 @@ github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWe
github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ=
github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0=
github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw=
-github.com/goccy/go-json v0.9.7 h1:IcB+Aqpx/iMHu5Yooh7jEzJk1JZ7Pjtmys2ukPr7EeM=
github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
+github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
+github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
github.com/gocql/gocql v0.0.0-20210515062232-b7ef815b4556/go.mod h1:DL0ekTmBSTdlNF25Orwt/JMzqIq3EJ4MVa/J/uK64OY=
github.com/godbus/dbus v0.0.0-20151105175453-c7fdd8b5cd55/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw=
github.com/godbus/dbus v0.0.0-20180201030542-885f9cc04c9c/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw=
@@ -626,9 +560,9 @@ github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5x
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
-github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
-github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw=
github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
+github.com/gofrs/uuid/v5 v5.0.0 h1:p544++a97kEL+svbcFbCQVM9KFu0Yo25UoISXGNNH9M=
+github.com/gofrs/uuid/v5 v5.0.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8=
github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU=
github.com/gogo/googleapis v1.4.0/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
@@ -640,14 +574,13 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
github.com/golang-jwt/jwt/v4 v4.1.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
-github.com/golang-jwt/jwt/v4 v4.4.2 h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQAYs=
-github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
+github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg=
+github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
github.com/golang-migrate/migrate/v4 v4.15.2 h1:vU+M05vs6jWHKDdmE1Ecwj0BznygFc4QsdRe2E/L7kc=
github.com/golang-migrate/migrate/v4 v4.15.2/go.mod h1:f2toGLkYqD3JH+Todi4aZ2ZdbeUNx4sIwiOK96rE9Lw=
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
-github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
@@ -681,18 +614,16 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM=
-github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
+github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
+github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
-github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
-github.com/golangci/lint-1 v0.0.0-20181222135242-d2cdd8c08219/go.mod h1:/X8TswGSh1pIozq4ZwCfxS0WA5JGXguxk94ar/4c87Y=
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA=
-github.com/google/flatbuffers v1.11.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8=
github.com/google/flatbuffers v2.0.0+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
@@ -707,6 +638,7 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
+github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-containerregistry v0.5.1/go.mod h1:Ct15B4yir3PLOP5jsy0GNeYVaIZs/MK/Jz5any1wFW0=
github.com/google/go-github/v39 v39.2.0/go.mod h1:C1s8C5aCC9L+JXIYpJM5GYytdX52vC1bLvHEF1IhBrE=
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
@@ -714,7 +646,6 @@ github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
-github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
@@ -735,11 +666,12 @@ github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLe
github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
+github.com/google/pprof v0.0.0-20230207041349-798e818bf904 h1:4/hN5RUoecvl+RmJRE2YxKWtnnQls6rQjjW5oV7qg2U=
+github.com/google/pprof v0.0.0-20230207041349-798e818bf904/go.mod h1:uglQLonpP8qtYCYyzA+8c/9qtqgA3qsXGYqCPKARAFg=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
-github.com/google/uuid v1.1.5/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
@@ -757,11 +689,9 @@ github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/
github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
-github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
-github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc=
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
@@ -777,7 +707,6 @@ github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FK
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
-github.com/hashicorp/go-bexpr v0.1.10/go.mod h1:oxlubA2vC/gFVfX1A6JGp7ls7uCDlfJn732ehYYg+g0=
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=
@@ -793,20 +722,15 @@ github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/b
github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
-github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ=
github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I=
github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
-github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA=
-github.com/holiman/uint256 v1.2.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
-github.com/huaweicloud/huaweicloud-sdk-go-obs v3.21.12+incompatible h1:tANYIteuFrosKbRYUk1Yo/OGJjbt4x3OVg211Qc60M0=
-github.com/huaweicloud/huaweicloud-sdk-go-obs v3.21.12+incompatible/go.mod h1:l7VUhRbTKCzdOacdT4oWCwATKyvZqUOlOqr0Ous3k4s=
-github.com/huin/goupnp v1.0.2/go.mod h1:0dxJBVBHqTMjIUMkESDTNgOOx/Mw5wYIfyFmdzSamkM=
-github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o=
+github.com/huaweicloud/huaweicloud-sdk-go-obs v3.23.4+incompatible h1:XRAk4HBDLCYEdPLWtKf5iZhOi7lfx17aY0oSO9+mcg8=
+github.com/huaweicloud/huaweicloud-sdk-go-obs v3.23.4+incompatible/go.mod h1:l7VUhRbTKCzdOacdT4oWCwATKyvZqUOlOqr0Ous3k4s=
github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
@@ -816,23 +740,11 @@ github.com/imdario/mergo v0.3.10/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH
github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
-github.com/influxdata/flux v0.65.1/go.mod h1:J754/zds0vvpfwuq7Gc2wRdVwEodfpCFM7mYlOw2LqY=
-github.com/influxdata/influxdb v1.8.3/go.mod h1:JugdFhsvvI8gadxOI6noqNeeBHvWNTbfYGtiAn+2jhI=
-github.com/influxdata/influxdb-client-go/v2 v2.4.0/go.mod h1:vLNHdxTJkIf2mSLvGrpj8TCcISApPoXkaxP8g9uRlW8=
-github.com/influxdata/influxql v1.1.1-0.20200828144457-65d3ef77d385/go.mod h1:gHp9y86a/pxhjJ+zMjNXiQAA197Xk9wLxaz+fGG+kWk=
-github.com/influxdata/line-protocol v0.0.0-20180522152040-32c6aa80de5e/go.mod h1:4kt73NQhadE3daL3WhR5EJ/J2ocX0PZzwxQ0gXJ7oFE=
-github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo=
-github.com/influxdata/line-protocol v0.0.0-20210311194329-9aa0e372d097/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo=
-github.com/influxdata/promql/v2 v2.12.0/go.mod h1:fxOPu+DY0bqCTCECchSRtWfc+0X19ybifQhZoQNF5D8=
-github.com/influxdata/roaring v0.4.13-0.20180809181101-fc520f41fab6/go.mod h1:bSgUQ7q5ZLSO+bKBGqJiCBGAl+9DxyW63zLTujjUlOE=
-github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9/go.mod h1:Js0mqiSBE6Ffsg94weZZ2c+v/ciT8QRHFOap7EKDrR0=
-github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368/go.mod h1:Wbbw6tYNvwa5dlB6304Sd+82Z3f7PmVZHVKU637d4po=
github.com/intel/goresctrl v0.2.0/go.mod h1:+CZdzouYFn5EsxgqAQTEzMfwKwuc0fVdMrT9FCCAVRQ=
github.com/j-keck/arping v0.0.0-20160618110441-2cf9dc699c56/go.mod h1:ymszkNOg6tORTn+6F6j+Jc8TOr5osrynvN6ivFWZ2GA=
github.com/j-keck/arping v1.0.2/go.mod h1:aJbELhR92bSk7tp79AWM/ftfc90EfEi2bQJrbBFOsPw=
github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo=
github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk=
-github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8=
github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk=
github.com/jackc/pgconn v0.0.0-20190420214824-7e0022ef6ba3/go.mod h1:jkELnwuX+w9qN5YIfX0fl88Ehu4XC3keFuOJJk9pcnA=
github.com/jackc/pgconn v0.0.0-20190824142844-760dd75542eb/go.mod h1:lLjNuW/+OfW9/pnVKPazfWOgNfH2aPem8YQ7ilXGvJE=
@@ -841,17 +753,9 @@ github.com/jackc/pgconn v1.4.0/go.mod h1:Y2O3ZDF0q4mMacyWV3AstPJpeHXWGEetiFttmq5
github.com/jackc/pgconn v1.5.0/go.mod h1:QeD3lBfpTFe8WUnPZWN5KY/mB8FGMIYRdd8P8Jr0fAI=
github.com/jackc/pgconn v1.5.1-0.20200601181101-fa742c524853/go.mod h1:QeD3lBfpTFe8WUnPZWN5KY/mB8FGMIYRdd8P8Jr0fAI=
github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o=
-github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY=
-github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI=
-github.com/jackc/pgconn v1.12.1 h1:rsDFzIpRk7xT4B8FufgpCCeyjdNpKyghZeSefViE5W8=
-github.com/jackc/pgconn v1.12.1/go.mod h1:ZkhRC59Llhrq3oSfrikvwQ5NaxYExr6twkdkMLaKono=
github.com/jackc/pgerrcode v0.0.0-20201024163028-a0d42d470451/go.mod h1:a/s9Lp5W7n/DD0VrVoyJ00FbP2ytTPDVOivvn2bMlds=
-github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE=
github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8=
github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE=
-github.com/jackc/pgmock v0.0.0-20201204152224-4fe30f7445fd/go.mod h1:hrBW0Enj2AZTNpt/7Y5rr2xe/9Mn757Wtb2xeBzPv2c=
-github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65 h1:DadwsjnMwFjfWc9y5Wi/+Zz7xoE5ALHsRQlOctkOiHc=
-github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65/go.mod h1:5R2h2EEX+qri8jOWMbJCtaPWkrrNc7OHwsp2TCqp7ak=
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78=
@@ -862,12 +766,10 @@ github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:
github.com/jackc/pgproto3/v2 v2.0.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA=
github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA=
github.com/jackc/pgproto3/v2 v2.0.7/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA=
-github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA=
-github.com/jackc/pgproto3/v2 v2.3.0 h1:brH0pCGBDkBW07HWlN/oSBXrmo3WB0UvZd1pIuDcL8Y=
-github.com/jackc/pgproto3/v2 v2.3.0/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA=
github.com/jackc/pgservicefile v0.0.0-20200307190119-3430c5407db8/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E=
-github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b h1:C8S2+VttkHFdOOCXJe+YGfa4vHYwlt4Zx+IVXQ97jYg=
github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E=
+github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk=
+github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM=
github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg=
github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc=
github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw=
@@ -875,9 +777,6 @@ github.com/jackc/pgtype v1.2.0/go.mod h1:5m2OfMh1wTK7x+Fk952IDmI4nw3nPrvtQdM0ZT4
github.com/jackc/pgtype v1.3.1-0.20200510190516-8cd94a14c75a/go.mod h1:vaogEUkALtxZMCH411K+tKzNpwzCKU+AnPzBKZ+I+Po=
github.com/jackc/pgtype v1.3.1-0.20200606141011-f6355165a91c/go.mod h1:cvk9Bgu/VzJ9/lxTO5R5sf80p0DiucVtN7ZxvaC4GmQ=
github.com/jackc/pgtype v1.6.2/go.mod h1:JCULISAZBFGrHaOXIIFiyfzW5VY0GRitRr8NeJsrdig=
-github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM=
-github.com/jackc/pgtype v1.11.0 h1:u4uiGPz/1hryuXzyaBhSk6dnIyyG2683olG2OV+UUgs=
-github.com/jackc/pgtype v1.11.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4=
github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y=
github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM=
github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc=
@@ -885,19 +784,13 @@ github.com/jackc/pgx/v4 v4.5.0/go.mod h1:EpAKPLdnTorwmPUUsqrPxy5fphV18j9q3wrfRXg
github.com/jackc/pgx/v4 v4.6.1-0.20200510190926-94ba730bb1e9/go.mod h1:t3/cdRQl6fOLDxqtlyhe9UWgfIi9R8+8v8GKV5TRA/o=
github.com/jackc/pgx/v4 v4.6.1-0.20200606145419-4e5062306904/go.mod h1:ZDaNWkt9sW1JMiNn0kdYBaLelIhw7Pg4qd+Vk6tw7Hg=
github.com/jackc/pgx/v4 v4.10.1/go.mod h1:QlrWebbs3kqEZPHCTGyxecvzG6tvIsYu+A5b1raylkA=
-github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs=
-github.com/jackc/pgx/v4 v4.16.1 h1:JzTglcal01DrghUqt+PmzWsZx/Yh7SC/CTQmSBMTd0Y=
-github.com/jackc/pgx/v4 v4.16.1/go.mod h1:SIhx0D5hoADaiXZVyv+3gSm3LCIIINTVO0PficsvWGQ=
+github.com/jackc/pgx/v5 v5.3.1 h1:Fcr8QJ1ZeLi5zsPZqQeUZhNhxfkkKBOgJuYkJHoBOtU=
+github.com/jackc/pgx/v5 v5.3.1/go.mod h1:t3JDKnCBlYIc0ewLF0Q7B8MXmoIaBOZj/ic7iHozM/8=
github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
github.com/jackc/puddle v1.1.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
github.com/jackc/puddle v1.1.1/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
-github.com/jackc/puddle v1.2.1/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
-github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc=
-github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU=
-github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
-github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
github.com/jinzhu/now v1.1.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
@@ -918,7 +811,6 @@ github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUB
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
-github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
@@ -927,16 +819,13 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
-github.com/jsternberg/zap-logfmt v1.0.0/go.mod h1:uvPs/4X51zdkcm5jXl5SYoN+4RK21K8mysFmDaM/h+o=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes=
github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes=
-github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F6iIOGgxJ5npU/IUOhOhqlVrGjyIZc8/MagT0=
github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k=
github.com/k0kubun/pp v2.3.0+incompatible/go.mod h1:GWse8YhT0p8pT4ir3ZgBbfZild3tgzSScAn6HmfYukg=
-github.com/karalabe/usb v0.0.2/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU=
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8=
github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4=
github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA=
@@ -946,8 +835,6 @@ github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvW
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
-github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4=
-github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
github.com/klauspost/compress v1.11.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
github.com/klauspost/compress v1.11.13/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
@@ -956,16 +843,12 @@ github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8
github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
github.com/klauspost/compress v1.15.0/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
github.com/klauspost/compress v1.15.6/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU=
-github.com/klauspost/compress v1.15.9 h1:wKRjX6JRtDdrE9qwa4b/Cip7ACOshUI4smpCQanqjSY=
-github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU=
-github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
+github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I=
+github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
-github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
-github.com/klauspost/cpuid/v2 v2.1.0 h1:eyi1Ad2aNJMW95zcSbmGg7Cg6cq3ADwLpMAP96d8rF0=
-github.com/klauspost/cpuid/v2 v2.1.0/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY=
-github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg=
-github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs=
+github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg=
+github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
@@ -974,8 +857,9 @@ github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFB
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
-github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
+github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
+github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA=
github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw=
@@ -983,27 +867,22 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/ktrysmt/go-bitbucket v0.6.4/go.mod h1:9u0v3hsd2rqCHRIpbir1oP7F58uo5dq19sBYvuMoyQ4=
-github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
-github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4FW1e6jwpg=
-github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k=
-github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8=
-github.com/leodido/go-urn v1.1.0/go.mod h1:+cyI34gQWZcE1eQU7NVgKkkzdXDQHr1dBMtdAPozLkw=
-github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w=
github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY=
+github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q=
+github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4=
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
+github.com/lib/pq v1.10.0 h1:Zx5DJFEYQXio93kgXnQ09fXNiUKsqv4OUEu2UtGcB1E=
github.com/lib/pq v1.10.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
-github.com/lib/pq v1.10.2 h1:AqzbZs4ZoCBp+GtejcpCpcxM3zlSMx29dXbUSeVtJb8=
-github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/linuxkit/virtsock v0.0.0-20201010232012-f8cee7dfc7a3/go.mod h1:3r6x7q95whyfWQpmGZTu3gk3v2YkMi05HEzl7Tf7YEo=
github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc87/1qhoTACD8w=
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
-github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo=
-github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60=
+github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
+github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
@@ -1015,18 +894,12 @@ github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsI
github.com/markbates/pkger v0.15.1/go.mod h1:0JoVlrol20BSywW79rN3kdFFsE5xYM+rSCQDXbLhiuI=
github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0=
github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho=
-github.com/matryer/moq v0.0.0-20190312154309-6cfb0558e1bd/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ=
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
-github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
-github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
-github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
-github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40=
-github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
-github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc=
-github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc=
+github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
+github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-ieproxy v0.0.1/go.mod h1:pYabZ6IHcRpFh7vIaLfK7rdcWgFEb3SFJ6/gNWuh88E=
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
@@ -1035,35 +908,33 @@ github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
-github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
+github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
+github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA=
+github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
-github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
-github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-shellwords v1.0.3/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o=
github.com/mattn/go-shellwords v1.0.6/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o=
github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y=
github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
-github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
github.com/mattn/go-sqlite3 v1.14.3/go.mod h1:WVKg1VTActs4Qso6iwGbiFih2UIHo0ENGwNd0Lj+XmI=
github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
github.com/mattn/go-sqlite3 v1.14.10/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
-github.com/mattn/go-sqlite3 v1.14.12 h1:TJ1bhYJPV44phC+IMu1u2K/i5RriLTPe+yc68XDJ1Z0=
-github.com/mattn/go-sqlite3 v1.14.12/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
-github.com/mattn/go-tty v0.0.0-20180907095812-13ff1204f104/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE=
+github.com/mattn/go-sqlite3 v1.14.17 h1:mCRHCLDUBXgpKAqIKsaAaAsrAlbkeomtRFKXh2L6YIM=
+github.com/mattn/go-sqlite3 v1.14.17/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2/go.mod h1:eD9eIE7cdwcMi9rYluz88Jz2VyhSmden33/aXg4oVIY=
-github.com/meilisearch/meilisearch-go v0.21.0 h1:SwYMWJVi6vDdSDJdOmbkJ4T26PavjYc4MlZcJZF9+Qs=
-github.com/meilisearch/meilisearch-go v0.21.0/go.mod h1:3dvPYZGUWu40qHoTK187fmqF2lrarboPa5m2Yu2Seh4=
+github.com/meilisearch/meilisearch-go v0.25.0 h1:xIp+8YWterHuDvpdYlwQ4Qp7im3JlRHmSKiP0NvjyXs=
+github.com/meilisearch/meilisearch-go v0.25.0/go.mod h1:SxuSqDcPBIykjWz1PX+KzsYzArNLSCadQodWs8extS0=
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs=
github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34=
github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM=
-github.com/minio/minio-go/v7 v7.0.45 h1:g4IeM9M9pW/Lo8AGGNOjBZYlvmtlE1N5TQEYWXRWzIs=
-github.com/minio/minio-go/v7 v7.0.45/go.mod h1:nCrRzjoSUQh8hgKKtu3Y708OLvRLtuASMg2/nvmbarw=
-github.com/minio/sha256-simd v1.0.0 h1:v1ta+49hkWZyvaKwrQB8elexRqm6Y0aMLjCNsrYxo6g=
-github.com/minio/sha256-simd v1.0.0/go.mod h1:OuYzVNI5vcoYIAmbIvHPl3N3jUzVedXbKy5RFepssQM=
+github.com/minio/minio-go/v7 v7.0.61 h1:87c+x8J3jxQ5VUGimV9oHdpjsAvy3fhneEBKuoKEVUI=
+github.com/minio/minio-go/v7 v7.0.61/go.mod h1:BTu8FcrEw+HidY0zd/0eny43QnVNkXRPXrLXFuQBHXg=
+github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM=
+github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8=
github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible/go.mod h1:8AuVvqP/mXw1px98n46wfvcGfQ4ci2FwoAjKYxuo3Z4=
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
@@ -1074,12 +945,10 @@ github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0Qu
github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mitchellh/mapstructure v0.0.0-20180220230111-00c29f56e238/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
-github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f/go.mod h1:OkQIRizQZAeMln+1tSwduZz7+Af5oFlKirV/MSYes2A=
-github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4=
github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc=
github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c=
github.com/moby/sys/mountinfo v0.4.0/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A=
@@ -1102,11 +971,9 @@ github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjY
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A=
github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc=
+github.com/mozillazg/go-httpheader v0.2.1 h1:geV7TrjbL8KXSyvghnFm+NyTux/hxwueTSrwhe88TQQ=
github.com/mozillazg/go-httpheader v0.2.1/go.mod h1:jJ8xECTlalr6ValeXYdOF8fFUISeBAdw6E61aqQma60=
-github.com/mozillazg/go-httpheader v0.3.1 h1:IRP+HFrMX2SlwY9riuio7raffXUpzAosHtZu25BSJok=
-github.com/mozillazg/go-httpheader v0.3.1/go.mod h1:PuT8h0pw6efvp8ZeUec1Rs7dwjK08bt6gKSReGMqtdA=
github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ=
-github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg=
github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/mutecomm/go-sqlcipher/v4 v4.4.0/go.mod h1:PyN04SaWalavxRGH9E8ZftG6Ju7rsPrGmQRjrEaVpiY=
@@ -1114,21 +981,16 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
github.com/nakagami/firebirdsql v0.0.0-20190310045651-3c02a58cfed8/go.mod h1:86wM1zFnC6/uDBfZGNwB65O+pR2OFi5q/YQaEUid1qA=
-github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0=
-github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E=
github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM=
github.com/neo4j/neo4j-go-driver v1.8.1-0.20200803113522-b626aa943eba/go.mod h1:ncO5VaFWh0Nrt+4KT4mOZboaczBZcLuHrG+/sUeP8gI=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
-github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
-github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
github.com/onsi/ginkgo v0.0.0-20151202141238-7f8ab55aaf3b/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
-github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
@@ -1137,12 +999,11 @@ github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0=
github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
-github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc=
github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0=
+github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU=
+github.com/onsi/ginkgo/v2 v2.11.0/go.mod h1:ZhrRA5XmEE3x3rhlzamx/JJvujdZoJ2uvgI7kR0iZvM=
github.com/onsi/gomega v0.0.0-20151007035656-2152b45fa28a/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
-github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
-github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
@@ -1150,8 +1011,8 @@ github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoT
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc=
github.com/onsi/gomega v1.15.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0=
-github.com/onsi/gomega v1.16.0 h1:6gjqkI8iiRHMvdccRJM8rVKjCWk6ZIm6FTm3ddIe4/c=
-github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
+github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
+github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M=
github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
@@ -1181,27 +1042,21 @@ github.com/opencontainers/selinux v1.6.0/go.mod h1:VVGKuOLlE7v4PJyT6h7mNWvq1rzqi
github.com/opencontainers/selinux v1.8.0/go.mod h1:RScLhm78qiWa2gbVCcGkC7tCGdgk3ogry1nUQF8Evvo=
github.com/opencontainers/selinux v1.8.2/go.mod h1:MUIHuUEvKB1wtJjQdOyYRgOnLD2xAPP8dBsCoU0KuF8=
github.com/opencontainers/selinux v1.10.0/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI=
-github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
-github.com/opentracing/opentracing-go v1.0.3-0.20180606204148-bd9c31933947/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
-github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChlfo5C6hzIHwPqfFE=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE=
github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc=
github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
-github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8=
-github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
-github.com/pelletier/go-toml/v2 v2.0.5 h1:ipoSadvV8oGUjnUbMub59IDPPwfxF694nG/jwbMiyQg=
-github.com/pelletier/go-toml/v2 v2.0.5/go.mod h1:OMHamSCAODeSsVrwwvcJOaoN0LIUIaFVNZzmWyNfXas=
+github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo=
+github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ=
+github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4=
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
-github.com/peterh/liner v1.0.1-0.20180619022028-8c1271fcf47f/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc=
-github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0=
-github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU=
github.com/phpdave11/gofpdf v1.4.2/go.mod h1:zpO6xFn9yxo3YLyMvW8HcKWVdbNqgIfOOp2dXMnm1mY=
github.com/phpdave11/gofpdi v1.0.12/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI=
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pierrec/lz4/v4 v4.1.8/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
+github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4=
github.com/pkg/browser v0.0.0-20210706143420-7d21f8c997e2/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI=
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
@@ -1212,11 +1067,11 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI=
github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg=
-github.com/pkg/term v0.0.0-20180730021639-bffc007b7fd5/go.mod h1:eCbImbZ95eXtAUIbLAuAVnBnwf83mjf6QIVH8SHYwqQ=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA=
+github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g=
github.com/prometheus/client_golang v0.0.0-20180209125602-c332b6f63c06/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso=
@@ -1250,23 +1105,28 @@ github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O
github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
+github.com/pyroscope-io/client v0.7.1 h1:yFRhj3vbgjBxehvxQmedmUWJQ4CAfCHhn+itPsuWsHw=
+github.com/pyroscope-io/client v0.7.1/go.mod h1:4h21iOU4pUOq0prKyDlvYRL+SCKsBc5wKiEtV+rJGqU=
+github.com/pyroscope-io/godeltaprof v0.1.0 h1:UBqtjt0yZi4jTxqZmLAs34XG6ycS3vUTlhEUSq4NHLE=
+github.com/pyroscope-io/godeltaprof v0.1.0/go.mod h1:psMITXp90+8pFenXkKIpNhrfmI9saQnPbba27VIaiQE=
+github.com/redis/rueidis v1.0.14 h1:qdFZahk1F/2L+sZeOECx5E2N5J4Qc51b7ezSUpQXJfs=
+github.com/redis/rueidis v1.0.14/go.mod h1:8B+r5wdnjwK3lTFml5VtxjzGOQAC+5UmujoD12pDrEo=
github.com/remyoudompheng/bigfft v0.0.0-20190728182440-6a916e37a237/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
-github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 h1:OdAsTTz6OkFY5QxjkYwrChwuRruF69c169dPK26NUlk=
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
-github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52/go.mod h1:RDpi1RftBQPUCDRw6SmxeaREsAaRKnOclghuzp/WRzc=
-github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho=
+github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
+github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
-github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8=
github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE=
-github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU=
+github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
+github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
-github.com/rs/xid v1.4.0 h1:qd7wPTDkN6KQx2VmMBLrpHkiyQwgFXRnkOLacUiaSNY=
-github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
+github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc=
+github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU=
github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
@@ -1274,20 +1134,14 @@ github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfF
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/safchain/ethtool v0.0.0-20190326074333-42ed695e3de8/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4=
github.com/safchain/ethtool v0.0.0-20210803160452-9aa261dae9b1/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4=
-github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww=
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw=
github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo=
github.com/seccomp/libseccomp-golang v0.9.2-0.20210429002308-3879420cc921/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg=
-github.com/segmentio/kafka-go v0.1.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo=
-github.com/segmentio/kafka-go v0.2.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo=
-github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
-github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4=
github.com/shopspring/decimal v0.0.0-20200227202807-02e2044944cc/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
-github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ=
github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc=
@@ -1299,28 +1153,34 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
-github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
-github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
-github.com/smartwalle/alipay/v3 v3.1.7 h1:J4U5slABafKVD/b9gPCZe/3HAPB8Pa2NOYOPcugEJBo=
-github.com/smartwalle/alipay/v3 v3.1.7/go.mod h1:cZUMCCnsux9YAxA0/f3PWUR+7wckWtE1BqxbVRtGij0=
-github.com/smartwalle/crypto4go v1.0.2 h1:9DUEOOsPhmp00438L4oBdcL8EZG1zumecft5bWj5phI=
-github.com/smartwalle/crypto4go v1.0.2/go.mod h1:LQ7vCZIb7BE5+MuMtJBuO8ORkkQ01m4DXDBWPzLbkMY=
+github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
+github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
+github.com/smartwalle/alipay/v3 v3.2.15 h1:3fvFJnINKKAOXHR/Iv20k1Z7KJ+nOh3oK214lELPqG8=
+github.com/smartwalle/alipay/v3 v3.2.15/go.mod h1:niTNB609KyUYuAx9Bex/MawEjv2yPx4XOjxSAkqmGjE=
+github.com/smartwalle/ncrypto v1.0.2 h1:pTAhCqtPCMhpOwFXX+EcMdR6PNzruBNoGQrN2S1GbGI=
+github.com/smartwalle/ncrypto v1.0.2/go.mod h1:Dwlp6sfeNaPMnOxMNayMTacvC5JGEVln3CVdiVDgbBk=
+github.com/smartwalle/ngx v1.0.6 h1:JPNqNOIj+2nxxFtrSkJO+vKJfeNUSEQueck/Wworjps=
+github.com/smartwalle/ngx v1.0.6/go.mod h1:mx/nz2Pk5j+RBs7t6u6k22MPiBG/8CtOMpCnALIG8Y0=
+github.com/smartwalle/nsign v1.0.8 h1:78KWtwKPrdt4Xsn+tNEBVxaTLIJBX9YRX0ZSrMUeuHo=
+github.com/smartwalle/nsign v1.0.8/go.mod h1:eY6I4CJlyNdVMP+t6z1H6Jpd4m5/V+8xi44ufSTxXgc=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/snowflakedb/gosnowflake v1.6.3/go.mod h1:6hLajn6yxuJ4xUHZegMekpq9rnQbGJ7TMwXjgTmA6lg=
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0=
+github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo=
+github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4=
github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I=
-github.com/spf13/afero v1.9.2 h1:j49Hj62F0n+DaZ1dDCvhABaPNSGNkt32oRFxI33IEMw=
-github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y=
+github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM=
+github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ=
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
-github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w=
-github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU=
+github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA=
+github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48=
github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE=
@@ -1336,9 +1196,8 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE=
github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg=
-github.com/spf13/viper v1.14.0 h1:Rg7d3Lo706X9tHsJMUjdiwMpHB7W8WnSVOssIY+JElU=
-github.com/spf13/viper v1.14.0/go.mod h1:WT//axPky3FdvXHzGw33dNdXXXfFQqmEalje+egj8As=
-github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q=
+github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc=
+github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg=
github.com/stefanberger/go-pkcs11uri v0.0.0-20201008174630-78d3cae3a980/go.mod h1:AO3tvPzVZ/ayst6UlUKUv6rcPQInYe3IknH3jYhAKu8=
github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8=
github.com/stretchr/objx v0.0.0-20180129172003-8a3f7159479f/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
@@ -1346,8 +1205,8 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
+github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v0.0.0-20180303142811-b89eecf5ca5d/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
-github.com/stretchr/testify v1.2.0/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
@@ -1356,47 +1215,42 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
-github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
+github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
+github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
+github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY=
+github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
-github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs=
-github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0=
+github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8=
+github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0=
github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
-github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc=
github.com/tchap/go-patricia v2.2.6+incompatible/go.mod h1:bmLyhP68RS6kStMGxByiQ23RP/odRBOTVjwp2cDyi6I=
-github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.194/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y=
-github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/kms v1.0.194/go.mod h1:yrBKWhChnDqNz1xuXdSbWXG56XawEq0G5j1lg4VwBD4=
-github.com/tencentyun/cos-go-sdk-v5 v0.7.35 h1:XVk5GQ4eH1q+DBUJfpaMMdU9TJZWMjwNNwv0PG5nbLQ=
-github.com/tencentyun/cos-go-sdk-v5 v0.7.35/go.mod h1:4dCEtLHGh8QPxHEkgq+nFaky7yZxQuYwgSJM87icDaw=
+github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.563/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y=
+github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/kms v1.0.563/go.mod h1:uom4Nvi9W+Qkom0exYiJ9VWJjXwyxtPYTkKkaLMlfE0=
+github.com/tencentyun/cos-go-sdk-v5 v0.7.42 h1:Up1704BJjI5orycXKjpVpvuOInt9GC5pqY4knyE9Uds=
+github.com/tencentyun/cos-go-sdk-v5 v0.7.42/go.mod h1:LUFnaqRmGk6pEHOaRmdn2dCZR2j0cSsM5xowWFPTPao=
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
-github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE=
-github.com/tklauser/go-sysconf v0.3.5/go.mod h1:MkWzOF4RMCshBAMXuhXJs64Rte09mITnppBXY/rYEFI=
-github.com/tklauser/numcpus v0.2.2/go.mod h1:x3qojaO3uyYt0i56EW/VUYs7uBvdl2fkfZFu0T9wgjM=
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c/go.mod h1:hzIxponao9Kjc7aWznkXaL4U4TWaDSs8zcsY4Ka08nM=
github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=
github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
-github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs=
github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc=
-github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw=
github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M=
-github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY=
-github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0=
github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY=
+github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU=
+github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
-github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI=
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
-github.com/valyala/fasthttp v1.37.1-0.20220607072126-8a320890c08d h1:xS9QTPgKl9ewGsAOPc+xW7DeStJDqYPfisDmeSCcbco=
github.com/valyala/fasthttp v1.37.1-0.20220607072126-8a320890c08d/go.mod h1:t/G+3rLek+CyY9bnIE+YlMRddxVAAGjhxndDB4i4C0I=
-github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8=
-github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
+github.com/valyala/fasthttp v1.40.0 h1:CRq/00MfruPGFLTQKY8b+8SfdK60TxNztjRMnH0t1Yc=
+github.com/valyala/fasthttp v1.40.0/go.mod h1:t/G+3rLek+CyY9bnIE+YlMRddxVAAGjhxndDB4i4C0I=
github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc=
github.com/vishvananda/netlink v0.0.0-20181108222139-023a6dafdcdf/go.mod h1:+SR5DhBJrl6ZM7CoCKvpw5BKroDKQ+PJqOg65H/2ktk=
github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE=
@@ -1406,7 +1260,6 @@ github.com/vishvananda/netns v0.0.0-20180720170159-13995c7128cc/go.mod h1:ZjcWmF
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU=
github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0=
github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0=
-github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4=
github.com/willf/bitset v1.1.11-0.20200630133818-d5bec3311243/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4=
github.com/willf/bitset v1.1.11/go.mod h1:83CECat5yLh5zVOf4P1ErAgKA5UDvKtgyUABdr3+MjI=
github.com/xanzy/go-gitlab v0.15.0/go.mod h1:8zdQa/ri1dfn8eS3Ir1SyfvOKlw7WBJ8DVThkpGiXrs=
@@ -1417,7 +1270,6 @@ github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
-github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg=
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
github.com/yinheli/mahonia v0.0.0-20131226213531-0eef680515cc h1:7VHQaaNwHymWbj8lAcXMYX1qopebSBHwYC3ceXLWONU=
github.com/yinheli/mahonia v0.0.0-20131226213531-0eef680515cc/go.mod h1:Pcc297eVCbkDBBVq8FbnI+qDUeIMrHy4Bo7nveAuCAs=
@@ -1476,25 +1328,24 @@ go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqe
go.opentelemetry.io/proto/otlp v0.11.0/go.mod h1:QpEjXPrNQzrFDZgoTo49dgHR9RYRSrg3NAKnUGl9YpQ=
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
-go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE=
go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
+go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8=
+go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0=
go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A=
go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
-go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4=
go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU=
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA=
go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
-go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM=
go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo=
-golang.org/x/arch v0.0.0-20210923205945-b76863e36670 h1:18EFjUmQOcUvxNYSkA6jO9VAiXCnxFY6NyDX0bHDmkU=
golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
-golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
+golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k=
+golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181009213950-7c1a557ab941/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
@@ -1503,37 +1354,28 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk
golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE=
golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE=
-golang.org/x/crypto v0.0.0-20190506204251-e1dfcc566284/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
-golang.org/x/crypto v0.0.0-20190909091759-094676da4a83/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
-golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
-golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
-golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
-golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
-golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
-golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
-golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
-golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
-golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa h1:zuSxTR4o9y82ebqCUJYNGJbGPo6sKVl54f/TVDObg1c=
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
+golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA=
+golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio=
golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
@@ -1557,9 +1399,8 @@ golang.org/x/image v0.0.0-20200119044424-58c23975cae1/go.mod h1:FeLwcggjj3mMvU+o
golang.org/x/image v0.0.0-20200430140353-33d19683fad8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.0.0-20200618115811-c13761719519/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.0.0-20201208152932-35266b937fa6/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
+golang.org/x/image v0.0.0-20210216034530-4410531fe030 h1:lP9pYkih3DUSC641giIXa2XqfTIbbbRr0w2EOTA7wHA=
golang.org/x/image v0.0.0-20210216034530-4410531fe030/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
-golang.org/x/image v0.0.0-20220413100746-70e8d0d3baa9 h1:LRtI4W37N+KFebI/qV0OFiLUv4GLOWeEW5hn/KEJvxE=
-golang.org/x/image v0.0.0-20220413100746-70e8d0d3baa9/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
@@ -1584,10 +1425,9 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro=
-golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s=
-golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
+golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk=
+golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -1629,7 +1469,6 @@ golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/
golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
-golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
@@ -1639,7 +1478,6 @@ golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwY
golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
-golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
@@ -1649,7 +1487,6 @@ golang.org/x/net v0.0.0-20210505024714-0287a6fb4125/go.mod h1:9nx3DQGgdP8bBQD5qx
golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
-golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
@@ -1658,8 +1495,8 @@ golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qx
golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220111093109-d55c255bac03/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
-golang.org/x/net v0.0.0-20221014081412-f15817d10f9b h1:tvrvnPFcdzp294diPnrdZZZ8XUt2Tyj7svb7X52iDuU=
-golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
+golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50=
+golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA=
golang.org/x/oauth2 v0.0.0-20180227000427-d7d64896b5ff/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
@@ -1690,6 +1527,7 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI=
golang.org/x/sys v0.0.0-20180224232135-f6cff0780e54/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -1734,7 +1572,6 @@ golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200107162124-548cf772de50/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200120151820-655fe14d7479/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -1757,9 +1594,7 @@ golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200817155316-9781c653f443/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200828194041-157a740278f4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -1783,12 +1618,10 @@ golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210304124612-50617c2ba197/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210420205809-ac73e9fd8988/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -1809,8 +1642,6 @@ golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20210903071746-97244b99971b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210906170528-6f6e22806c34/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
@@ -1819,10 +1650,13 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220111092808-5a964db01320/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220317061510-51cd9980dadf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20220908164124-27713097b956 h1:XeJjHH1KiLpKGb6lvMiksZ9l0fVUh+AmGcm0nOMEBOY=
+golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA=
+golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
@@ -1837,20 +1671,19 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
-golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg=
-golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
+golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4=
+golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
-golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20220224211638-0e9765cccd65/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
-golang.org/x/time v0.0.0-20220609170525-579cf78fd858 h1:Dpdu/EMxGMFgq0CeYMh4fazTD2vtlZRYE7wyynxJb9U=
-golang.org/x/time v0.0.0-20220609170525-579cf78fd858/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
+golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
+golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
@@ -1893,8 +1726,6 @@ golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtn
golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200108203644-89082a384178/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
@@ -1932,8 +1763,8 @@ golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
-golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU=
-golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
+golang.org/x/tools v0.9.3 h1:Gn1I8+64MsuTb/HpH+LmQtNas23LhUVr3rYZ0eKuaMM=
+golang.org/x/tools v0.9.3/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc=
golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
@@ -1941,11 +1772,8 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo=
-gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo=
-gonum.org/v1/gonum v0.6.0/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU=
gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0=
gonum.org/v1/gonum v0.9.3/go.mod h1:TZumC3NeyVQskjXqmyWt4S3bINhy7B4eYwW69EbyX+0=
-gonum.org/v1/netlib v0.0.0-20181029234149-ec6d1f5cefe6/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw=
gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw=
gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc=
gonum.org/v1/plot v0.9.0/go.mod h1:3Pcqqmp6RHvJI72kgb8fThyUnav364FOsdDo2aGW5lY=
@@ -1997,7 +1825,6 @@ google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRn
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190522204451-c2c4e71fbf69/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s=
-google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
@@ -2005,7 +1832,6 @@ google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvx
google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
-google.golang.org/genproto v0.0.0-20200108215221-bd8f9a0ef82f/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200117163144-32f20d992d24/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
@@ -2065,8 +1891,8 @@ google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ6
google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20220111164026-67b88f271998/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E=
-google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e h1:S9GbmC1iCgvbLyAokVCwiO6tVIrU9Y7c5oMx1V/ki/Y=
-google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 h1:0nDDozoAU19Qb2HwhXadU8OcsiO/09cnTqhUtq2MEOM=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA=
google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
@@ -2100,8 +1926,8 @@ google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9K
google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU=
google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU=
google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ=
-google.golang.org/grpc v1.50.1 h1:DS/BukOZWp8s6p4Dt/tOaJaTQyPyOoCcrjroHuCeLzY=
-google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI=
+google.golang.org/grpc v1.57.0 h1:kfzNeI/klCGD2YPMUlaGNT3pxvYfga7smW3Vth8Zsiw=
+google.golang.org/grpc v1.57.0/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo=
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
@@ -2116,8 +1942,9 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
-google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w=
-google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
+google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
+google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
+google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
@@ -2131,25 +1958,20 @@ gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qS
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo=
-gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE=
-gopkg.in/go-playground/validator.v9 v9.29.1/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ=
gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
-gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8=
gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k=
-gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c=
-gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns=
+gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc=
+gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc=
gopkg.in/resty.v1 v1.12.0 h1:CuXP0Pjfw9rOuY6EP+UvtNvt5DSqHpIxILZKT/quCZI=
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
-gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
-gopkg.in/urfave/cli.v1 v1.20.0/go.mod h1:vuBzUtMdQeixQj8LVd+/98pzhxNGQoyuPBlsXHOQNO0=
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
@@ -2159,34 +1981,33 @@ gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
-gorm.io/driver/mysql v1.0.3/go.mod h1:twGxftLBlFgNVNakL7F+P/x9oYqoymG3YYT8cAfI9oI=
-gorm.io/driver/mysql v1.3.4 h1:/KoBMgsUHC3bExsekDcmNYaBnfH2WNeFuXqqrqMc98Q=
-gorm.io/driver/mysql v1.3.4/go.mod h1:s4Tq0KmD0yhPGHbZEwg1VPlH0vT/GBHJZorPzhcxBUE=
+gorm.io/driver/mysql v1.4.3/go.mod h1:sSIebwZAVPiT+27jK9HIwvsqOGKx3YMPmrA3mBJR10c=
+gorm.io/driver/mysql v1.5.1 h1:WUEH5VF9obL/lTtzjmML/5e6VfFR/788coz2uaVCAZw=
+gorm.io/driver/mysql v1.5.1/go.mod h1:Jo3Xu7mMhCyj8dlrb3WoCaRd1FhsVh+yMXb1jUInf5o=
gorm.io/driver/postgres v1.0.8/go.mod h1:4eOzrI1MUfm6ObJU/UcmbXyiHSs8jSwH95G5P5dxcAg=
-gorm.io/driver/postgres v1.3.7 h1:FKF6sIMDHDEvvMF/XJvbnCl0nu6KSKUaPXevJ4r+VYQ=
-gorm.io/driver/postgres v1.3.7/go.mod h1:f02ympjIcgtHEGFMZvdgTxODZ9snAHDb4hXfigBVuNI=
+gorm.io/driver/postgres v1.5.2 h1:ytTDxxEv+MplXOfFe3Lzm7SjG09fcdb3Z/c056DTBx0=
+gorm.io/driver/postgres v1.5.2/go.mod h1:fmpX0m2I1PKuR7mKZiEluwrP3hbs+ps7JIGMUBpCgl8=
gorm.io/driver/sqlite v1.1.3/go.mod h1:AKDgRWk8lcSQSw+9kxCJnX/yySj8G3rdwYlU57cB45c=
-gorm.io/driver/sqlite v1.3.4 h1:NnFOPVfzi4CPsJPH4wXr6rMkPb4ElHEqKMvrsx9c9Fk=
-gorm.io/driver/sqlite v1.3.4/go.mod h1:B+8GyC9K7VgzJAcrcXMRPdnMcck+8FgJynEehEPM16U=
+gorm.io/driver/sqlite v1.5.2 h1:TpQ+/dqCY4uCigCFyrfnrJnrW9zjpelWVoEVNy5qJkc=
+gorm.io/driver/sqlite v1.5.2/go.mod h1:qxAuCol+2r6PannQDpOP1FP6ag3mKi4esLnB/jHed+4=
gorm.io/gorm v1.20.1/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw=
-gorm.io/gorm v1.20.4/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw=
-gorm.io/gorm v1.20.11/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw=
gorm.io/gorm v1.20.12/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw=
gorm.io/gorm v1.21.4/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw=
gorm.io/gorm v1.23.0/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk=
-gorm.io/gorm v1.23.4 h1:1BKWM67O6CflSLcwGQR7ccfmC4ebOxQrTfOQGRE9wjg=
-gorm.io/gorm v1.23.4/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk=
-gorm.io/plugin/dbresolver v1.1.0 h1:cegr4DeprR6SkLIQlKhJLYxH8muFbJ4SmnojXvoeb00=
-gorm.io/plugin/dbresolver v1.1.0/go.mod h1:tpImigFAEejCALOttyhWqsy4vfa2Uh/vAUVnL5IRF7Y=
-gorm.io/plugin/soft_delete v1.1.0 h1:LcE4L+GD29RkkMLxMYHpT4wQCJ/9945FsdU/mHGaDuE=
-gorm.io/plugin/soft_delete v1.1.0/go.mod h1:Zv7vQctOJTGOsJ/bWgrN1n3od0GBAZgnLjEx+cApLGk=
+gorm.io/gorm v1.23.8/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk=
+gorm.io/gorm v1.25.1/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k=
+gorm.io/gorm v1.25.2 h1:gs1o6Vsa+oVKG/a9ElL3XgyGfghFfkKA2SInQaCyMho=
+gorm.io/gorm v1.25.2/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k=
+gorm.io/plugin/dbresolver v1.4.2 h1:IeLSH20ayxbo4rN6HMIQ0ccdsh/fkLK23pp6ivZrqBI=
+gorm.io/plugin/dbresolver v1.4.2/go.mod h1:l4Cn87EHLEYuqUncpEeTC2tTJQkjngPSD+lo8hIvcT0=
+gorm.io/plugin/soft_delete v1.2.1 h1:qx9D/c4Xu6w5KT8LviX8DgLcB9hkKl6JC9f44Tj7cGU=
+gorm.io/plugin/soft_delete v1.2.1/go.mod h1:Zv7vQctOJTGOsJ/bWgrN1n3od0GBAZgnLjEx+cApLGk=
gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk=
gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8=
@@ -2198,7 +2019,6 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
-honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las=
k8s.io/api v0.20.1/go.mod h1:KqwcCVogGxQY3nBlRpwt+wpAMF/KjaCc7RpywacvqUo=
k8s.io/api v0.20.4/go.mod h1:++lNL1AJMkDymriNniQsWRkMDzRaX2Y/POTUi8yvqYQ=
k8s.io/api v0.20.6/go.mod h1:X9e8Qag6JV/bL5G6bU8sdVRltWKmdHsFUGS3eVndqE8=
@@ -2242,20 +2062,16 @@ k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk=
k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
-lukechampine.com/uint128 v1.1.1 h1:pnxCASz787iMf+02ssImqk6OLt+Z5QHMoZyUXR4z6JU=
-lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk=
+lukechampine.com/uint128 v1.2.0 h1:mBi/5l91vocEN8otkC5bDLhi2KdCticRiwbdB0O+rjI=
+lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk=
modernc.org/b v1.0.0/go.mod h1:uZWcZfRj1BpYzfN9JTerzlNUnnPsV9O2ZA8JsRcubNg=
modernc.org/cc/v3 v3.32.4/go.mod h1:0R6jl1aZlIl2avnYfbfHBS1QB6/f+16mihBObaBC878=
-modernc.org/cc/v3 v3.36.0 h1:0kmRkTmqNidmu3c7BNDSdVHCxXCkWLmWmCIVX4LUboo=
-modernc.org/cc/v3 v3.36.0/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI=
-modernc.org/ccgo/v3 v3.0.0-20220428102840-41399a37e894/go.mod h1:eI31LL8EwEBKPpNpA4bU1/i+sKOwOrQy8D87zWUcRZc=
-modernc.org/ccgo/v3 v3.0.0-20220430103911-bc99d88307be/go.mod h1:bwdAnOoaIt8Ax9YdWGjxWsdkPcZyRPHqrOvJxaKAKGw=
+modernc.org/cc/v3 v3.40.0 h1:P3g79IUS/93SYhtoeaHW+kRCIrYaxJ27MFPv+7kaTOw=
+modernc.org/cc/v3 v3.40.0/go.mod h1:/bTg4dnWkSXowUO6ssQKnOV0yMVxDYNIsIrzqTFDGH0=
modernc.org/ccgo/v3 v3.9.2/go.mod h1:gnJpy6NIVqkETT+L5zPsQFj7L2kkhfPMzOghRNv/CFo=
-modernc.org/ccgo/v3 v3.16.4/go.mod h1:tGtX0gE9Jn7hdZFeU88slbTh1UtCYKusWOoCJuvkWsQ=
-modernc.org/ccgo/v3 v3.16.6 h1:3l18poV+iUemQ98O3X5OMr97LOqlzis+ytivU4NqGhA=
-modernc.org/ccgo/v3 v3.16.6/go.mod h1:tGtX0gE9Jn7hdZFeU88slbTh1UtCYKusWOoCJuvkWsQ=
+modernc.org/ccgo/v3 v3.16.13 h1:Mkgdzl46i5F/CNR/Kj80Ri59hC8TKAhZrYSaqvkwzUw=
+modernc.org/ccgo/v3 v3.16.13/go.mod h1:2Quk+5YgpImhPjv2Qsob1DnZ/4som1lJTodubIcoUkY=
modernc.org/ccorpus v1.11.6 h1:J16RXiiqiCgua6+ZvQot4yUuUy8zxgqbqEEUuGPlISk=
-modernc.org/ccorpus v1.11.6/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ=
modernc.org/db v1.0.0/go.mod h1:kYD/cO29L/29RM0hXYl4i3+Q5VojL31kTUVpVJDw0s8=
modernc.org/file v1.0.0/go.mod h1:uqEokAEn1u6e+J45e54dsEA/pw4o7zLrA2GwyntZzjw=
modernc.org/fileutil v1.0.0/go.mod h1:JHsWpkrk/CnVV1H/eGlFf85BEpfkrp56ro8nojIq9Q8=
@@ -2263,41 +2079,38 @@ modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk=
modernc.org/httpfs v1.0.6 h1:AAgIpFZRXuYnkjftxTAZwMIiwEqAfk8aVB2/oA6nAeM=
modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM=
modernc.org/internal v1.0.0/go.mod h1:VUD/+JAkhCpvkUitlEOnhpVxCgsBI90oTzSCRcqQVSM=
-modernc.org/libc v0.0.0-20220428101251-2d5f3daf273b/go.mod h1:p7Mg4+koNjc8jkqwcoFBJx7tXkpj00G77X7A72jXPXA=
modernc.org/libc v1.7.13-0.20210308123627-12f642a52bb8/go.mod h1:U1eq8YWr/Kc1RWCMFUWEdkTg8OTcfLw2kY8EDwl039w=
modernc.org/libc v1.9.5/go.mod h1:U1eq8YWr/Kc1RWCMFUWEdkTg8OTcfLw2kY8EDwl039w=
-modernc.org/libc v1.16.0/go.mod h1:N4LD6DBE9cf+Dzf9buBlzVJndKr/iJHG97vGLHYnb5A=
-modernc.org/libc v1.16.1/go.mod h1:JjJE0eu4yeK7tab2n4S1w8tlWd9MxXLRzheaRnAKymU=
-modernc.org/libc v1.16.7 h1:qzQtHhsZNpVPpeCu+aMIQldXeV1P0vRhSqCL0nOIJOA=
-modernc.org/libc v1.16.7/go.mod h1:hYIV5VZczAmGZAnG15Vdngn5HSF5cSkbvfz2B7GRuVU=
+modernc.org/libc v1.24.1 h1:uvJSeCKL/AgzBo2yYIPPTy82v21KgGnizcGYfBHaNuM=
+modernc.org/libc v1.24.1/go.mod h1:FmfO1RLrU3MHJfyi9eYYmZBfi/R+tqZ6+hQ3yQQUkak=
modernc.org/lldb v1.0.0/go.mod h1:jcRvJGWfCGodDZz8BPwiKMJxGJngQ/5DrRapkQnLob8=
modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k=
modernc.org/mathutil v1.1.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E=
modernc.org/mathutil v1.2.2/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E=
-modernc.org/mathutil v1.4.1 h1:ij3fYGe8zBF4Vu+g0oT7mB06r8sqGWKuJu1yXeR4by8=
-modernc.org/mathutil v1.4.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E=
+modernc.org/mathutil v1.5.0 h1:rV0Ko/6SfM+8G+yKiyI830l3Wuz1zRutdslNoQ0kfiQ=
+modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E=
modernc.org/memory v1.0.4/go.mod h1:nV2OApxradM3/OVbs2/0OsP6nPfakXpi50C7dcoHXlc=
-modernc.org/memory v1.1.1 h1:bDOL0DIDLQv7bWhP3gMvIrnoFw+Eo6F7a2QK9HPDiFU=
-modernc.org/memory v1.1.1/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw=
-modernc.org/opt v0.1.1 h1:/0RX92k9vwVeDXj+Xn23DKp2VJubL7k8qNffND6qn3A=
+modernc.org/memory v1.6.0 h1:i6mzavxrE9a30whzMfwf7XWVODx2r5OYXvU46cirX7o=
+modernc.org/memory v1.6.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU=
modernc.org/opt v0.1.1/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0=
+modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4=
+modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0=
modernc.org/ql v1.0.0/go.mod h1:xGVyrLIatPcO2C1JvI/Co8c0sr6y91HKFNy4pt9JXEY=
modernc.org/sortutil v1.1.0/go.mod h1:ZyL98OQHJgH9IEfN71VsamvJgrtRX9Dj2gX+vH86L1k=
modernc.org/sqlite v1.10.6/go.mod h1:Z9FEjUtZP4qFEg6/SiADg9XCER7aYy9a/j7Pg9P7CPs=
-modernc.org/sqlite v1.17.3 h1:iE+coC5g17LtByDYDWKpR6m2Z9022YrSh3bumwOnIrI=
-modernc.org/sqlite v1.17.3/go.mod h1:10hPVYar9C0kfXuTWGz8s0XtB8uAGymUy51ZzStYe3k=
+modernc.org/sqlite v1.25.0 h1:AFweiwPNd/b3BoKnBOfFm+Y260guGMF+0UFk0savqeA=
+modernc.org/sqlite v1.25.0/go.mod h1:FL3pVXie73rg3Rii6V/u5BoHlSoyeZeIgKZEgHARyCU=
modernc.org/strutil v1.1.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs=
-modernc.org/strutil v1.1.1 h1:xv+J1BXY3Opl2ALrBwyfEikFAj8pmqcpnfmuwUwcozs=
-modernc.org/strutil v1.1.1/go.mod h1:DE+MQQ/hjKBZS2zNInV5hhcipt5rLPWkmpbGeW5mmdw=
+modernc.org/strutil v1.1.3 h1:fNMm+oJklMGYfU9Ylcywl0CO5O6nTfaowNsh2wpPjzY=
+modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw=
modernc.org/tcl v1.5.2/go.mod h1:pmJYOLgpiys3oI4AeAafkcUfE+TKKilminxNyU/+Zlo=
-modernc.org/tcl v1.13.1 h1:npxzTwFTZYM8ghWicVIX1cRWzj7Nd8i6AqqX2p+IYao=
-modernc.org/tcl v1.13.1/go.mod h1:XOLfOwzhkljL4itZkK6T72ckMgvj0BDsnKNdZVUOecw=
-modernc.org/token v1.0.0 h1:a0jaWiNMDhDUtqOj09wvjWWAqd3q7WpBulmL9H2egsk=
+modernc.org/tcl v1.15.2 h1:C4ybAYCGJw968e+Me18oW55kD/FexcHbqH2xak1ROSY=
modernc.org/token v1.0.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM=
+modernc.org/token v1.0.1 h1:A3qvTqOwexpfZZeyI0FeGPDlSWX5pjZu9hF4lU+EKWg=
+modernc.org/token v1.0.1/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM=
modernc.org/z v1.0.1-0.20210308123920-1f282aa71362/go.mod h1:8/SRk5C/HgiQWCgXdfpb+1RvhORdkz5sw72d3jjtyqA=
modernc.org/z v1.0.1/go.mod h1:8/SRk5C/HgiQWCgXdfpb+1RvhORdkz5sw72d3jjtyqA=
-modernc.org/z v1.5.1 h1:RTNHdsrOpeoSeOF4FbzTo8gBYByaJ5xT7NgZ9ZqRiJM=
-modernc.org/z v1.5.1/go.mod h1:eWFB510QWW5Th9YGZT81s+LwvaAs3Q2yr4sP0rmLkv8=
+modernc.org/z v1.7.3 h1:zDJf6iHjrnB+WRD88stbXokugjyc0/pB91ri1gO6LZY=
modernc.org/zappy v1.0.0/go.mod h1:hHe+oGahLVII/aTTyWK/b53VDHMAGCBYYeZ9sn83HC4=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
diff --git a/internal/conf/alipay.go b/internal/conf/alipay.go
new file mode 100644
index 00000000..4f118d64
--- /dev/null
+++ b/internal/conf/alipay.go
@@ -0,0 +1,38 @@
+package conf
+
+import (
+ "sync"
+
+ "github.com/sirupsen/logrus"
+ "github.com/smartwalle/alipay/v3"
+)
+
+var (
+ _alipayClient *alipay.Client
+ _onceAlipay sync.Once
+)
+
+func MustAlipayClient() *alipay.Client {
+ _onceAlipay.Do(func() {
+ s := AlipaySetting
+ // 将 key 的验证调整到初始化阶段
+ client, err := alipay.New(s.AppID, s.PrivateKey, s.InProduction)
+ if err != nil {
+ logrus.Fatalf("alipay.New err: %s", err)
+ }
+ // 加载应用公钥证书
+ if err = client.LoadAppPublicCertFromFile(s.AppPublicCertFile); err != nil {
+ logrus.Fatalf("client.LoadAppPublicCertFromFile err: %s\n", err)
+ }
+ // 加载支付宝根证书
+ if err = client.LoadAliPayRootCertFromFile(s.RootCertFile); err != nil {
+ logrus.Fatalf("client.LoadAliPayRootCertFromFile err: %s\n", err)
+ }
+ // 加载支付宝公钥证书
+ if err = client.LoadAliPayPublicCertFromFile(s.PublicCertFile); err != nil {
+ logrus.Fatalf("client.LoadAliPayPublicCertFromFile err: %s\n", err)
+ }
+ _alipayClient = client
+ })
+ return _alipayClient
+}
diff --git a/internal/conf/conf.go b/internal/conf/conf.go
index 950d2d8a..a0dc88df 100644
--- a/internal/conf/conf.go
+++ b/internal/conf/conf.go
@@ -6,60 +6,61 @@ package conf
import (
"log"
- "sync"
"time"
"github.com/alimy/cfg"
)
var (
- loggerSetting *LoggerSettingS
- loggerFileSetting *LoggerFileSettingS
- loggerZincSetting *LoggerZincSettingS
- loggerMeiliSetting *LoggerMeiliSettingS
- redisSetting *RedisSettingS
+ loggerSetting *loggerConf
+ loggerFileSetting *loggerFileConf
+ loggerZincSetting *loggerZincConf
+ loggerMeiliSetting *loggerMeiliConf
+ sentrySetting *sentryConf
+ redisSetting *redisConf
- DatabaseSetting *DatabaseSetingS
- MysqlSetting *MySQLSettingS
- PostgresSetting *PostgresSettingS
- Sqlite3Setting *Sqlite3SettingS
- ServerSetting *HttpServerSettingS
- WebServerSetting *HttpServerSettingS
- AdminServerSetting *HttpServerSettingS
- SpaceXServerSetting *HttpServerSettingS
- BotServerSetting *HttpServerSettingS
- LocalossServerSetting *HttpServerSettingS
- FrontendWebSetting *HttpServerSettingS
- DocsServerSetting *HttpServerSettingS
- MobileServerSetting *GRPCServerSettingS
- AppSetting *AppSettingS
- CacheIndexSetting *CacheIndexSettingS
- SimpleCacheIndexSetting *SimpleCacheIndexSettingS
- BigCacheIndexSetting *BigCacheIndexSettingS
- SmsJuheSetting *SmsJuheSettings
- AlipaySetting *AlipaySettingS
- TweetSearchSetting *TweetSearchS
- ZincSetting *ZincSettingS
- MeiliSetting *MeiliSettingS
- ObjectStorage *ObjectStorageS
- AliOSSSetting *AliOSSSettingS
- COSSetting *COSSettingS
- HuaweiOBSSetting *HuaweiOBSSettingS
- MinIOSetting *MinIOSettingS
- S3Setting *S3SettingS
- LocalOSSSetting *LocalOSSSettingS
- JWTSetting *JWTSettingS
- Mutex *sync.Mutex
+ PyroscopeSetting *pyroscopeConf
+ DatabaseSetting *databaseConf
+ MysqlSetting *mysqlConf
+ PostgresSetting *postgresConf
+ Sqlite3Setting *sqlite3Conf
+ PprofServerSetting *httpServerConf
+ WebServerSetting *httpServerConf
+ AdminServerSetting *httpServerConf
+ SpaceXServerSetting *httpServerConf
+ BotServerSetting *httpServerConf
+ LocalossServerSetting *httpServerConf
+ FrontendWebSetting *httpServerConf
+ DocsServerSetting *httpServerConf
+ MobileServerSetting *grpcServerConf
+ AppSetting *appConf
+ CacheIndexSetting *cacheIndexConf
+ SimpleCacheIndexSetting *simpleCacheIndexConf
+ BigCacheIndexSetting *bigCacheIndexConf
+ RedisCacheIndexSetting *redisCacheIndexConf
+ SmsJuheSetting *smsJuheConf
+ AlipaySetting *alipayConf
+ TweetSearchSetting *tweetSearchConf
+ ZincSetting *zincConf
+ MeiliSetting *meiliConf
+ ObjectStorage *objectStorageConf
+ AliOSSSetting *aliOSSConf
+ COSSetting *cosConf
+ HuaweiOBSSetting *huaweiOBSConf
+ MinIOSetting *minioConf
+ S3Setting *s3Conf
+ LocalOSSSetting *localossConf
+ JWTSetting *jwtConf
)
func setupSetting(suite []string, noDefault bool) error {
- setting, err := NewSetting()
+ vp, err := newViper()
if err != nil {
return err
}
// initialize features configure
- ss, kv := setting.featuresInfoFrom("Features")
+ ss, kv := featuresInfoFrom(vp, "Features")
cfg.Initial(ss, kv)
if len(suite) > 0 {
cfg.Use(suite, noDefault)
@@ -67,7 +68,7 @@ func setupSetting(suite []string, noDefault bool) error {
objects := map[string]any{
"App": &AppSetting,
- "Server": &ServerSetting,
+ "PprofServer": &PprofServerSetting,
"WebServer": &WebServerSetting,
"AdminServer": &AdminServerSetting,
"SpaceXServer": &SpaceXServerSetting,
@@ -79,8 +80,11 @@ func setupSetting(suite []string, noDefault bool) error {
"CacheIndex": &CacheIndexSetting,
"SimpleCacheIndex": &SimpleCacheIndexSetting,
"BigCacheIndex": &BigCacheIndexSetting,
+ "RedisCacheIndex": &RedisCacheIndexSetting,
"Alipay": &AlipaySetting,
"SmsJuhe": &SmsJuheSetting,
+ "Pyroscope": &PyroscopeSetting,
+ "Sentry": &sentrySetting,
"Logger": &loggerSetting,
"LoggerFile": &loggerFileSetting,
"LoggerZinc": &loggerZincSetting,
@@ -102,27 +106,30 @@ func setupSetting(suite []string, noDefault bool) error {
"LocalOSS": &LocalOSSSetting,
"S3": &S3Setting,
}
- if err = setting.Unmarshal(objects); err != nil {
- return err
+ for k, v := range objects {
+ err := vp.UnmarshalKey(k, v)
+ if err != nil {
+ return err
+ }
}
JWTSetting.Expire *= time.Second
SimpleCacheIndexSetting.CheckTickDuration *= time.Second
SimpleCacheIndexSetting.ExpireTickDuration *= time.Second
BigCacheIndexSetting.ExpireInSecond *= time.Second
+ RedisCacheIndexSetting.ExpireInSecond *= time.Second
+ redisSetting.ConnWriteTimeout *= time.Second
- Mutex = &sync.Mutex{}
return nil
}
-func Initialize(suite []string, noDefault bool) {
+func Initial(suite []string, noDefault bool) {
err := setupSetting(suite, noDefault)
if err != nil {
log.Fatalf("init.setupSetting err: %v", err)
}
-
setupLogger()
- setupDBEngine()
+ initSentry()
}
func GetOssDomain() string {
@@ -154,8 +161,9 @@ func GetOssDomain() string {
}
func RunMode() string {
- if !cfg.If("Deprecated:OldWeb") {
- return ServerSetting.RunMode
- }
return AppSetting.RunMode
}
+
+func UseSentryGin() bool {
+ return cfg.If("Sentry") && sentrySetting.AttachGin
+}
diff --git a/internal/conf/config.yaml b/internal/conf/config.yaml
index c86d168a..fc86dfd4 100644
--- a/internal/conf/config.yaml
+++ b/internal/conf/config.yaml
@@ -1,49 +1,56 @@
App: # APP基础设置项
RunMode: debug
AttachmentIncomeRate: 0.8
- MaxCommentCount: 10
+ MaxCommentCount: 1000
DefaultContextTimeout: 60
DefaultPageSize: 10
MaxPageSize: 100
-Server: # 服务设置
- RunMode: debug
- HttpIp: 0.0.0.0
- HttpPort: 8008
- ReadTimeout: 60
- WriteTimeout: 60
Features:
Default: []
WebServer: # Web服务
+ RunMode: debug
HttpIp: 0.0.0.0
- HttpPort: 8010
+ HttpPort: 8008
ReadTimeout: 60
WriteTimeout: 60
AdminServer: # Admin后台运维服务
+ RunMode: debug
HttpIp: 0.0.0.0
HttpPort: 8014
ReadTimeout: 60
WriteTimeout: 60
SpaceXServer: # SpaceX服务
+ RunMode: debug
HttpIp: 0.0.0.0
HttpPort: 8012
ReadTimeout: 60
WriteTimeout: 60
BotServer: # Bot服务
+ RunMode: debug
HttpIp: 0.0.0.0
HttpPort: 8016
ReadTimeout: 60
WriteTimeout: 60
LocalossServer: # Localoss服务
+ RunMode: debug
HttpIp: 0.0.0.0
HttpPort: 8018
ReadTimeout: 60
WriteTimeout: 60
+PprofServer: # Pprof服务
+ RunMode: debug
+ HttpIp: 0.0.0.0
+ HttpPort: 6060
+ ReadTimeout: 60
+ WriteTimeout: 60
FrontendWebServer: # Web前端静态资源服务
+ RunMode: debug
HttpIp: 0.0.0.0
HttpPort: 8006
ReadTimeout: 60
WriteTimeout: 60
DocsServer: # 开发文档服务
+ RunMode: debug
HttpIp: 0.0.0.0
HttpPort: 8011
ReadTimeout: 60
@@ -70,12 +77,28 @@ SimpleCacheIndex: # 缓存泡泡广场消息流
ExpireTickDuration: 300 # 每多少秒后强制过期缓存, 设置为0禁止强制使缓存过期
BigCacheIndex: # 使用BigCache缓存泡泡广场消息流
MaxIndexPage: 1024 # 最大缓存页数,必须是2^n, 代表最大同时缓存多少页数据
+ HardMaxCacheSize: 256 # 最大缓存大小(MB),0表示无限制
+ Verbose: False # 是否打印cache操作的log
+ ExpireInSecond: 300 # 多少秒(>0)后强制过期缓存
+RedisCacheIndex: # 使用Redis缓存泡泡广场消息流
Verbose: False # 是否打印cache操作的log
ExpireInSecond: 300 # 多少秒(>0)后强制过期缓存
+Pyroscope: # Pyroscope配置
+ AppName: "paopao-ce" # application name
+ Endpoint: "http://localhost:4040" # Pyroscope server address
+ AuthToken: # Pyroscope authentication token
+ Logger: none # Pyroscope logger (standard | logrus | none)
+Sentry: # Sentry配置
+ Dsn: "http://4ea0af5cd88d4512b7e52070506c80ec@localhost:9000/2"
+ Debug: True
+ AttachStacktrace: True
+ TracesSampleRate: 1.0
+ AttachLogrus: True # logrus是否附加到Sentry
+ AttachGin: True # gin是否附加到Sentry
Logger: # 日志通用配置
Level: debug # 日志级别 panic|fatal|error|warn|info|debug|trace
LoggerFile: # 使用File写日志
- SavePath: data/paopao-ce/logs
+ SavePath: custom/data/paopao-ce/logs
FileName: app
FileExt: .log
LoggerZinc: # 使用Zinc写日志
@@ -145,7 +168,7 @@ S3: # Amazon S3 存储配置
Bucket: paopao
Domain:
LocalOSS: # 本地文件OSS存储配置
- SavePath: data/paopao-ce/oss
+ SavePath: custom/data/paopao-ce/oss
Secure: False
Bucket: paopao
Domain: 127.0.0.1:8008
@@ -165,14 +188,18 @@ Postgres: # PostgreSQL数据库
User: paopao
Password: paopao
DBName: paopao
+ Schema: public
Host: localhost
Port: 5432
SSLMode: disable
- TimeZone: Asia/Shanghai
+ ApplicationName:
Sqlite3: # Sqlite3数据库
- Path: data/sqlite3/paopao-ce.db
+ Path: custom/data/sqlite3/paopao-ce.db
Redis:
- Host: redis:6379
- Password:
- DB:
+ InitAddress:
+ - redis:6379
+ Username:
+ Password:
+ SelectDB:
+ ConnWriteTimeout: 60 # 连接写超时时间 多少秒 默认 60秒
\ No newline at end of file
diff --git a/internal/conf/db.go b/internal/conf/db.go
index 62ad7fe3..f04fc3fb 100644
--- a/internal/conf/db.go
+++ b/internal/conf/db.go
@@ -1,94 +1,68 @@
-// Copyright 2022 ROC. All rights reserved.
+// Copyright 2023 ROC. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
package conf
import (
+ "database/sql"
"sync"
- "time"
"github.com/alimy/cfg"
- "github.com/go-redis/redis/v8"
"github.com/sirupsen/logrus"
- "gorm.io/driver/mysql"
- "gorm.io/driver/postgres"
- "gorm.io/gorm"
- "gorm.io/gorm/logger"
- "gorm.io/gorm/schema"
- "gorm.io/plugin/dbresolver"
)
var (
- db *gorm.DB
- Redis *redis.Client
- once sync.Once
+ _sqldb *sql.DB
+ _onceSql sync.Once
)
-func MustGormDB() *gorm.DB {
- once.Do(func() {
+const (
+ TableAnouncement = "user"
+ TableAnouncementContent = "anouncement_content"
+ TableAttachment = "attachment"
+ TableCaptcha = "captcha"
+ TableComment = "comment"
+ TableCommentContent = "comment_content"
+ TableCommentReply = "comment_reply"
+ TableContact = "contact"
+ TableContactGroup = "contact_group"
+ TableMessage = "message"
+ TablePost = "post"
+ TablePostAttachmentBill = "post_attachment_bill"
+ TablePostCollection = "post_collection"
+ TablePostContent = "post_content"
+ TablePostStar = "post_star"
+ TableTag = "tag"
+ TableUser = "user"
+ TableWalletRecharge = "wallet_recharge"
+ TableWalletStatement = "wallet_statement"
+)
+
+type TableNameMap map[string]string
+
+func MustSqlDB() *sql.DB {
+ _onceSql.Do(func() {
var err error
- if db, err = newDBEngine(); err != nil {
- logrus.Fatalf("new gorm db failed: %s", err)
+ if _, _sqldb, err = newSqlDB(); err != nil {
+ logrus.Fatalf("new sql db failed: %s", err)
}
})
- return db
+ return _sqldb
}
-func newDBEngine() (*gorm.DB, error) {
- newLogger := logger.New(
- logrus.StandardLogger(), // io writer(日志输出的目标,前缀和日志包含的内容)
- logger.Config{
- SlowThreshold: time.Second, // 慢 SQL 阈值
- LogLevel: DatabaseSetting.logLevel(), // 日志级别
- IgnoreRecordNotFoundError: true, // 忽略ErrRecordNotFound(记录未找到)错误
- Colorful: false, // 禁用彩色打印
- },
- )
-
- config := &gorm.Config{
- Logger: newLogger,
- NamingStrategy: schema.NamingStrategy{
- TablePrefix: DatabaseSetting.TablePrefix,
- SingularTable: true,
- },
- }
-
- plugin := dbresolver.Register(dbresolver.Config{}).
- SetConnMaxIdleTime(time.Hour).
- SetConnMaxLifetime(24 * time.Hour).
- SetMaxIdleConns(MysqlSetting.MaxIdleConns).
- SetMaxOpenConns(MysqlSetting.MaxOpenConns)
-
- var (
- db *gorm.DB
- err error
- )
+func newSqlDB() (driver string, db *sql.DB, err error) {
if cfg.If("MySQL") {
- logrus.Debugln("use MySQL as db")
- if db, err = gorm.Open(mysql.Open(MysqlSetting.Dsn()), config); err == nil {
- db.Use(plugin)
- }
- } else if cfg.If("Postgres") {
- logrus.Debugln("use PostgreSQL as db")
- db, err = gorm.Open(postgres.Open(PostgresSetting.Dsn()), config)
+ driver = "mysql"
+ db, err = sql.Open(driver, MysqlSetting.Dsn())
+ } else if cfg.If("PostgreSQL") || cfg.If("Postgres") {
+ driver = "pgx"
+ db, err = sql.Open(driver, PostgresSetting.Dsn())
} else if cfg.If("Sqlite3") {
- logrus.Debugf("use Sqlite3 as db path:%s sqlite3InCgoEnabled:%t", Sqlite3Setting.Path, sqlite3InCgoEnabled)
- db, err = gormOpenSqlite3(config)
+ driver, db, err = OpenSqlite3()
} else {
- logrus.Debugln("use default of MySQL as db")
- if db, err = gorm.Open(mysql.Open(MysqlSetting.Dsn()), config); err == nil {
- db.Use(plugin)
- }
+ driver = "mysql"
+ db, err = sql.Open(driver, MysqlSetting.Dsn())
}
-
- return db, err
-}
-
-func setupDBEngine() {
- Redis = redis.NewClient(&redis.Options{
- Addr: redisSetting.Host,
- Password: redisSetting.Password,
- DB: redisSetting.DB,
- })
+ return
}
diff --git a/internal/conf/db_cgo.go b/internal/conf/db_cgo.go
index 218512a5..231dc16b 100644
--- a/internal/conf/db_cgo.go
+++ b/internal/conf/db_cgo.go
@@ -18,8 +18,9 @@ const (
sqlite3InCgoEnabled = true
)
-func OpenSqlite3() (*sql.DB, error) {
- return sql.Open("sqlite3", Sqlite3Setting.Dsn("sqlite3"))
+func OpenSqlite3() (string, *sql.DB, error) {
+ db, err := sql.Open("sqlite3", Sqlite3Setting.Dsn("sqlite3"))
+ return "sqlite3", db, err
}
func gormOpenSqlite3(opts ...gorm.Option) (*gorm.DB, error) {
diff --git a/internal/conf/db_gorm.go b/internal/conf/db_gorm.go
new file mode 100644
index 00000000..f667ff61
--- /dev/null
+++ b/internal/conf/db_gorm.go
@@ -0,0 +1,84 @@
+// Copyright 2022 ROC. All rights reserved.
+// Use of this source code is governed by a MIT style
+// license that can be found in the LICENSE file.
+
+package conf
+
+import (
+ "sync"
+ "time"
+
+ "github.com/alimy/cfg"
+ "github.com/sirupsen/logrus"
+ "gorm.io/driver/mysql"
+ "gorm.io/driver/postgres"
+ "gorm.io/gorm"
+ "gorm.io/gorm/logger"
+ "gorm.io/gorm/schema"
+ "gorm.io/plugin/dbresolver"
+)
+
+var (
+ _gormdb *gorm.DB
+ _onceGorm sync.Once
+)
+
+func MustGormDB() *gorm.DB {
+ _onceGorm.Do(func() {
+ var err error
+ if _gormdb, err = newGormDB(); err != nil {
+ logrus.Fatalf("new gorm db failed: %s", err)
+ }
+ })
+ return _gormdb
+}
+
+func newGormDB() (*gorm.DB, error) {
+ newLogger := logger.New(
+ logrus.StandardLogger(), // io writer(日志输出的目标,前缀和日志包含的内容)
+ logger.Config{
+ SlowThreshold: time.Second, // 慢 SQL 阈值
+ LogLevel: DatabaseSetting.logLevel(), // 日志级别
+ IgnoreRecordNotFoundError: true, // 忽略ErrRecordNotFound(记录未找到)错误
+ Colorful: false, // 禁用彩色打印
+ },
+ )
+
+ config := &gorm.Config{
+ Logger: newLogger,
+ NamingStrategy: schema.NamingStrategy{
+ TablePrefix: DatabaseSetting.TablePrefix,
+ SingularTable: true,
+ },
+ }
+
+ plugin := dbresolver.Register(dbresolver.Config{}).
+ SetConnMaxIdleTime(time.Hour).
+ SetConnMaxLifetime(24 * time.Hour).
+ SetMaxIdleConns(MysqlSetting.MaxIdleConns).
+ SetMaxOpenConns(MysqlSetting.MaxOpenConns)
+
+ var (
+ db *gorm.DB
+ err error
+ )
+ if cfg.If("MySQL") {
+ logrus.Debugln("use MySQL as db")
+ if db, err = gorm.Open(mysql.Open(MysqlSetting.Dsn()), config); err == nil {
+ db.Use(plugin)
+ }
+ } else if cfg.If("Postgres") {
+ logrus.Debugln("use PostgreSQL as db")
+ db, err = gorm.Open(postgres.Open(PostgresSetting.Dsn()), config)
+ } else if cfg.If("Sqlite3") {
+ logrus.Debugf("use Sqlite3 as db path:%s sqlite3InCgoEnabled:%t", Sqlite3Setting.Path, sqlite3InCgoEnabled)
+ db, err = gormOpenSqlite3(config)
+ } else {
+ logrus.Debugln("use default of MySQL as db")
+ if db, err = gorm.Open(mysql.Open(MysqlSetting.Dsn()), config); err == nil {
+ db.Use(plugin)
+ }
+ }
+
+ return db, err
+}
diff --git a/internal/conf/db_nocgo.go b/internal/conf/db_nocgo.go
index 977a6695..bbe79a50 100644
--- a/internal/conf/db_nocgo.go
+++ b/internal/conf/db_nocgo.go
@@ -19,8 +19,9 @@ const (
sqlite3InCgoEnabled = false
)
-func OpenSqlite3() (*sql.DB, error) {
- return sql.Open("sqlite", Sqlite3Setting.Dsn("sqlite"))
+func OpenSqlite3() (string, *sql.DB, error) {
+ db, err := sql.Open("sqlite", Sqlite3Setting.Dsn("sqlite"))
+ return "sqlite", db, err
}
func gormOpenSqlite3(opts ...gorm.Option) (*gorm.DB, error) {
diff --git a/internal/conf/logger.go b/internal/conf/logger.go
index cbe3cc1b..f6d08723 100644
--- a/internal/conf/logger.go
+++ b/internal/conf/logger.go
@@ -6,8 +6,11 @@ package conf
import (
"io"
+ "time"
"github.com/alimy/cfg"
+ "github.com/getsentry/sentry-go"
+ sentrylogrus "github.com/getsentry/sentry-go/logrus"
"github.com/sirupsen/logrus"
"gopkg.in/natefinch/lumberjack.v2"
)
@@ -42,3 +45,16 @@ func setupLogger() {
},
})
}
+
+func setupSentryLogrus(opts sentry.ClientOptions) {
+ // Send only ERROR and higher level logs to Sentry
+ sentryLevels := []logrus.Level{logrus.ErrorLevel, logrus.FatalLevel, logrus.PanicLevel}
+ sentryHook, err := sentrylogrus.New(sentryLevels, opts)
+ if err != nil {
+ panic(err)
+ }
+ logrus.AddHook(sentryHook)
+ // Flushes before calling os.Exit(1) when using logger.Fatal
+ // (else all defers are not called, and Sentry does not have time to send the event)
+ logrus.RegisterExitHandler(func() { sentryHook.Flush(5 * time.Second) })
+}
diff --git a/internal/conf/redis.go b/internal/conf/redis.go
new file mode 100644
index 00000000..93799b82
--- /dev/null
+++ b/internal/conf/redis.go
@@ -0,0 +1,34 @@
+// Copyright 2023 ROC. All rights reserved.
+// Use of this source code is governed by a MIT style
+// license that can be found in the LICENSE file.
+
+package conf
+
+import (
+ "log"
+ "sync"
+
+ "github.com/redis/rueidis"
+)
+
+var (
+ _redisClient rueidis.Client
+ _onceRedis sync.Once
+)
+
+func MustRedisClient() rueidis.Client {
+ _onceRedis.Do(func() {
+ client, err := rueidis.NewClient(rueidis.ClientOption{
+ InitAddress: redisSetting.InitAddress,
+ Username: redisSetting.Username,
+ Password: redisSetting.Password,
+ SelectDB: redisSetting.SelectDB,
+ ConnWriteTimeout: redisSetting.ConnWriteTimeout,
+ })
+ if err != nil {
+ log.Fatalf("create a redis client failed: %s", err)
+ }
+ _redisClient = client
+ })
+ return _redisClient
+}
diff --git a/internal/conf/sentry.go b/internal/conf/sentry.go
new file mode 100644
index 00000000..70c534e4
--- /dev/null
+++ b/internal/conf/sentry.go
@@ -0,0 +1,35 @@
+// Copyright 2023 ROC. All rights reserved.
+// Use of this source code is governed by a MIT style
+// license that can be found in the LICENSE file.
+
+package conf
+
+import (
+ "time"
+
+ "github.com/alimy/cfg"
+ "github.com/getsentry/sentry-go"
+ "github.com/rocboss/paopao-ce/pkg/version"
+)
+
+func initSentry() {
+ cfg.Be("Sentry", func() {
+ opts := sentry.ClientOptions{
+ Dsn: sentrySetting.Dsn,
+ Debug: sentrySetting.Debug,
+ AttachStacktrace: sentrySetting.AttachStacktrace,
+ TracesSampleRate: sentrySetting.TracesSampleRate,
+ }
+ _ = sentry.Init(opts)
+ if sentrySetting.AttachLogrus {
+ setupSentryLogrus(opts)
+ }
+ sentry.WithScope(func(scope *sentry.Scope) {
+ scope.SetExtras(map[string]any{
+ "version": version.VersionInfo(),
+ "time": time.Now().Local(),
+ })
+ sentry.CaptureMessage("paopao-ce sentry works!")
+ })
+ })
+}
diff --git a/internal/conf/settting.go b/internal/conf/setting.go
similarity index 58%
rename from internal/conf/settting.go
rename to internal/conf/setting.go
index 93443f64..d7c7223b 100644
--- a/internal/conf/settting.go
+++ b/internal/conf/setting.go
@@ -1,38 +1,52 @@
-// Copyright 2022 ROC. All rights reserved.
+// Copyright 2023 ROC. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
package conf
import (
- "embed"
+ "bytes"
+ _ "embed"
"fmt"
"strings"
"time"
+ "github.com/pyroscope-io/client/pyroscope"
"github.com/sirupsen/logrus"
"github.com/spf13/viper"
"gorm.io/gorm/logger"
)
//go:embed config.yaml
-var files embed.FS
+var configBytes []byte
-type Setting struct {
- vp *viper.Viper
+type pyroscopeConf struct {
+ AppName string
+ Endpoint string
+ AuthToken string
+ Logger string
+}
+
+type sentryConf struct {
+ Dsn string
+ Debug bool
+ AttachStacktrace bool
+ TracesSampleRate float64
+ AttachLogrus bool
+ AttachGin bool
}
-type LoggerSettingS struct {
+type loggerConf struct {
Level string
}
-type LoggerFileSettingS struct {
+type loggerFileConf struct {
SavePath string
FileName string
FileExt string
}
-type LoggerZincSettingS struct {
+type loggerZincConf struct {
Host string
Index string
User string
@@ -40,7 +54,7 @@ type LoggerZincSettingS struct {
Secure bool
}
-type LoggerMeiliSettingS struct {
+type loggerMeiliConf struct {
Host string
Index string
ApiKey string
@@ -49,7 +63,7 @@ type LoggerMeiliSettingS struct {
MinWorker int
}
-type HttpServerSettingS struct {
+type httpServerConf struct {
RunMode string
HttpIp string
HttpPort string
@@ -57,12 +71,12 @@ type HttpServerSettingS struct {
WriteTimeout time.Duration
}
-type GRPCServerSettingS struct {
+type grpcServerConf struct {
Host string
Port string
}
-type AppSettingS struct {
+type appConf struct {
RunMode string
MaxCommentCount int64
AttachmentIncomeRate float64
@@ -71,24 +85,30 @@ type AppSettingS struct {
MaxPageSize int
}
-type CacheIndexSettingS struct {
+type cacheIndexConf struct {
MaxUpdateQPS int
MinWorker int
}
-type SimpleCacheIndexSettingS struct {
+type simpleCacheIndexConf struct {
MaxIndexSize int
CheckTickDuration time.Duration
ExpireTickDuration time.Duration
}
-type BigCacheIndexSettingS struct {
- MaxIndexPage int
+type bigCacheIndexConf struct {
+ MaxIndexPage int
+ HardMaxCacheSize int
+ ExpireInSecond time.Duration
+ Verbose bool
+}
+
+type redisCacheIndexConf struct {
ExpireInSecond time.Duration
Verbose bool
}
-type AlipaySettingS struct {
+type alipayConf struct {
AppID string
PrivateKey string
RootCertFile string
@@ -97,19 +117,19 @@ type AlipaySettingS struct {
InProduction bool
}
-type SmsJuheSettings struct {
+type smsJuheConf struct {
Gateway string
Key string
TplID string
TplVal string
}
-type TweetSearchS struct {
+type tweetSearchConf struct {
MaxUpdateQPS int
MinWorker int
}
-type ZincSettingS struct {
+type zincConf struct {
Host string
Index string
User string
@@ -117,19 +137,19 @@ type ZincSettingS struct {
Secure bool
}
-type MeiliSettingS struct {
+type meiliConf struct {
Host string
Index string
ApiKey string
Secure bool
}
-type DatabaseSetingS struct {
+type databaseConf struct {
TablePrefix string
LogLevel string
}
-type MySQLSettingS struct {
+type mysqlConf struct {
UserName string
Password string
Host string
@@ -140,18 +160,18 @@ type MySQLSettingS struct {
MaxOpenConns int
}
-type PostgresSettingS map[string]string
+type postgresConf map[string]string
-type Sqlite3SettingS struct {
+type sqlite3Conf struct {
Path string
}
-type ObjectStorageS struct {
+type objectStorageConf struct {
RetainInDays int
TempDir string
}
-type MinIOSettingS struct {
+type minioConf struct {
AccessKey string
SecretKey string
Secure bool
@@ -160,7 +180,7 @@ type MinIOSettingS struct {
Domain string
}
-type S3SettingS struct {
+type s3Conf struct {
AccessKey string
SecretKey string
Secure bool
@@ -169,7 +189,7 @@ type S3SettingS struct {
Domain string
}
-type AliOSSSettingS struct {
+type aliOSSConf struct {
AccessKeyID string
AccessKeySecret string
Endpoint string
@@ -177,7 +197,7 @@ type AliOSSSettingS struct {
Domain string
}
-type COSSettingS struct {
+type cosConf struct {
SecretID string
SecretKey string
Region string
@@ -185,7 +205,7 @@ type COSSettingS struct {
Domain string
}
-type HuaweiOBSSettingS struct {
+type huaweiOBSConf struct {
AccessKey string
SecretKey string
Endpoint string
@@ -193,92 +213,36 @@ type HuaweiOBSSettingS struct {
Domain string
}
-type LocalOSSSettingS struct {
+type localossConf struct {
SavePath string
Secure bool
Bucket string
Domain string
}
-type RedisSettingS struct {
- Host string
- Password string
- DB int
+type redisConf struct {
+ InitAddress []string
+ Username string
+ Password string
+ SelectDB int
+ ConnWriteTimeout time.Duration
}
-type JWTSettingS struct {
+type jwtConf struct {
Secret string
Issuer string
Expire time.Duration
}
-func NewSetting() (*Setting, error) {
- cfgFile, err := files.Open("config.yaml")
- if err != nil {
- return nil, err
- }
- defer cfgFile.Close()
-
- vp := viper.New()
- vp.SetConfigName("config")
- vp.AddConfigPath(".")
- vp.AddConfigPath("custom/")
- vp.SetConfigType("yaml")
- if err = vp.ReadConfig(cfgFile); err != nil {
- return nil, err
- }
- if err = vp.MergeInConfig(); err != nil {
- return nil, err
- }
-
- return &Setting{vp}, nil
-}
-
-func (s *Setting) ReadSection(k string, v any) error {
- err := s.vp.UnmarshalKey(k, v)
- if err != nil {
- return err
- }
- return nil
-}
-
-func (s *Setting) Unmarshal(objects map[string]any) error {
- for k, v := range objects {
- err := s.vp.UnmarshalKey(k, v)
- if err != nil {
- return err
- }
- }
- return nil
-}
-
-func (s *Setting) featuresInfoFrom(k string) (map[string][]string, map[string]string) {
- sub := s.vp.Sub(k)
- keys := sub.AllKeys()
-
- suites := make(map[string][]string)
- kv := make(map[string]string, len(keys))
- for _, key := range sub.AllKeys() {
- val := sub.Get(key)
- switch v := val.(type) {
- case string:
- kv[key] = v
- case []any:
- suites[key] = sub.GetStringSlice(key)
- }
- }
- return suites, kv
-}
-
-func (s *HttpServerSettingS) GetReadTimeout() time.Duration {
+func (s *httpServerConf) GetReadTimeout() time.Duration {
return s.ReadTimeout * time.Second
}
-func (s *HttpServerSettingS) GetWriteTimeout() time.Duration {
+func (s *httpServerConf) GetWriteTimeout() time.Duration {
return s.WriteTimeout * time.Second
}
-func (s *MySQLSettingS) Dsn() string {
+func (s *mysqlConf) Dsn() string {
return fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=%s&parseTime=%t&loc=Local",
s.UserName,
s.Password,
@@ -289,17 +253,27 @@ func (s *MySQLSettingS) Dsn() string {
)
}
-func (s PostgresSettingS) Dsn() string {
+func (s postgresConf) Dsn() string {
var params []string
for k, v := range s {
- if len(v) > 0 {
- params = append(params, strings.ToLower(k)+"="+v)
+ if len(v) == 0 {
+ continue
+ }
+ lk := strings.ToLower(k)
+ tv := strings.Trim(v, " ")
+ switch lk {
+ case "schema":
+ params = append(params, "search_path="+tv)
+ case "applicationname":
+ params = append(params, "application_name="+tv)
+ default:
+ params = append(params, lk+"="+tv)
}
}
return strings.Join(params, " ")
}
-func (s *Sqlite3SettingS) Dsn(driverName string) string {
+func (s *sqlite3Conf) Dsn(driverName string) string {
pragmas := "_foreign_keys=1&_journal_mode=WAL&_synchronous=NORMAL&_busy_timeout=8000"
if driverName == "sqlite" {
pragmas = "_pragma=foreign_keys(1)&_pragma=journal_mode(WAL)&_pragma=synchronous(NORMAL)&_pragma=busy_timeout(8000)&_pragma=journal_size_limit(100000000)"
@@ -307,7 +281,7 @@ func (s *Sqlite3SettingS) Dsn(driverName string) string {
return fmt.Sprintf("file:%s?%s", s.Path, pragmas)
}
-func (s *DatabaseSetingS) logLevel() logger.LogLevel {
+func (s *databaseConf) logLevel() logger.LogLevel {
switch strings.ToLower(s.LogLevel) {
case "silent":
return logger.Silent
@@ -322,7 +296,36 @@ func (s *DatabaseSetingS) logLevel() logger.LogLevel {
}
}
-func (s *LoggerSettingS) logLevel() logrus.Level {
+func (s *databaseConf) TableNames() (res TableNameMap) {
+ tableNames := []string{
+ TableAnouncement,
+ TableAnouncementContent,
+ TableAttachment,
+ TableCaptcha,
+ TableComment,
+ TableCommentContent,
+ TableCommentReply,
+ TableContact,
+ TableContactGroup,
+ TableMessage,
+ TablePost,
+ TablePostAttachmentBill,
+ TablePostCollection,
+ TablePostContent,
+ TablePostStar,
+ TableTag,
+ TableUser,
+ TableWalletRecharge,
+ TableWalletStatement,
+ }
+ res = make(TableNameMap, len(tableNames))
+ for _, name := range tableNames {
+ res[name] = s.TablePrefix + name
+ }
+ return
+}
+
+func (s *loggerConf) logLevel() logrus.Level {
switch strings.ToLower(s.Level) {
case "panic":
return logrus.PanicLevel
@@ -343,15 +346,15 @@ func (s *LoggerSettingS) logLevel() logrus.Level {
}
}
-func (s *LoggerZincSettingS) Endpoint() string {
+func (s *loggerZincConf) Endpoint() string {
return endpoint(s.Host, s.Secure)
}
-func (s *LoggerMeiliSettingS) Endpoint() string {
+func (s *loggerMeiliConf) Endpoint() string {
return endpoint(s.Host, s.Secure)
}
-func (s *LoggerMeiliSettingS) minWork() int {
+func (s *loggerMeiliConf) minWork() int {
if s.MinWorker < 5 {
return 5
} else if s.MinWorker > 100 {
@@ -360,7 +363,7 @@ func (s *LoggerMeiliSettingS) minWork() int {
return s.MinWorker
}
-func (s *LoggerMeiliSettingS) maxLogBuffer() int {
+func (s *loggerMeiliConf) maxLogBuffer() int {
if s.MaxLogBuffer < 10 {
return 10
} else if s.MaxLogBuffer > 1000 {
@@ -369,18 +372,28 @@ func (s *LoggerMeiliSettingS) maxLogBuffer() int {
return s.MaxLogBuffer
}
-func (s *ObjectStorageS) TempDirSlash() string {
+func (s *objectStorageConf) TempDirSlash() string {
return strings.Trim(s.TempDir, " /") + "/"
}
-func (s *ZincSettingS) Endpoint() string {
+func (s *zincConf) Endpoint() string {
return endpoint(s.Host, s.Secure)
}
-func (s *MeiliSettingS) Endpoint() string {
+func (s *meiliConf) Endpoint() string {
return endpoint(s.Host, s.Secure)
}
+func (s *pyroscopeConf) GetLogger() (logger pyroscope.Logger) {
+ switch strings.ToLower(s.Logger) {
+ case "standard":
+ logger = pyroscope.StandardLogger
+ case "logrus":
+ logger = logrus.StandardLogger()
+ }
+ return
+}
+
func endpoint(host string, secure bool) string {
schema := "http"
if secure {
@@ -388,3 +401,37 @@ func endpoint(host string, secure bool) string {
}
return schema + "://" + host
}
+
+func newViper() (*viper.Viper, error) {
+ vp := viper.New()
+ vp.SetConfigName("config")
+ vp.AddConfigPath(".")
+ vp.AddConfigPath("custom/")
+ vp.SetConfigType("yaml")
+ err := vp.ReadConfig(bytes.NewReader(configBytes))
+ if err != nil {
+ return nil, err
+ }
+ if err = vp.MergeInConfig(); err != nil {
+ return nil, err
+ }
+ return vp, nil
+}
+
+func featuresInfoFrom(vp *viper.Viper, k string) (map[string][]string, map[string]string) {
+ sub := vp.Sub(k)
+ keys := sub.AllKeys()
+
+ suites := make(map[string][]string)
+ kv := make(map[string]string, len(keys))
+ for _, key := range sub.AllKeys() {
+ val := sub.Get(key)
+ switch v := val.(type) {
+ case string:
+ kv[key] = v
+ case []any:
+ suites[key] = sub.GetStringSlice(key)
+ }
+ }
+ return suites, kv
+}
diff --git a/internal/core/authority.go b/internal/core/authority.go
index 05e3742a..31a43be4 100644
--- a/internal/core/authority.go
+++ b/internal/core/authority.go
@@ -5,119 +5,13 @@
package core
import (
- "github.com/rocboss/paopao-ce/pkg/types"
+ "github.com/rocboss/paopao-ce/internal/core/ms"
)
-const (
- ActRegisterUser act = iota
- ActCreatePublicTweet
- ActCreatePublicAttachment
- ActCreatePublicPicture
- ActCreatePublicVideo
- ActCreatePrivateTweet
- ActCreatePrivateAttachment
- ActCreatePrivatePicture
- ActCreatePrivateVideo
- ActCreateFriendTweet
- ActCreateFriendAttachment
- ActCreateFriendPicture
- ActCreateFriendVideo
- ActCreatePublicComment
- ActCreatePublicPicureComment
- ActCreateFriendComment
- ActCreateFriendPicureComment
- ActCreatePrivateComment
- ActCreatePrivatePicureComment
- ActStickTweet
- ActTopTweet
- ActLockTweet
- ActVisibleTweet
- ActDeleteTweet
- ActCreateActivationCode
-)
-
-type (
- act uint8
-
- FriendFilter map[int64]types.Empty
- FriendSet map[string]types.Empty
-
- Action struct {
- Act act
- UserId int64
- }
-)
-
-func (f FriendFilter) IsFriend(userId int64) bool {
- _, yeah := f[userId]
- return yeah
-}
-
-// IsAllow default true if user is admin
-func (a act) IsAllow(user *User, userId int64, isFriend bool, isActivation bool) bool {
- if user.IsAdmin {
- return true
- }
- if user.ID == userId && isActivation {
- switch a {
- case ActCreatePublicTweet,
- ActCreatePublicAttachment,
- ActCreatePublicPicture,
- ActCreatePublicVideo,
- ActCreatePrivateTweet,
- ActCreatePrivateAttachment,
- ActCreatePrivatePicture,
- ActCreatePrivateVideo,
- ActCreateFriendTweet,
- ActCreateFriendAttachment,
- ActCreateFriendPicture,
- ActCreateFriendVideo,
- ActCreatePrivateComment,
- ActCreatePrivatePicureComment,
- ActStickTweet,
- ActLockTweet,
- ActVisibleTweet,
- ActDeleteTweet:
- return true
- }
- }
-
- if user.ID == userId && !isActivation {
- switch a {
- case ActCreatePrivateTweet,
- ActCreatePrivateComment,
- ActStickTweet,
- ActLockTweet,
- ActDeleteTweet:
- return true
- }
- }
-
- if isFriend && isActivation {
- switch a {
- case ActCreatePublicComment,
- ActCreatePublicPicureComment,
- ActCreateFriendComment,
- ActCreateFriendPicureComment:
- return true
- }
- }
-
- if !isFriend && isActivation {
- switch a {
- case ActCreatePublicComment,
- ActCreatePublicPicureComment:
- return true
- }
- }
-
- return false
-}
-
// AuthorizationManageService 授权管理服务
type AuthorizationManageService interface {
- IsAllow(user *User, action *Action) bool
- BeFriendFilter(userId int64) FriendFilter
+ IsAllow(user *ms.User, action *ms.Action) bool
+ BeFriendFilter(userId int64) ms.FriendFilter
BeFriendIds(userId int64) ([]int64, error)
- MyFriendSet(userId int64) FriendSet
+ MyFriendSet(userId int64) ms.FriendSet
}
diff --git a/internal/core/cache.go b/internal/core/cache.go
index d8b8cd10..8d8c3b42 100644
--- a/internal/core/cache.go
+++ b/internal/core/cache.go
@@ -5,6 +5,10 @@
package core
import (
+ "context"
+
+ "github.com/rocboss/paopao-ce/internal/core/cs"
+ "github.com/rocboss/paopao-ce/internal/core/ms"
"github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr"
)
@@ -24,6 +28,11 @@ type IndexAction struct {
Post *dbr.Post
}
+type IndexActionA struct {
+ Act IdxAct
+ Tweet *cs.TweetInfo
+}
+
func (a IdxAct) String() string {
switch a {
case IdxActNop:
@@ -43,16 +52,48 @@ func (a IdxAct) String() string {
}
}
-func NewIndexAction(act IdxAct, post *dbr.Post) *IndexAction {
+func NewIndexAction(act IdxAct, post *ms.Post) *IndexAction {
return &IndexAction{
Act: act,
Post: post,
}
}
+func NewIndexActionA(act IdxAct, tweet *cs.TweetInfo) *IndexActionA {
+ return &IndexActionA{
+ Act: act,
+ Tweet: tweet,
+ }
+}
+
// CacheIndexService cache index service interface
type CacheIndexService interface {
IndexPostsService
SendAction(act IdxAct, post *dbr.Post)
}
+
+// CacheIndexServantA cache index service interface
+type CacheIndexServantA interface {
+ IndexPostsServantA
+
+ SendAction(act IdxAct, tweet *cs.TweetInfo)
+}
+
+// RedisCache memory cache by Redis
+type RedisCache interface {
+ SetPushToSearchJob(ctx context.Context) error
+ DelPushToSearchJob(ctx context.Context) error
+ SetImgCaptcha(ctx context.Context, id string, value string) error
+ GetImgCaptcha(ctx context.Context, id string) (string, error)
+ DelImgCaptcha(ctx context.Context, id string) error
+ GetCountSmsCaptcha(ctx context.Context, phone string) (int64, error)
+ IncrCountSmsCaptcha(ctx context.Context, phone string) error
+ GetCountLoginErr(ctx context.Context, id int64) (int64, error)
+ DelCountLoginErr(ctx context.Context, id int64) error
+ IncrCountLoginErr(ctx context.Context, id int64) error
+ GetCountWhisper(ctx context.Context, uid int64) (int64, error)
+ IncrCountWhisper(ctx context.Context, uid int64) error
+ SetRechargeStatus(ctx context.Context, tradeNo string) error
+ DelRechargeStatus(ctx context.Context, tradeNo string) error
+}
diff --git a/internal/core/comments.go b/internal/core/comments.go
index c5501b4b..cf917a82 100644
--- a/internal/core/comments.go
+++ b/internal/core/comments.go
@@ -5,32 +5,30 @@
package core
import (
- "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr"
-)
-
-type (
- Comment = dbr.Comment
- CommentFormated = dbr.CommentFormated
- CommentReply = dbr.CommentReply
- CommentContent = dbr.CommentContent
- CommentReplyFormated = dbr.CommentReplyFormated
+ "github.com/rocboss/paopao-ce/internal/core/cs"
+ "github.com/rocboss/paopao-ce/internal/core/ms"
)
// CommentService 评论检索服务
type CommentService interface {
- GetComments(conditions *ConditionsT, offset, limit int) ([]*Comment, error)
- GetCommentByID(id int64) (*Comment, error)
- GetCommentCount(conditions *ConditionsT) (int64, error)
- GetCommentReplyByID(id int64) (*CommentReply, error)
- GetCommentContentsByIDs(ids []int64) ([]*CommentContent, error)
- GetCommentRepliesByID(ids []int64) ([]*CommentReplyFormated, error)
+ GetComments(conditions *ms.ConditionsT, offset, limit int) ([]*ms.Comment, error)
+ GetCommentByID(id int64) (*ms.Comment, error)
+ GetCommentCount(conditions *ms.ConditionsT) (int64, error)
+ GetCommentReplyByID(id int64) (*ms.CommentReply, error)
+ GetCommentContentsByIDs(ids []int64) ([]*ms.CommentContent, error)
+ GetCommentRepliesByID(ids []int64) ([]*ms.CommentReplyFormated, error)
+ GetCommentThumbsMap(userId int64, tweetId int64) (cs.CommentThumbsMap, cs.CommentThumbsMap, error)
}
// CommentManageService 评论管理服务
type CommentManageService interface {
- DeleteComment(comment *Comment) error
- CreateComment(comment *Comment) (*Comment, error)
- CreateCommentReply(reply *CommentReply) (*CommentReply, error)
- DeleteCommentReply(reply *CommentReply) error
- CreateCommentContent(content *CommentContent) (*CommentContent, error)
+ DeleteComment(comment *ms.Comment) error
+ CreateComment(comment *ms.Comment) (*ms.Comment, error)
+ CreateCommentReply(reply *ms.CommentReply) (*ms.CommentReply, error)
+ DeleteCommentReply(reply *ms.CommentReply) error
+ CreateCommentContent(content *ms.CommentContent) (*ms.CommentContent, error)
+ ThumbsUpComment(userId int64, tweetId, commentId int64) error
+ ThumbsDownComment(userId int64, tweetId, commentId int64) error
+ ThumbsUpReply(userId int64, tweetId, commentId, replyId int64) error
+ ThumbsDownReply(userId int64, tweetId, commentId, replyId int64) error
}
diff --git a/internal/core/core.go b/internal/core/core.go
index 9a8eb26f..ab0ba620 100644
--- a/internal/core/core.go
+++ b/internal/core/core.go
@@ -35,3 +35,14 @@ type DataService interface {
SecurityService
AttachmentCheckService
}
+
+// WebDataServantA Web数据服务集成(版本A)
+type WebDataServantA interface {
+ // 话题服务
+ TopicServantA
+
+ // 推文服务
+ TweetServantA
+ TweetManageServantA
+ TweetHelpServantA
+}
diff --git a/internal/core/cs/comment_thumbs.go b/internal/core/cs/comment_thumbs.go
new file mode 100644
index 00000000..cb6f7d0d
--- /dev/null
+++ b/internal/core/cs/comment_thumbs.go
@@ -0,0 +1,19 @@
+// Copyright 2023 ROC. All rights reserved.
+// Use of this source code is governed by a MIT style
+// license that can be found in the LICENSE file.
+
+package cs
+
+type CommentThumbs struct {
+ UserID int64 `json:"user_id"`
+ TweetID int64 `json:"tweet_id"`
+ CommentID int64 `json:"comment_id"`
+ ReplyID int64 `json:"reply_id"`
+ CommentType int8 `json:"comment_type"`
+ IsThumbsUp int8 `json:"is_thumbs_up"`
+ IsThumbsDown int8 `json:"is_thumbs_down"`
+}
+
+type CommentThumbsList []*CommentThumbs
+
+type CommentThumbsMap map[int64]*CommentThumbs
diff --git a/internal/core/cs/contact.go b/internal/core/cs/contact.go
new file mode 100644
index 00000000..ed774631
--- /dev/null
+++ b/internal/core/cs/contact.go
@@ -0,0 +1,26 @@
+// Copyright 2023 ROC. All rights reserved.
+// Use of this source code is governed by a MIT style
+// license that can be found in the LICENSE file.
+
+package cs
+
+const (
+ ContactStatusRequesting int8 = iota + 1
+ ContactStatusAgree
+ ContactStatusReject
+ ContactStatusDeleted
+)
+
+type Contact struct {
+ ID int64 `db:"id" json:"id"`
+ UserId int64 `db:"user_id" json:"user_id"`
+ FriendId int64 `db:"friend_id" json:"friend_id"`
+ GroupId int64 `json:"group_id"`
+ Remark string `json:"remark"`
+ Status int8 `json:"status"` // 1请求好友, 2已同意好友, 3已拒绝好友, 4已删除好友
+ IsTop int8 `json:"is_top"`
+ IsBlack int8 `json:"is_black"`
+ NoticeEnable int8 `json:"notice_enable"`
+ IsDel int8 `json:"-"`
+ DeletedOn int64 `db:"-" json:"-"`
+}
diff --git a/internal/core/cs/cs.go b/internal/core/cs/cs.go
new file mode 100644
index 00000000..4ac8eae9
--- /dev/null
+++ b/internal/core/cs/cs.go
@@ -0,0 +1,8 @@
+// Copyright 2023 ROC. All rights reserved.
+// Use of this source code is governed by a MIT style
+// license that can be found in the LICENSE file.
+
+// Package cs contain core data service interface type
+// model define
+
+package cs
diff --git a/internal/core/cs/errors.go b/internal/core/cs/errors.go
new file mode 100644
index 00000000..881d694a
--- /dev/null
+++ b/internal/core/cs/errors.go
@@ -0,0 +1,13 @@
+// Copyright 2023 ROC. All rights reserved.
+// Use of this source code is governed by a MIT style
+// license that can be found in the LICENSE file.
+
+package cs
+
+import "errors"
+
+// internal core error variable for data logic implement.
+var (
+ ErrNotImplemented = errors.New("not implemented")
+ ErrNoPermission = errors.New("no permission")
+)
diff --git a/internal/core/cs/search.go b/internal/core/cs/search.go
new file mode 100644
index 00000000..37c8fa9d
--- /dev/null
+++ b/internal/core/cs/search.go
@@ -0,0 +1,38 @@
+// Copyright 2023 ROC. All rights reserved.
+// Use of this source code is governed by a MIT style
+// license that can be found in the LICENSE file.
+
+package cs
+
+const (
+ // 搜索查询类型
+ TsQueryTypeDefault TsQueryType = "search"
+ TsQueryTypeTag TsQueryType = "tag"
+)
+
+type (
+ // TsQueryType 搜索查询类型
+ TsQueryType string
+
+ // TsDocList 索引条陈列表
+ TsDocList []TsDocItem
+)
+
+// TsQueryReq 搜索查询请求
+type TsQueryReq struct {
+ Query string
+ Visibility []TweetVisibleType
+ Type TsQueryType
+}
+
+// TsQueryResp 搜索查询响应
+type TsQueryResp struct {
+ Items TweetList
+ Total int64
+}
+
+// TsDocItem 索引条陈
+type TsDocItem struct {
+ Post *TweetInfo
+ Content string
+}
diff --git a/internal/core/cs/timeline.go b/internal/core/cs/timeline.go
new file mode 100644
index 00000000..118f371c
--- /dev/null
+++ b/internal/core/cs/timeline.go
@@ -0,0 +1,11 @@
+// Copyright 2023 ROC. All rights reserved.
+// Use of this source code is governed by a MIT style
+// license that can be found in the LICENSE file.
+
+package cs
+
+// TweetBox 推文列表盒子,包含其他一些关于推文列表的信息
+type TweetBox struct {
+ Tweets TweetList
+ Total int64
+}
diff --git a/internal/core/cs/topics.go b/internal/core/cs/topics.go
new file mode 100644
index 00000000..c7819fc6
--- /dev/null
+++ b/internal/core/cs/topics.go
@@ -0,0 +1,55 @@
+// Copyright 2023 ROC. All rights reserved.
+// Use of this source code is governed by a MIT style
+// license that can be found in the LICENSE file.
+
+package cs
+
+const (
+ // 标签类型
+ TagTypeHot TagType = "hot"
+ TagTypeNew TagType = "new"
+ TagTypeFollow TagType = "follow"
+ TagTypeHotExtral TagType = "hot_extral"
+)
+
+type (
+ // TagType 标签类型
+ TagType string
+
+ // TagInfoList 标签信息列表
+ TagInfoList []*TagInfo
+
+ // TagList 标签列表
+ TagList []*TagItem
+)
+
+// TagInfo 标签信息
+type TagInfo struct {
+ ID int64 `json:"id" db:"id"`
+ UserID int64 `json:"user_id" db:"user_id"`
+ Tag string `json:"tag"`
+ QuoteNum int64 `json:"quote_num" db:"quote_num"`
+}
+
+// TagItem 标签信息条陈
+type TagItem struct {
+ ID int64 `json:"id"`
+ UserID int64 `json:"user_id"`
+ User *UserInfo `json:"user" db:"u"`
+ Tag string `json:"tag"`
+ QuoteNum int64 `json:"quote_num"`
+ IsFollowing int8 `json:"is_following"`
+ IsTop int8 `json:"is_top"`
+}
+
+func (t *TagInfo) Format() *TagItem {
+ return &TagItem{
+ ID: t.ID,
+ UserID: t.UserID,
+ User: &UserInfo{},
+ Tag: t.Tag,
+ QuoteNum: t.QuoteNum,
+ IsFollowing: 0,
+ IsTop: 0,
+ }
+}
diff --git a/internal/core/cs/trading.go b/internal/core/cs/trading.go
new file mode 100644
index 00000000..aebeb132
--- /dev/null
+++ b/internal/core/cs/trading.go
@@ -0,0 +1,12 @@
+// Copyright 2023 ROC. All rights reserved.
+// Use of this source code is governed by a MIT style
+// license that can be found in the LICENSE file.
+
+package cs
+
+type AttachmentBill struct {
+ ID int64 `json:"id"`
+ PostID int64 `json:"post_id"`
+ UserID int64 `json:"user_id"`
+ PaidAmount int64 `json:"paid_amount"`
+}
diff --git a/internal/core/cs/tweets.go b/internal/core/cs/tweets.go
new file mode 100644
index 00000000..34060030
--- /dev/null
+++ b/internal/core/cs/tweets.go
@@ -0,0 +1,141 @@
+// Copyright 2023 ROC. All rights reserved.
+// Use of this source code is governed by a MIT style
+// license that can be found in the LICENSE file.
+
+package cs
+
+const (
+ // 推文内容分快类型
+ TweetBlockTitle TweetBlockType = iota + 1
+ TweetBlockText
+ TweetBlockImage
+ TweetBlockVideo
+ TweetBlockAudio
+ TweetBlockLink
+ TweetBlockAttachment
+ TweetBlockChargeAttachment
+
+ // 推文可见性
+ TweetVisitPublic TweetVisibleType = iota
+ TweetVisitPrivate
+ TweetVisitFriend
+ TweetVisitInvalid
+
+ // 附件类型
+ AttachmentTypeImage AttachmentType = iota + 1
+ AttachmentTypeVideo
+ AttachmentTypeOther
+)
+
+type (
+ // TweetBlockType 推文内容分块类型,1标题,2文字段落,3图片地址,4视频地址,5语音地址,6链接地址,7附件资源
+ // TODO: 优化一下类型为 uint8, 需要底层数据库同步修改
+ TweetBlockType int
+
+ // TweetVisibleType 推文可见性,0公开,1私密,2好友
+ TweetVisibleType uint8
+
+ // AttachmentType 附件类型, 1图片, 2视频, 3其他
+ // TODO: 优化一下类型为 uint8, 需要底层数据库同步修改
+ AttachmentType int
+
+ // TweetList 推文列表
+ TweetList []*TweetItem
+
+ // TweetInfoList 推文信息列表
+ TweetInfoList []*TweetInfo
+
+ // FavoriteList 收藏列表
+ FavoriteList []*FavoriteItem
+
+ // ReactionList 点赞列表
+ ReactionList []*ReactionItem
+
+ // TweetBlockList 推文分块列表
+ TweetBlockList []*TweetBlock
+)
+
+// TweetBlock 推文分块
+type TweetBlock struct {
+ ID int64 `json:"id" binding:"-"`
+ PostID int64 `json:"post_id" binding:"-"`
+ Content string `json:"content" binding:"required"`
+ Type TweetBlockType `json:"type" binding:"required"`
+ Sort int64 `json:"sort" binding:"required"`
+}
+
+// TweetInfo 推文信息
+type TweetInfo struct {
+ ID int64 `json:"id"`
+ UserID int64 `json:"user_id"`
+ CommentCount int64 `json:"comment_count"`
+ CollectionCount int64 `json:"collection_count"`
+ UpvoteCount int64 `json:"upvote_count"`
+ Visibility TweetVisibleType `json:"visibility"`
+ IsTop int `json:"is_top"`
+ IsEssence int `json:"is_essence"`
+ IsLock int `json:"is_lock"`
+ LatestRepliedOn int64 `json:"latest_replied_on"`
+ Tags string `json:"tags"`
+ AttachmentPrice int64 `json:"attachment_price"`
+ IP string `json:"ip"`
+ IPLoc string `json:"ip_loc"`
+ CreatedOn int64 `json:"created_on"`
+ ModifiedOn int64 `json:"modified_on"`
+}
+
+// TweetItem 一条推文信息
+type TweetItem struct {
+ ID int64 `json:"id"`
+ UserID int64 `json:"user_id"`
+ User *UserInfo `db:"user" json:"user"`
+ Contents []*TweetBlock `db:"-" json:"contents"`
+ CommentCount int64 `json:"comment_count"`
+ CollectionCount int64 `json:"collection_count"`
+ UpvoteCount int64 `json:"upvote_count"`
+ Visibility TweetVisibleType `json:"visibility"`
+ IsTop int `json:"is_top"`
+ IsEssence int `json:"is_essence"`
+ IsLock int `json:"is_lock"`
+ LatestRepliedOn int64 `json:"latest_replied_on"`
+ CreatedOn int64 `json:"created_on"`
+ ModifiedOn int64 `json:"modified_on"`
+ Tags map[string]int8 `json:"tags"`
+ AttachmentPrice int64 `json:"attachment_price"`
+ IPLoc string `json:"ip_loc"`
+}
+
+type Attachment struct {
+ ID int64 `json:"id"`
+ UserID int64 `json:"user_id"`
+ FileSize int64 `json:"file_size"`
+ ImgWidth int `json:"img_width"`
+ ImgHeight int `json:"img_height"`
+ Type AttachmentType `json:"type"`
+ Content string `json:"content"`
+}
+
+// Favorite 收藏
+type FavoriteItem struct {
+ ID int64 `json:"id"`
+ Tweet *TweetInfo `json:"-"`
+ TweetID int64 `json:"post_id"`
+ UserID int64 `json:"user_id"`
+}
+
+// Reaction 反应、表情符号, 点赞、喜欢等
+type ReactionItem struct {
+ ID int64 `json:"id"`
+ Tweet *TweetInfo `json:"-"`
+ TweetID int64 `json:"post_id"`
+ UserID int64 `json:"user_id"`
+}
+
+type NewTweetReq struct {
+ Contents TweetBlockList `json:"contents" binding:"required"`
+ Tags []string `json:"tags" binding:"required"`
+ Users []string `json:"users" binding:"required"`
+ AttachmentPrice int64 `json:"attachment_price"`
+ Visibility TweetVisibleType `json:"visibility"`
+ ClientIP string `json:"-" binding:"-"`
+}
diff --git a/internal/core/cs/user.go b/internal/core/cs/user.go
new file mode 100644
index 00000000..ee60df96
--- /dev/null
+++ b/internal/core/cs/user.go
@@ -0,0 +1,58 @@
+// Copyright 2023 ROC. All rights reserved.
+// Use of this source code is governed by a MIT style
+// license that can be found in the LICENSE file.
+
+package cs
+
+const (
+ RelationUnknow RelationTyp = iota
+ RelationSelf
+ RelationFriend
+ RelationFollower
+ RelationFollowing
+ RelationAdmin
+ RelationGuest
+)
+
+type (
+ // UserInfoList 用户信息列表
+ UserInfoList []*UserInfo
+
+ //
+ RelationTyp uint8
+
+ VistUser struct {
+ Username string
+ UserId int64
+ RelTyp RelationTyp
+ }
+)
+
+// UserInfo 用户基本信息
+type UserInfo struct {
+ ID int64 `json:"id"`
+ Nickname string `json:"nickname"`
+ Username string `json:"username"`
+ Status int `json:"status"`
+ Avatar string `json:"avatar"`
+ IsAdmin bool `json:"is_admin"`
+}
+
+func (t RelationTyp) String() string {
+ switch t {
+ case RelationSelf:
+ return "self"
+ case RelationFriend:
+ return "friend"
+ case RelationFollower:
+ return "follower"
+ case RelationFollowing:
+ return "following"
+ case RelationAdmin:
+ return "admin"
+ case RelationUnknow:
+ fallthrough
+ default:
+ return "unknow relation"
+ }
+}
diff --git a/internal/core/messages.go b/internal/core/messages.go
index 57816480..519e4e49 100644
--- a/internal/core/messages.go
+++ b/internal/core/messages.go
@@ -5,32 +5,15 @@
package core
import (
- "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr"
-)
-
-const (
- MsgTypePost = dbr.MsgTypePost
- MsgtypeComment = dbr.MsgtypeComment
- MsgTypeReply = dbr.MsgTypeReply
- MsgTypeWhisper = dbr.MsgTypeWhisper
- MsgTypeRequestingFriend = dbr.MsgTypeRequestingFriend
- MsgTypeSystem = dbr.MsgTypeSystem
-
- MsgStatusUnread = dbr.MsgStatusUnread
- MsgStatusReaded = dbr.MsgStatusReaded
-)
-
-type (
- Message = dbr.Message
- MessageFormated = dbr.MessageFormated
+ "github.com/rocboss/paopao-ce/internal/core/ms"
)
// MessageService 消息服务
type MessageService interface {
- CreateMessage(msg *Message) (*Message, error)
+ CreateMessage(msg *ms.Message) (*ms.Message, error)
GetUnreadCount(userID int64) (int64, error)
- GetMessageByID(id int64) (*Message, error)
- ReadMessage(message *Message) error
- GetMessages(conditions *ConditionsT, offset, limit int) ([]*MessageFormated, error)
- GetMessageCount(conditions *ConditionsT) (int64, error)
+ GetMessageByID(id int64) (*ms.Message, error)
+ ReadMessage(message *ms.Message) error
+ GetMessages(conditions *ms.ConditionsT, offset, limit int) ([]*ms.MessageFormated, error)
+ GetMessageCount(conditions *ms.ConditionsT) (int64, error)
}
diff --git a/internal/core/ms/authority.go b/internal/core/ms/authority.go
new file mode 100644
index 00000000..d6378696
--- /dev/null
+++ b/internal/core/ms/authority.go
@@ -0,0 +1,115 @@
+// Copyright 2023 ROC. All rights reserved.
+// Use of this source code is governed by a MIT style
+// license that can be found in the LICENSE file.
+
+package ms
+
+import (
+ "github.com/rocboss/paopao-ce/pkg/types"
+)
+
+const (
+ ActRegisterUser act = iota
+ ActCreatePublicTweet
+ ActCreatePublicAttachment
+ ActCreatePublicPicture
+ ActCreatePublicVideo
+ ActCreatePrivateTweet
+ ActCreatePrivateAttachment
+ ActCreatePrivatePicture
+ ActCreatePrivateVideo
+ ActCreateFriendTweet
+ ActCreateFriendAttachment
+ ActCreateFriendPicture
+ ActCreateFriendVideo
+ ActCreatePublicComment
+ ActCreatePublicPicureComment
+ ActCreateFriendComment
+ ActCreateFriendPicureComment
+ ActCreatePrivateComment
+ ActCreatePrivatePicureComment
+ ActStickTweet
+ ActTopTweet
+ ActLockTweet
+ ActVisibleTweet
+ ActDeleteTweet
+ ActCreateActivationCode
+)
+
+type (
+ act uint8
+
+ FriendFilter map[int64]types.Empty
+ FriendSet map[string]types.Empty
+
+ Action struct {
+ Act act
+ UserId int64
+ }
+)
+
+func (f FriendFilter) IsFriend(userId int64) bool {
+ _, yeah := f[userId]
+ return yeah
+}
+
+// IsAllow default true if user is admin
+func (a act) IsAllow(user *User, userId int64, isFriend bool, isActivation bool) bool {
+ if user.IsAdmin {
+ return true
+ }
+ if user.ID == userId && isActivation {
+ switch a {
+ case ActCreatePublicTweet,
+ ActCreatePublicAttachment,
+ ActCreatePublicPicture,
+ ActCreatePublicVideo,
+ ActCreatePrivateTweet,
+ ActCreatePrivateAttachment,
+ ActCreatePrivatePicture,
+ ActCreatePrivateVideo,
+ ActCreateFriendTweet,
+ ActCreateFriendAttachment,
+ ActCreateFriendPicture,
+ ActCreateFriendVideo,
+ ActCreatePrivateComment,
+ ActCreatePrivatePicureComment,
+ ActStickTweet,
+ ActLockTweet,
+ ActVisibleTweet,
+ ActDeleteTweet:
+ return true
+ }
+ }
+
+ if user.ID == userId && !isActivation {
+ switch a {
+ case ActCreatePrivateTweet,
+ ActCreatePrivateComment,
+ ActStickTweet,
+ ActLockTweet,
+ ActDeleteTweet:
+ return true
+ }
+ }
+
+ if isFriend && isActivation {
+ switch a {
+ case ActCreatePublicComment,
+ ActCreatePublicPicureComment,
+ ActCreateFriendComment,
+ ActCreateFriendPicureComment:
+ return true
+ }
+ }
+
+ if !isFriend && isActivation {
+ switch a {
+ case ActCreatePublicComment,
+ ActCreatePublicPicureComment:
+ return true
+ }
+ }
+
+ return false
+}
diff --git a/internal/core/ms/comments.go b/internal/core/ms/comments.go
new file mode 100644
index 00000000..87ef2473
--- /dev/null
+++ b/internal/core/ms/comments.go
@@ -0,0 +1,17 @@
+// Copyright 2023 ROC. All rights reserved.
+// Use of this source code is governed by a MIT style
+// license that can be found in the LICENSE file.
+
+package ms
+
+import (
+ "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr"
+)
+
+type (
+ Comment = dbr.Comment
+ CommentFormated = dbr.CommentFormated
+ CommentReply = dbr.CommentReply
+ CommentContent = dbr.CommentContent
+ CommentReplyFormated = dbr.CommentReplyFormated
+)
diff --git a/internal/core/ms/messages.go b/internal/core/ms/messages.go
new file mode 100644
index 00000000..adf793f8
--- /dev/null
+++ b/internal/core/ms/messages.go
@@ -0,0 +1,26 @@
+// Copyright 2023 ROC. All rights reserved.
+// Use of this source code is governed by a MIT style
+// license that can be found in the LICENSE file.
+
+package ms
+
+import (
+ "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr"
+)
+
+const (
+ MsgTypePost = dbr.MsgTypePost
+ MsgtypeComment = dbr.MsgtypeComment
+ MsgTypeReply = dbr.MsgTypeReply
+ MsgTypeWhisper = dbr.MsgTypeWhisper
+ MsgTypeRequestingFriend = dbr.MsgTypeRequestingFriend
+ MsgTypeSystem = dbr.MsgTypeSystem
+
+ MsgStatusUnread = dbr.MsgStatusUnread
+ MsgStatusReaded = dbr.MsgStatusReaded
+)
+
+type (
+ Message = dbr.Message
+ MessageFormated = dbr.MessageFormated
+)
diff --git a/internal/core/types.go b/internal/core/ms/ms.go
similarity index 79%
rename from internal/core/types.go
rename to internal/core/ms/ms.go
index 6ca95893..8993251f 100644
--- a/internal/core/types.go
+++ b/internal/core/ms/ms.go
@@ -1,8 +1,10 @@
-// Copyright 2022 ROC. All rights reserved.
+// Copyright 2023 ROC. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
-package core
+// Package ms contain core data service interface type
+// model define for gorm adapter
+package ms
import (
"github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr"
diff --git a/internal/core/ms/security.go b/internal/core/ms/security.go
new file mode 100644
index 00000000..a6610ca1
--- /dev/null
+++ b/internal/core/ms/security.go
@@ -0,0 +1,13 @@
+// Copyright 2023 ROC. All rights reserved.
+// Use of this source code is governed by a MIT style
+// license that can be found in the LICENSE file.
+
+package ms
+
+import (
+ "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr"
+)
+
+type (
+ Captcha = dbr.Captcha
+)
diff --git a/internal/core/ms/timeline.go b/internal/core/ms/timeline.go
new file mode 100644
index 00000000..eb1169f4
--- /dev/null
+++ b/internal/core/ms/timeline.go
@@ -0,0 +1,10 @@
+// Copyright 2023 ROC. All rights reserved.
+// Use of this source code is governed by a MIT style
+// license that can be found in the LICENSE file.
+
+package ms
+
+type IndexTweetList struct {
+ Tweets []*PostFormated
+ Total int64
+}
diff --git a/internal/core/ms/tweets.go b/internal/core/ms/tweets.go
new file mode 100644
index 00000000..eab6d85c
--- /dev/null
+++ b/internal/core/ms/tweets.go
@@ -0,0 +1,43 @@
+// Copyright 2023 ROC. All rights reserved.
+// Use of this source code is governed by a MIT style
+// license that can be found in the LICENSE file.
+
+package ms
+
+import (
+ "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr"
+)
+
+const (
+ AttachmentTypeImage = dbr.AttachmentTypeImage
+ AttachmentTypeVideo = dbr.AttachmentTypeVideo
+ AttachmentTypeOther = dbr.AttachmentTypeOther
+
+ // 类型,1标题,2文字段落,3图片地址,4视频地址,5语音地址,6链接地址,7附件资源
+ ContentTypeTitle = dbr.ContentTypeTitle
+ ContentTypeText = dbr.ContentTypeText
+ ContentTypeImage = dbr.ContentTypeImage
+ ContentTypeVideo = dbr.ContentTypeVideo
+ ContentTypeAudio = dbr.ContentTypeAudio
+ ContentTypeLink = dbr.ContentTypeLink
+ ContentTypeAttachment = dbr.ContentTypeAttachment
+ ContentTypeChargeAttachment = dbr.ContentTypeChargeAttachment
+)
+
+const (
+ PostVisitPublic PostVisibleT = iota
+ PostVisitPrivate
+ PostVisitFriend
+ PostVisitInvalid
+)
+
+type (
+ PostStar = dbr.PostStar
+ PostCollection = dbr.PostCollection
+ PostAttachmentBill = dbr.PostAttachmentBill
+ PostContent = dbr.PostContent
+ Attachment = dbr.Attachment
+ AttachmentType = dbr.AttachmentType
+ PostContentT = dbr.PostContentT
+ PostVisibleT = dbr.PostVisibleT
+)
diff --git a/internal/core/ms/user.go b/internal/core/ms/user.go
new file mode 100644
index 00000000..88cc6e73
--- /dev/null
+++ b/internal/core/ms/user.go
@@ -0,0 +1,20 @@
+// Copyright 2023 ROC. All rights reserved.
+// Use of this source code is governed by a MIT style
+// license that can be found in the LICENSE file.
+
+package ms
+
+type (
+ ContactItem struct {
+ UserId int64 `json:"user_id"`
+ UserName string `db:"username" json:"username"`
+ Nickname string `json:"nickname"`
+ Avatar string `json:"avatar"`
+ Phone string `json:"phone"`
+ }
+
+ ContactList struct {
+ Contacts []ContactItem `json:"contacts"`
+ Total int64 `json:"total"`
+ }
+)
diff --git a/internal/core/ms/wallet.go b/internal/core/ms/wallet.go
new file mode 100644
index 00000000..5786fcac
--- /dev/null
+++ b/internal/core/ms/wallet.go
@@ -0,0 +1,14 @@
+// Copyright 2023 ROC. All rights reserved.
+// Use of this source code is governed by a MIT style
+// license that can be found in the LICENSE file.
+
+package ms
+
+import (
+ "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr"
+)
+
+type (
+ WalletStatement = dbr.WalletStatement
+ WalletRecharge = dbr.WalletRecharge
+)
diff --git a/internal/core/search.go b/internal/core/search.go
index 74d6e029..dc08e127 100644
--- a/internal/core/search.go
+++ b/internal/core/search.go
@@ -5,6 +5,7 @@
package core
import (
+ "github.com/rocboss/paopao-ce/internal/core/ms"
"github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr"
)
@@ -21,6 +22,7 @@ const (
)
type (
+ // PostVisibleT 可访问类型,0公开,1私密,2好友
PostVisibleT = dbr.PostVisibleT
SearchType string
@@ -32,12 +34,12 @@ type (
}
QueryResp struct {
- Items []*PostFormated
+ Items []*ms.PostFormated
Total int64
}
TsDocItem struct {
- Post *Post
+ Post *ms.Post
Content string
}
)
@@ -47,5 +49,5 @@ type TweetSearchService interface {
IndexName() string
AddDocuments(data []TsDocItem, primaryKey ...string) (bool, error)
DeleteDocuments(identifiers []string) error
- Search(user *User, q *QueryReq, offset, limit int) (*QueryResp, error)
+ Search(user *ms.User, q *QueryReq, offset, limit int) (*QueryResp, error)
}
diff --git a/internal/core/security.go b/internal/core/security.go
index ce313635..0643cc28 100644
--- a/internal/core/security.go
+++ b/internal/core/security.go
@@ -7,17 +7,13 @@ package core
import (
"time"
- "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr"
-)
-
-type (
- Captcha = dbr.Captcha
+ "github.com/rocboss/paopao-ce/internal/core/ms"
)
// SecurityService 安全相关服务
type SecurityService interface {
- GetLatestPhoneCaptcha(phone string) (*Captcha, error)
- UsePhoneCaptcha(captcha *Captcha) error
+ GetLatestPhoneCaptcha(phone string) (*ms.Captcha, error)
+ UsePhoneCaptcha(captcha *ms.Captcha) error
SendPhoneCaptcha(phone string) error
}
diff --git a/internal/core/timeline.go b/internal/core/timeline.go
new file mode 100644
index 00000000..722e79f3
--- /dev/null
+++ b/internal/core/timeline.go
@@ -0,0 +1,20 @@
+// Copyright 2023 ROC. All rights reserved.
+// Use of this source code is governed by a MIT style
+// license that can be found in the LICENSE file.
+
+package core
+
+import (
+ "github.com/rocboss/paopao-ce/internal/core/cs"
+ "github.com/rocboss/paopao-ce/internal/core/ms"
+)
+
+// IndexPostsService 广场首页推文列表服务
+type IndexPostsService interface {
+ IndexPosts(user *ms.User, offset int, limit int) (*ms.IndexTweetList, error)
+}
+
+// IndexPostsServantA 广场首页推文列表服务(版本A)
+type IndexPostsServantA interface {
+ IndexPosts(user *ms.User, limit int, offset int) (*cs.TweetBox, error)
+}
diff --git a/internal/core/topics.go b/internal/core/topics.go
index 138cc151..cc3f12cf 100644
--- a/internal/core/topics.go
+++ b/internal/core/topics.go
@@ -5,18 +5,27 @@
package core
import (
- "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr"
-)
-
-type (
- Tag = dbr.Tag
- TagFormated = dbr.TagFormated
+ "github.com/rocboss/paopao-ce/internal/core/cs"
)
// TopicService 话题服务
type TopicService interface {
- CreateTag(tag *Tag) (*Tag, error)
- DeleteTag(tag *Tag) error
- GetTags(conditions *ConditionsT, offset, limit int) ([]*Tag, error)
- GetTagsByKeyword(keyword string) ([]*Tag, error)
+ UpsertTags(userId int64, tags []string) (cs.TagInfoList, error)
+ DecrTagsById(ids []int64) error
+ ListTags(typ cs.TagType, limit int, offset int) (cs.TagList, error)
+ TagsByKeyword(keyword string) (cs.TagInfoList, error)
+ GetHotTags(userId int64, limit int, offset int) (cs.TagList, error)
+ GetNewestTags(userId int64, limit int, offset int) (cs.TagList, error)
+ GetFollowTags(userId int64, limit int, offset int) (cs.TagList, error)
+ FollowTopic(userId int64, topicId int64) error
+ UnfollowTopic(userId int64, topicId int64) error
+ StickTopic(userId int64, topicId int64) (int8, error)
+}
+
+// TopicServantA 话题服务(版本A)
+type TopicServantA interface {
+ UpsertTags(userId int64, tags []string) (cs.TagInfoList, error)
+ DecrTagsById(ids []int64) error
+ ListTags(typ cs.TagType, limit int, offset int) (cs.TagList, error)
+ TagsByKeyword(keyword string) (cs.TagInfoList, error)
}
diff --git a/internal/core/tweets.go b/internal/core/tweets.go
index 682cbd65..9cb2e54a 100644
--- a/internal/core/tweets.go
+++ b/internal/core/tweets.go
@@ -5,79 +5,78 @@
package core
import (
- "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr"
-)
-
-const (
- AttachmentTypeImage = dbr.AttachmentTypeImage
- AttachmentTypeVideo = dbr.AttachmentTypeVideo
- AttachmentTypeOther = dbr.AttachmentTypeOther
-
- // 类型,1标题,2文字段落,3图片地址,4视频地址,5语音地址,6链接地址,7附件资源
- ContentTypeTitle = dbr.ContentTypeTitle
- ContentTypeText = dbr.ContentTypeText
- ContentTypeImage = dbr.ContentTypeImage
- ContentTypeVideo = dbr.ContentTypeVideo
- ContentTypeAudio = dbr.ContentTypeAudio
- ContentTypeLink = dbr.ContentTypeLink
- ContentTypeAttachment = dbr.ContentTypeAttachment
- ContentTypeChargeAttachment = dbr.ContentTypeChargeAttachment
-)
-
-type (
- PostStar = dbr.PostStar
- PostCollection = dbr.PostCollection
- PostAttachmentBill = dbr.PostAttachmentBill
- PostContent = dbr.PostContent
- Attachment = dbr.Attachment
- AttachmentType = dbr.AttachmentType
- PostContentT = dbr.PostContentT
-
- IndexTweetList struct {
- Tweets []*PostFormated
- Total int64
- }
+ "github.com/rocboss/paopao-ce/internal/core/cs"
+ "github.com/rocboss/paopao-ce/internal/core/ms"
)
// TweetService 推文检索服务
type TweetService interface {
- GetPostByID(id int64) (*Post, error)
- GetPosts(conditions *ConditionsT, offset, limit int) ([]*Post, error)
- GetPostCount(conditions *ConditionsT) (int64, error)
- GetUserPostStar(postID, userID int64) (*PostStar, error)
- GetUserPostStars(userID int64, offset, limit int) ([]*PostStar, error)
+ GetPostByID(id int64) (*ms.Post, error)
+ GetPosts(conditions ms.ConditionsT, offset, limit int) ([]*ms.Post, error)
+ GetPostCount(conditions ms.ConditionsT) (int64, error)
+ GetUserPostStar(postID, userID int64) (*ms.PostStar, error)
+ GetUserPostStars(userID int64, limit int, offset int) ([]*ms.PostStar, error)
GetUserPostStarCount(userID int64) (int64, error)
- GetUserPostCollection(postID, userID int64) (*PostCollection, error)
- GetUserPostCollections(userID int64, offset, limit int) ([]*PostCollection, error)
+ GetUserPostCollection(postID, userID int64) (*ms.PostCollection, error)
+ GetUserPostCollections(userID int64, offset, limit int) ([]*ms.PostCollection, error)
GetUserPostCollectionCount(userID int64) (int64, error)
- GetPostAttatchmentBill(postID, userID int64) (*PostAttachmentBill, error)
- GetPostContentsByIDs(ids []int64) ([]*PostContent, error)
- GetPostContentByID(id int64) (*PostContent, error)
+ GetPostAttatchmentBill(postID, userID int64) (*ms.PostAttachmentBill, error)
+ GetPostContentsByIDs(ids []int64) ([]*ms.PostContent, error)
+ GetPostContentByID(id int64) (*ms.PostContent, error)
+ ListUserStarTweets(user *cs.VistUser, limit int, offset int) ([]*ms.PostStar, int64, error)
}
// TweetManageService 推文管理服务,包括创建/删除/更新推文
type TweetManageService interface {
- CreateAttachment(attachment *Attachment) (*Attachment, error)
- CreatePost(post *Post) (*Post, error)
- DeletePost(post *Post) ([]string, error)
- LockPost(post *Post) error
- StickPost(post *Post) error
- VisiblePost(post *Post, visibility PostVisibleT) error
- UpdatePost(post *Post) error
- CreatePostStar(postID, userID int64) (*PostStar, error)
- DeletePostStar(p *PostStar) error
- CreatePostCollection(postID, userID int64) (*PostCollection, error)
- DeletePostCollection(p *PostCollection) error
- CreatePostContent(content *PostContent) (*PostContent, error)
+ CreatePost(post *ms.Post) (*ms.Post, error)
+ DeletePost(post *ms.Post) ([]string, error)
+ LockPost(post *ms.Post) error
+ StickPost(post *ms.Post) error
+ HighlightPost(userId, postId int64) (int, error)
+ VisiblePost(post *ms.Post, visibility PostVisibleT) error
+ UpdatePost(post *ms.Post) error
+ CreatePostStar(postID, userID int64) (*ms.PostStar, error)
+ DeletePostStar(p *ms.PostStar) error
+ CreatePostCollection(postID, userID int64) (*ms.PostCollection, error)
+ DeletePostCollection(p *ms.PostCollection) error
+ CreatePostContent(content *ms.PostContent) (*ms.PostContent, error)
+ CreateAttachment(obj *ms.Attachment) (int64, error)
}
// TweetHelpService 推文辅助服务
type TweetHelpService interface {
- RevampPosts(posts []*PostFormated) ([]*PostFormated, error)
- MergePosts(posts []*Post) ([]*PostFormated, error)
+ RevampPosts(posts []*ms.PostFormated) ([]*ms.PostFormated, error)
+ MergePosts(posts []*ms.Post) ([]*ms.PostFormated, error)
+}
+
+// TweetServantA 推文检索服务(版本A)
+type TweetServantA interface {
+ TweetInfoById(id int64) (*cs.TweetInfo, error)
+ TweetItemById(id int64) (*cs.TweetItem, error)
+ UserTweets(visitorId, userId int64) (cs.TweetList, error)
+ ReactionByTweetId(userId int64, tweetId int64) (*cs.ReactionItem, error)
+ UserReactions(userId int64, limit int, offset int) (cs.ReactionList, error)
+ FavoriteByTweetId(userId int64, tweetId int64) (*cs.FavoriteItem, error)
+ UserFavorites(userId int64, limit int, offset int) (cs.FavoriteList, error)
+ AttachmentByTweetId(userId int64, tweetId int64) (*cs.AttachmentBill, error)
+}
+
+// TweetManageServantA 推文管理服务,包括创建/删除/更新推文(版本A)
+type TweetManageServantA interface {
+ CreateAttachment(obj *cs.Attachment) (int64, error)
+ CreateTweet(userId int64, req *cs.NewTweetReq) (*cs.TweetItem, error)
+ DeleteTweet(userId int64, tweetId int64) ([]string, error)
+ LockTweet(userId int64, tweetId int64) error
+ StickTweet(userId int64, tweetId int64) error
+ VisibleTweet(userId int64, visibility cs.TweetVisibleType) error
+ CreateReaction(userId int64, tweetId int64) error
+ DeleteReaction(userId int64, reactionId int64) error
+ CreateFavorite(userId int64, tweetId int64) error
+ DeleteFavorite(userId int64, favoriteId int64) error
}
-// IndexPostsService 广场首页推文列表服务
-type IndexPostsService interface {
- IndexPosts(user *User, offset int, limit int) (*IndexTweetList, error)
+// TweetHelpServantA 推文辅助服务(版本A)
+type TweetHelpServantA interface {
+ RevampTweets(tweets cs.TweetList) (cs.TweetList, error)
+ MergeTweets(tweets cs.TweetInfo) (cs.TweetList, error)
}
diff --git a/internal/core/user.go b/internal/core/user.go
index ed132dd3..04d30e23 100644
--- a/internal/core/user.go
+++ b/internal/core/user.go
@@ -4,30 +4,17 @@
package core
-type (
- ContactItem struct {
- UserId int64 `json:"user_id"`
- UserName string `json:"username"`
- Nickname string `json:"nickname"`
- Avatar string `json:"avatar"`
- Phone string `json:"phone"`
- }
-
- ContactList struct {
- Contacts []ContactItem `json:"contacts"`
- Total int64 `json:"total"`
- }
-)
+import "github.com/rocboss/paopao-ce/internal/core/ms"
// UserManageService 用户管理服务
type UserManageService interface {
- GetUserByID(id int64) (*User, error)
- GetUserByUsername(username string) (*User, error)
- GetUserByPhone(phone string) (*User, error)
- GetUsersByIDs(ids []int64) ([]*User, error)
- GetUsersByKeyword(keyword string) ([]*User, error)
- CreateUser(user *User) (*User, error)
- UpdateUser(user *User) error
+ GetUserByID(id int64) (*ms.User, error)
+ GetUserByUsername(username string) (*ms.User, error)
+ GetUserByPhone(phone string) (*ms.User, error)
+ GetUsersByIDs(ids []int64) ([]*ms.User, error)
+ GetUsersByKeyword(keyword string) ([]*ms.User, error)
+ CreateUser(user *ms.User) (*ms.User, error)
+ UpdateUser(user *ms.User) error
}
// ContactManageService 联系人管理服务
@@ -36,6 +23,6 @@ type ContactManageService interface {
AddFriend(userId int64, friendId int64) error
RejectFriend(userId int64, friendId int64) error
DeleteFriend(userId int64, friendId int64) error
- GetContacts(userId int64, offset int, limit int) (*ContactList, error)
+ GetContacts(userId int64, offset int, limit int) (*ms.ContactList, error)
IsFriend(userID int64, friendID int64) bool
}
diff --git a/internal/core/wallet.go b/internal/core/wallet.go
index c4792d3b..e452a3ad 100644
--- a/internal/core/wallet.go
+++ b/internal/core/wallet.go
@@ -5,20 +5,15 @@
package core
import (
- "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr"
-)
-
-type (
- WalletStatement = dbr.WalletStatement
- WalletRecharge = dbr.WalletRecharge
+ "github.com/rocboss/paopao-ce/internal/core/ms"
)
// WalletService wallet service interface
type WalletService interface {
- GetUserWalletBills(userID int64, offset, limit int) ([]*WalletStatement, error)
+ GetUserWalletBills(userID int64, offset, limit int) ([]*ms.WalletStatement, error)
GetUserWalletBillCount(userID int64) (int64, error)
- GetRechargeByID(id int64) (*WalletRecharge, error)
- CreateRecharge(userId, amount int64) (*WalletRecharge, error)
- HandleRechargeSuccess(recharge *WalletRecharge, tradeNo string) error
- HandlePostAttachmentBought(post *Post, user *User) error
+ GetRechargeByID(id int64) (*ms.WalletRecharge, error)
+ CreateRecharge(userId, amount int64) (*ms.WalletRecharge, error)
+ HandleRechargeSuccess(recharge *ms.WalletRecharge, tradeNo string) error
+ HandlePostAttachmentBought(post *ms.Post, user *ms.User) error
}
diff --git a/internal/dao/cache/base.go b/internal/dao/cache/base.go
new file mode 100644
index 00000000..fe314683
--- /dev/null
+++ b/internal/dao/cache/base.go
@@ -0,0 +1,230 @@
+// Copyright 2023 ROC. All rights reserved.
+// Use of this source code is governed by a MIT style
+// license that can be found in the LICENSE file.
+
+package cache
+
+import (
+ "bytes"
+ "encoding/gob"
+ "fmt"
+ "strconv"
+ "strings"
+ "time"
+
+ "github.com/Masterminds/semver/v3"
+ "github.com/rocboss/paopao-ce/internal/conf"
+ "github.com/rocboss/paopao-ce/internal/core"
+ "github.com/rocboss/paopao-ce/internal/core/ms"
+ "github.com/rocboss/paopao-ce/pkg/types"
+ "github.com/sirupsen/logrus"
+)
+
+const (
+ _cacheIndexKey = "paopao_index"
+)
+
+var (
+ _ core.CacheIndexService = (*cacheIndexSrv)(nil)
+ _ core.VersionInfo = (*cacheIndexSrv)(nil)
+)
+
+type postsEntry struct {
+ key string
+ tweets *ms.IndexTweetList
+}
+
+type tweetsCache interface {
+ core.VersionInfo
+ getTweetsBytes(key string) ([]byte, error)
+ setTweetsBytes(key string, bs []byte) error
+ delTweets(keys []string) error
+ allKeys() ([]string, error)
+}
+
+type cacheIndexSrv struct {
+ ips core.IndexPostsService
+ ams core.AuthorizationManageService
+
+ name string
+ version *semver.Version
+ indexActionCh chan *core.IndexAction
+ cachePostsCh chan *postsEntry
+ cache tweetsCache
+ lastCacheResetTime time.Time
+ preventDuration time.Duration
+}
+
+func (s *cacheIndexSrv) IndexPosts(user *ms.User, offset int, limit int) (*ms.IndexTweetList, error) {
+ key := s.keyFrom(user, offset, limit)
+ posts, err := s.getPosts(key)
+ if err == nil {
+ logrus.Debugf("cacheIndexSrv.IndexPosts get index posts from cache by key: %s", key)
+ return posts, nil
+ }
+
+ if posts, err = s.ips.IndexPosts(user, offset, limit); err != nil {
+ return nil, err
+ }
+ logrus.Debugf("cacheIndexSrv.IndexPosts get index posts from database by key: %s", key)
+ s.cachePosts(key, posts)
+ return posts, nil
+}
+
+func (s *cacheIndexSrv) getPosts(key string) (*ms.IndexTweetList, error) {
+ data, err := s.cache.getTweetsBytes(key)
+ if err != nil {
+ logrus.Debugf("cacheIndexSrv.getPosts get posts by key: %s from cache err: %v", key, err)
+ return nil, err
+ }
+ buf := bytes.NewBuffer(data)
+ dec := gob.NewDecoder(buf)
+ var resp ms.IndexTweetList
+ if err := dec.Decode(&resp); err != nil {
+ logrus.Debugf("cacheIndexSrv.getPosts get posts from cache in decode err: %v", err)
+ return nil, err
+ }
+ return &resp, nil
+}
+
+func (s *cacheIndexSrv) cachePosts(key string, tweets *ms.IndexTweetList) {
+ entry := &postsEntry{key: key, tweets: tweets}
+ select {
+ case s.cachePostsCh <- entry:
+ logrus.Debugf("cacheIndexSrv.cachePosts cachePosts by chan of key: %s", key)
+ default:
+ go func(ch chan<- *postsEntry, entry *postsEntry) {
+ logrus.Debugf("cacheIndexSrv.cachePosts cachePosts indexAction by goroutine of key: %s", key)
+ ch <- entry
+ }(s.cachePostsCh, entry)
+ }
+}
+
+func (s *cacheIndexSrv) setPosts(entry *postsEntry) {
+ var buf bytes.Buffer
+ enc := gob.NewEncoder(&buf)
+ if err := enc.Encode(entry.tweets); err != nil {
+ logrus.Debugf("cacheIndexSrv.setPosts setPosts encode post entry err: %v", err)
+ return
+ }
+ if err := s.cache.setTweetsBytes(entry.key, buf.Bytes()); err != nil {
+ logrus.Debugf("cacheIndexSrv.setPosts setPosts set cache err: %v", err)
+ }
+ logrus.Debugf("cacheIndexSrv.setPosts setPosts set cache by key: %s", entry.key)
+}
+
+func (s *cacheIndexSrv) keyFrom(user *ms.User, offset int, limit int) string {
+ var userId int64 = -1
+ if user != nil {
+ userId = user.ID
+ }
+ return fmt.Sprintf("%s:%d:%d:%d", _cacheIndexKey, userId, offset, limit)
+}
+
+func (s *cacheIndexSrv) SendAction(act core.IdxAct, post *ms.Post) {
+ action := core.NewIndexAction(act, post)
+ select {
+ case s.indexActionCh <- action:
+ logrus.Debugf("cacheIndexSrv.SendAction send indexAction by chan: %s", act)
+ default:
+ go func(ch chan<- *core.IndexAction, act *core.IndexAction) {
+ logrus.Debugf("cacheIndexSrv.SendAction send indexAction by goroutine: %s", action.Act)
+ ch <- act
+ }(s.indexActionCh, action)
+ }
+}
+
+func (s *cacheIndexSrv) startIndexPosts() {
+ for {
+ select {
+ case entry := <-s.cachePostsCh:
+ s.setPosts(entry)
+ case action := <-s.indexActionCh:
+ s.handleIndexAction(action)
+ }
+ }
+}
+
+func (s *cacheIndexSrv) handleIndexAction(action *core.IndexAction) {
+ act, post := action.Act, action.Post
+
+ // 创建/删除 私密推文特殊处理
+ switch act {
+ case core.IdxActCreatePost, core.IdxActDeletePost:
+ if post.Visibility == core.PostVisitPrivate {
+ s.deleteCacheByUserId(post.UserID, true)
+ return
+ }
+ }
+
+ // 如果在s.preventDuration时间内就清除所有缓存,否则只清除自个儿的缓存
+ // TODO: 需要优化只清除受影响的缓存,后续完善
+ if time.Since(s.lastCacheResetTime) > s.preventDuration {
+ s.deleteCacheByUserId(post.UserID, false)
+ } else {
+ s.deleteCacheByUserId(post.UserID, true)
+ }
+}
+
+func (s *cacheIndexSrv) deleteCacheByUserId(id int64, oneself bool) {
+ var keys []string
+ userId := strconv.FormatInt(id, 10)
+ friendSet := ms.FriendSet{}
+ if !oneself {
+ friendSet = s.ams.MyFriendSet(id)
+ }
+ friendSet[userId] = types.Empty{}
+
+ // 获取需要删除缓存的key,目前是仅删除自个儿的缓存
+ allKeys, err := s.cache.allKeys()
+ if err != nil {
+ logrus.Debugf("cacheIndexSrv.deleteCacheByUserId userId: %s err:%s", userId, err)
+ }
+ for _, key := range allKeys {
+ keyParts := strings.Split(key, ":")
+ if len(keyParts) > 2 && keyParts[0] == _cacheIndexKey {
+ if _, ok := friendSet[keyParts[1]]; ok {
+ keys = append(keys, key)
+ }
+ }
+ }
+
+ // 执行删缓存
+ s.cache.delTweets(keys)
+ s.lastCacheResetTime = time.Now()
+ logrus.Debugf("cacheIndexSrv.deleteCacheByUserId userId:%s oneself:%t keys:%d", userId, oneself, len(keys))
+}
+
+func (s *cacheIndexSrv) Name() string {
+ return s.name
+}
+
+func (s *cacheIndexSrv) Version() *semver.Version {
+ return s.version
+}
+
+func newCacheIndexSrv(ips core.IndexPostsService, ams core.AuthorizationManageService, tc tweetsCache) *cacheIndexSrv {
+ cacheIndex := &cacheIndexSrv{
+ ips: ips,
+ ams: ams,
+ cache: tc,
+ name: tc.Name(),
+ version: tc.Version(),
+ preventDuration: 10 * time.Second,
+ }
+
+ // indexActionCh capacity custom configure by conf.yaml need in [10, 10000]
+ // or re-compile source to adjust min/max capacity
+ capacity := conf.CacheIndexSetting.MaxUpdateQPS
+ if capacity < 10 {
+ capacity = 10
+ } else if capacity > 10000 {
+ capacity = 10000
+ }
+ cacheIndex.indexActionCh = make(chan *core.IndexAction, capacity)
+ cacheIndex.cachePostsCh = make(chan *postsEntry, capacity)
+ // 启动索引更新器
+ go cacheIndex.startIndexPosts()
+
+ return cacheIndex
+}
diff --git a/internal/dao/cache/bigcache.go b/internal/dao/cache/bigcache.go
index 8ec83c38..202627e3 100644
--- a/internal/dao/cache/bigcache.go
+++ b/internal/dao/cache/bigcache.go
@@ -5,189 +5,51 @@
package cache
import (
- "bytes"
- "encoding/gob"
- "fmt"
- "strconv"
- "strings"
- "time"
-
"github.com/Masterminds/semver/v3"
"github.com/allegro/bigcache/v3"
- "github.com/rocboss/paopao-ce/internal/core"
- "github.com/rocboss/paopao-ce/pkg/types"
- "github.com/sirupsen/logrus"
)
var (
- _ core.CacheIndexService = (*bigCacheIndexServant)(nil)
- _ core.VersionInfo = (*bigCacheIndexServant)(nil)
+ _ tweetsCache = (*bigCacheTweetsCache)(nil)
)
-type postsEntry struct {
- key string
- tweets *core.IndexTweetList
+type bigCacheTweetsCache struct {
+ name string
+ version *semver.Version
+ bc *bigcache.BigCache
}
-type bigCacheIndexServant struct {
- ips core.IndexPostsService
- ams core.AuthorizationManageService
-
- indexActionCh chan *core.IndexAction
- cachePostsCh chan *postsEntry
- cache *bigcache.BigCache
- lastCacheResetTime time.Time
- preventDuration time.Duration
-}
-
-func (s *bigCacheIndexServant) IndexPosts(user *core.User, offset int, limit int) (*core.IndexTweetList, error) {
- key := s.keyFrom(user, offset, limit)
- posts, err := s.getPosts(key)
- if err == nil {
- logrus.Debugf("bigCacheIndexServant.IndexPosts get index posts from cache by key: %s", key)
- return posts, nil
- }
-
- if posts, err = s.ips.IndexPosts(user, offset, limit); err != nil {
- return nil, err
- }
- logrus.Debugf("bigCacheIndexServant.IndexPosts get index posts from database by key: %s", key)
- s.cachePosts(key, posts)
- return posts, nil
+func (s *bigCacheTweetsCache) getTweetsBytes(key string) ([]byte, error) {
+ return s.bc.Get(key)
}
-func (s *bigCacheIndexServant) getPosts(key string) (*core.IndexTweetList, error) {
- data, err := s.cache.Get(key)
- if err != nil {
- logrus.Debugf("bigCacheIndexServant.getPosts get posts by key: %s from cache err: %v", key, err)
- return nil, err
- }
- buf := bytes.NewBuffer(data)
- dec := gob.NewDecoder(buf)
- var resp core.IndexTweetList
- if err := dec.Decode(&resp); err != nil {
- logrus.Debugf("bigCacheIndexServant.getPosts get posts from cache in decode err: %v", err)
- return nil, err
- }
- return &resp, nil
-}
-
-func (s *bigCacheIndexServant) cachePosts(key string, tweets *core.IndexTweetList) {
- entry := &postsEntry{key: key, tweets: tweets}
- select {
- case s.cachePostsCh <- entry:
- logrus.Debugf("bigCacheIndexServant.cachePosts cachePosts by chan of key: %s", key)
- default:
- go func(ch chan<- *postsEntry, entry *postsEntry) {
- logrus.Debugf("bigCacheIndexServant.cachePosts cachePosts indexAction by goroutine of key: %s", key)
- ch <- entry
- }(s.cachePostsCh, entry)
- }
-}
-
-func (s *bigCacheIndexServant) setPosts(entry *postsEntry) {
- var buf bytes.Buffer
- enc := gob.NewEncoder(&buf)
- if err := enc.Encode(entry.tweets); err != nil {
- logrus.Debugf("bigCacheIndexServant.setPosts setPosts encode post entry err: %v", err)
- return
- }
- if err := s.cache.Set(entry.key, buf.Bytes()); err != nil {
- logrus.Debugf("bigCacheIndexServant.setPosts setPosts set cache err: %v", err)
- }
- logrus.Debugf("bigCacheIndexServant.setPosts setPosts set cache by key: %s", entry.key)
-}
-
-func (s *bigCacheIndexServant) keyFrom(user *core.User, offset int, limit int) string {
- var userId int64 = -1
- if user != nil {
- userId = user.ID
- }
- return fmt.Sprintf("index:%d:%d:%d", userId, offset, limit)
+func (s *bigCacheTweetsCache) setTweetsBytes(key string, bs []byte) error {
+ return s.bc.Set(key, bs)
}
-func (s *bigCacheIndexServant) SendAction(act core.IdxAct, post *core.Post) {
- action := core.NewIndexAction(act, post)
- select {
- case s.indexActionCh <- action:
- logrus.Debugf("bigCacheIndexServant.SendAction send indexAction by chan: %s", act)
- default:
- go func(ch chan<- *core.IndexAction, act *core.IndexAction) {
- logrus.Debugf("bigCacheIndexServant.SendAction send indexAction by goroutine: %s", action.Act)
- ch <- act
- }(s.indexActionCh, action)
- }
-}
-
-func (s *bigCacheIndexServant) startIndexPosts() {
- for {
- select {
- case entry := <-s.cachePostsCh:
- s.setPosts(entry)
- case action := <-s.indexActionCh:
- s.handleIndexAction(action)
- }
- }
-}
-
-func (s *bigCacheIndexServant) handleIndexAction(action *core.IndexAction) {
- act, post := action.Act, action.Post
-
- // 创建/删除 私密推文特殊处理
- switch act {
- case core.IdxActCreatePost, core.IdxActDeletePost:
- if post.Visibility == core.PostVisitPrivate {
- s.deleteCacheByUserId(post.UserID, true)
- return
- }
- }
-
- // 如果在s.preventDuration时间内就清除所有缓存,否则只清除自个儿的缓存
- // TODO: 需要优化只清除受影响的缓存,后续完善
- if time.Since(s.lastCacheResetTime) > s.preventDuration {
- s.deleteCacheByUserId(post.UserID, false)
- } else {
- s.deleteCacheByUserId(post.UserID, true)
+func (s *bigCacheTweetsCache) delTweets(keys []string) error {
+ for _, k := range keys {
+ s.bc.Delete(k)
}
+ return nil
}
-func (s *bigCacheIndexServant) deleteCacheByUserId(id int64, oneself bool) {
+func (s *bigCacheTweetsCache) allKeys() ([]string, error) {
var keys []string
- userId := strconv.FormatInt(id, 10)
- friendSet := core.FriendSet{}
- if !oneself {
- friendSet = s.ams.MyFriendSet(id)
- }
- friendSet[userId] = types.Empty{}
-
- // 获取需要删除缓存的key,目前是仅删除自个儿的缓存
- for it := s.cache.Iterator(); it.SetNext(); {
+ for it := s.bc.Iterator(); it.SetNext(); {
entry, err := it.Value()
if err != nil {
- logrus.Debugf("bigCacheIndexServant.deleteCacheByUserId userId: %s err:%s", userId, err)
- return
+ return nil, err
}
- key := entry.Key()
- keyParts := strings.Split(key, ":")
- if len(keyParts) > 2 && keyParts[0] == "index" {
- if _, ok := friendSet[keyParts[1]]; ok {
- keys = append(keys, key)
- }
- }
- }
-
- // 执行删缓存
- for _, k := range keys {
- s.cache.Delete(k)
+ keys = append(keys, entry.Key())
}
- s.lastCacheResetTime = time.Now()
- logrus.Debugf("bigCacheIndexServant.deleteCacheByUserId userId:%s oneself:%t keys:%d", userId, oneself, len(keys))
+ return keys, nil
}
-func (s *bigCacheIndexServant) Name() string {
+func (s *bigCacheTweetsCache) Name() string {
return "BigCacheIndex"
}
-func (s *bigCacheIndexServant) Version() *semver.Version {
+func (s *bigCacheTweetsCache) Version() *semver.Version {
return semver.MustParse("v0.2.0")
}
diff --git a/internal/dao/cache/cache.go b/internal/dao/cache/cache.go
index 773c9a2f..6c97d2ec 100644
--- a/internal/dao/cache/cache.go
+++ b/internal/dao/cache/cache.go
@@ -13,40 +13,37 @@ import (
"github.com/sirupsen/logrus"
)
+func NewRedisCache() core.RedisCache {
+ return &redisCache{
+ c: conf.MustRedisClient(),
+ }
+}
+
func NewBigCacheIndexService(ips core.IndexPostsService, ams core.AuthorizationManageService) (core.CacheIndexService, core.VersionInfo) {
s := conf.BigCacheIndexSetting
+ c := bigcache.DefaultConfig(s.ExpireInSecond)
+ c.Shards = s.MaxIndexPage
+ c.HardMaxCacheSize = s.HardMaxCacheSize
+ c.Verbose = s.Verbose
+ c.MaxEntrySize = 10000
+ c.Logger = logrus.StandardLogger()
- config := bigcache.DefaultConfig(s.ExpireInSecond)
- config.Shards = s.MaxIndexPage
- config.Verbose = s.Verbose
- config.MaxEntrySize = 10000
- config.Logger = logrus.StandardLogger()
- cache, err := bigcache.NewBigCache(config)
+ bc, err := bigcache.NewBigCache(c)
if err != nil {
logrus.Fatalf("initial bigCahceIndex failure by err: %v", err)
}
+ cacheIndex := newCacheIndexSrv(ips, ams, &bigCacheTweetsCache{
+ bc: bc,
+ })
+ return cacheIndex, cacheIndex
+}
- cacheIndex := &bigCacheIndexServant{
- ips: ips,
- ams: ams,
- cache: cache,
- preventDuration: 10 * time.Second,
- }
-
- // indexActionCh capacity custom configure by conf.yaml need in [10, 10000]
- // or re-compile source to adjust min/max capacity
- capacity := conf.CacheIndexSetting.MaxUpdateQPS
- if capacity < 10 {
- capacity = 10
- } else if capacity > 10000 {
- capacity = 10000
- }
- cacheIndex.indexActionCh = make(chan *core.IndexAction, capacity)
- cacheIndex.cachePostsCh = make(chan *postsEntry, capacity)
-
- // 启动索引更新器
- go cacheIndex.startIndexPosts()
-
+func NewRedisCacheIndexService(ips core.IndexPostsService, ams core.AuthorizationManageService) (core.CacheIndexService, core.VersionInfo) {
+ cacheIndex := newCacheIndexSrv(ips, ams, &redisCacheTweetsCache{
+ expireDuration: conf.RedisCacheIndexSetting.ExpireInSecond,
+ expireInSecond: int64(conf.RedisCacheIndexSetting.ExpireInSecond / time.Second),
+ c: conf.MustRedisClient(),
+ })
return cacheIndex, cacheIndex
}
diff --git a/internal/dao/cache/none.go b/internal/dao/cache/none.go
index ce6e1caf..079c453b 100644
--- a/internal/dao/cache/none.go
+++ b/internal/dao/cache/none.go
@@ -7,6 +7,9 @@ package cache
import (
"github.com/Masterminds/semver/v3"
"github.com/rocboss/paopao-ce/internal/core"
+ "github.com/rocboss/paopao-ce/internal/core/cs"
+ "github.com/rocboss/paopao-ce/internal/core/ms"
+ "github.com/rocboss/paopao-ce/pkg/debug"
)
var (
@@ -18,11 +21,16 @@ type noneCacheIndexServant struct {
ips core.IndexPostsService
}
-func (s *noneCacheIndexServant) IndexPosts(user *core.User, offset int, limit int) (*core.IndexTweetList, error) {
+func (s *noneCacheIndexServant) IndexPosts(user *ms.User, offset int, limit int) (*ms.IndexTweetList, error) {
return s.ips.IndexPosts(user, offset, limit)
}
-func (s *noneCacheIndexServant) SendAction(_act core.IdxAct, _post *core.Post) {
+func (s *noneCacheIndexServant) TweetTimeline(userId int64, offset int, limit int) (*cs.TweetBox, error) {
+ // TODO
+ return nil, debug.ErrNotImplemented
+}
+
+func (s *noneCacheIndexServant) SendAction(_act core.IdxAct, _post *ms.Post) {
// empty
}
diff --git a/internal/dao/cache/redis.go b/internal/dao/cache/redis.go
new file mode 100644
index 00000000..50b581a7
--- /dev/null
+++ b/internal/dao/cache/redis.go
@@ -0,0 +1,153 @@
+// Copyright 2023 ROC. All rights reserved.
+// Use of this source code is governed by a MIT style
+// license that can be found in the LICENSE file.
+
+package cache
+
+import (
+ "context"
+ "fmt"
+ "time"
+ "unsafe"
+
+ "github.com/Masterminds/semver/v3"
+ "github.com/redis/rueidis"
+ "github.com/rocboss/paopao-ce/internal/core"
+)
+
+var (
+ _ core.RedisCache = (*redisCache)(nil)
+ _ tweetsCache = (*redisCacheTweetsCache)(nil)
+)
+
+const (
+ _cacheIndexKeyPattern = _cacheIndexKey + "*"
+ _pushToSearchJobKey = "paopao_push_to_search_job"
+ _countLoginErrKey = "paopao_count_login_err"
+ _imgCaptchaKey = "paopao_img_captcha:"
+ _smsCaptchaKey = "paopao_sms_captcha"
+ _countWhisperKey = "paopao_whisper_key"
+ _rechargeStatusKey = "paopao_recharge_status:"
+)
+
+type redisCache struct {
+ c rueidis.Client
+}
+
+type redisCacheTweetsCache struct {
+ expireDuration time.Duration
+ expireInSecond int64
+ c rueidis.Client
+}
+
+func (s *redisCacheTweetsCache) getTweetsBytes(key string) ([]byte, error) {
+ res, err := rueidis.MGetCache(s.c, context.Background(), s.expireDuration, []string{key})
+ if err != nil {
+ return nil, err
+ }
+ message := res[key]
+ return message.AsBytes()
+}
+
+func (s *redisCacheTweetsCache) setTweetsBytes(key string, bs []byte) error {
+ cmd := s.c.B().Set().Key(key).Value(rueidis.BinaryString(bs)).ExSeconds(s.expireInSecond).Build()
+ return s.c.Do(context.Background(), cmd).Error()
+}
+
+func (s *redisCacheTweetsCache) delTweets(keys []string) error {
+ cmd := s.c.B().Del().Key(keys...).Build()
+ return s.c.Do(context.Background(), cmd).Error()
+}
+
+func (s *redisCacheTweetsCache) allKeys() ([]string, error) {
+ cmd := s.c.B().Keys().Pattern(_cacheIndexKeyPattern).Build()
+ return s.c.Do(context.Background(), cmd).AsStrSlice()
+}
+
+func (s *redisCacheTweetsCache) Name() string {
+ return "RedisCacheIndex"
+}
+
+func (s *redisCacheTweetsCache) Version() *semver.Version {
+ return semver.MustParse("v0.1.0")
+}
+
+func (r *redisCache) SetPushToSearchJob(ctx context.Context) error {
+ return r.c.Do(ctx, r.c.B().Set().
+ Key(_pushToSearchJobKey).Value("1").
+ Nx().ExSeconds(3600).
+ Build()).Error()
+}
+
+func (r *redisCache) DelPushToSearchJob(ctx context.Context) error {
+ return r.c.Do(ctx, r.c.B().Del().Key(_pushToSearchJobKey).Build()).Error()
+}
+
+func (r *redisCache) SetImgCaptcha(ctx context.Context, id string, value string) error {
+ return r.c.Do(ctx, r.c.B().Set().
+ Key(_imgCaptchaKey+id).Value(value).
+ ExSeconds(300).
+ Build()).Error()
+}
+
+func (r *redisCache) GetImgCaptcha(ctx context.Context, id string) (string, error) {
+ res, err := r.c.Do(ctx, r.c.B().Get().Key(_imgCaptchaKey+id).Build()).AsBytes()
+ return unsafe.String(&res[0], len(res)), err
+}
+
+func (r *redisCache) DelImgCaptcha(ctx context.Context, id string) error {
+ return r.c.Do(ctx, r.c.B().Del().Key(_imgCaptchaKey+id).Build()).Error()
+}
+
+func (r *redisCache) GetCountSmsCaptcha(ctx context.Context, phone string) (int64, error) {
+ return r.c.Do(ctx, r.c.B().Get().Key(_smsCaptchaKey+phone).Build()).AsInt64()
+}
+
+func (r *redisCache) IncrCountSmsCaptcha(ctx context.Context, phone string) (err error) {
+ if err = r.c.Do(ctx, r.c.B().Incr().Key(_smsCaptchaKey+phone).Build()).Error(); err == nil {
+ currentTime := time.Now()
+ endTime := time.Date(currentTime.Year(), currentTime.Month(), currentTime.Day(), 23, 59, 59, 0, currentTime.Location())
+ err = r.c.Do(ctx, r.c.B().Expire().Key(_smsCaptchaKey+phone).Seconds(int64(endTime.Sub(currentTime)/time.Second)).Build()).Error()
+ }
+ return
+}
+
+func (r *redisCache) GetCountLoginErr(ctx context.Context, id int64) (int64, error) {
+ return r.c.Do(ctx, r.c.B().Get().Key(fmt.Sprintf("%s:%d", _countLoginErrKey, id)).Build()).AsInt64()
+}
+
+func (r *redisCache) DelCountLoginErr(ctx context.Context, id int64) error {
+ return r.c.Do(ctx, r.c.B().Del().Key(fmt.Sprintf("%s:%d", _countLoginErrKey, id)).Build()).Error()
+}
+
+func (r *redisCache) IncrCountLoginErr(ctx context.Context, id int64) error {
+ err := r.c.Do(ctx, r.c.B().Incr().Key(fmt.Sprintf("%s:%d", _countLoginErrKey, id)).Build()).Error()
+ if err == nil {
+ err = r.c.Do(ctx, r.c.B().Expire().Key(fmt.Sprintf("%s:%d", _countLoginErrKey, id)).Seconds(3600).Build()).Error()
+ }
+ return err
+}
+
+func (r *redisCache) GetCountWhisper(ctx context.Context, uid int64) (int64, error) {
+ return r.c.Do(ctx, r.c.B().Get().Key(fmt.Sprintf("%s:%d", _countWhisperKey, uid)).Build()).AsInt64()
+}
+
+func (r *redisCache) IncrCountWhisper(ctx context.Context, uid int64) (err error) {
+ key := fmt.Sprintf("%s:%d", _countWhisperKey, uid)
+ if err = r.c.Do(ctx, r.c.B().Incr().Key(key).Build()).Error(); err == nil {
+ currentTime := time.Now()
+ endTime := time.Date(currentTime.Year(), currentTime.Month(), currentTime.Day(), 23, 59, 59, 0, currentTime.Location())
+ err = r.c.Do(ctx, r.c.B().Expire().Key(key).Seconds(int64(endTime.Sub(currentTime)/time.Second)).Build()).Error()
+ }
+ return
+}
+
+func (r *redisCache) SetRechargeStatus(ctx context.Context, tradeNo string) error {
+ return r.c.Do(ctx, r.c.B().Set().
+ Key(_rechargeStatusKey+tradeNo).Value("1").
+ Nx().ExSeconds(5).Build()).Error()
+}
+
+func (r *redisCache) DelRechargeStatus(ctx context.Context, tradeNo string) error {
+ return r.c.Do(ctx, r.c.B().Del().Key(_rechargeStatusKey+tradeNo).Build()).Error()
+}
diff --git a/internal/dao/cache/simple.go b/internal/dao/cache/simple.go
index ba674d1b..a1c230d3 100644
--- a/internal/dao/cache/simple.go
+++ b/internal/dao/cache/simple.go
@@ -10,6 +10,9 @@ import (
"github.com/Masterminds/semver/v3"
"github.com/rocboss/paopao-ce/internal/core"
+ "github.com/rocboss/paopao-ce/internal/core/cs"
+ "github.com/rocboss/paopao-ce/internal/core/ms"
+ "github.com/rocboss/paopao-ce/pkg/debug"
"github.com/sirupsen/logrus"
)
@@ -22,21 +25,21 @@ type simpleCacheIndexServant struct {
ips core.IndexPostsService
indexActionCh chan core.IdxAct
- indexPosts *core.IndexTweetList
+ indexPosts *ms.IndexTweetList
atomicIndex atomic.Value
maxIndexSize int
checkTick *time.Ticker
expireIndexTick *time.Ticker
}
-func (s *simpleCacheIndexServant) IndexPosts(user *core.User, offset int, limit int) (*core.IndexTweetList, error) {
- cacheResp := s.atomicIndex.Load().(*core.IndexTweetList)
+func (s *simpleCacheIndexServant) IndexPosts(user *ms.User, offset int, limit int) (*ms.IndexTweetList, error) {
+ cacheResp := s.atomicIndex.Load().(*ms.IndexTweetList)
end := offset + limit
if cacheResp != nil {
size := len(cacheResp.Tweets)
logrus.Debugf("simpleCacheIndexServant.IndexPosts get index posts from cache posts: %d offset:%d limit:%d start:%d, end:%d", size, offset, limit, offset, end)
if size >= end {
- return &core.IndexTweetList{
+ return &ms.IndexTweetList{
Tweets: cacheResp.Tweets[offset:end],
Total: cacheResp.Total,
}, nil
@@ -47,7 +50,12 @@ func (s *simpleCacheIndexServant) IndexPosts(user *core.User, offset int, limit
return s.ips.IndexPosts(user, offset, limit)
}
-func (s *simpleCacheIndexServant) SendAction(act core.IdxAct, _post *core.Post) {
+func (s *simpleCacheIndexServant) TweetTimeline(userId int64, offset int, limit int) (*cs.TweetBox, error) {
+ // TODO
+ return nil, debug.ErrNotImplemented
+}
+
+func (s *simpleCacheIndexServant) SendAction(act core.IdxAct, _post *ms.Post) {
select {
case s.indexActionCh <- act:
logrus.Debugf("simpleCacheIndexServant.SendAction send indexAction by chan: %s", act)
diff --git a/internal/dao/dao.go b/internal/dao/dao.go
index d0b05c9c..b1f7d9f2 100644
--- a/internal/dao/dao.go
+++ b/internal/dao/dao.go
@@ -18,87 +18,114 @@ import (
)
var (
- ts core.TweetSearchService
- ds core.DataService
- oss core.ObjectStorageService
+ ts core.TweetSearchService
+ ds core.DataService
+ oss core.ObjectStorageService
+ webDsa core.WebDataServantA
- onceTs, onceDs, onceOss sync.Once
+ _onceInitial sync.Once
)
func DataService() core.DataService {
- onceDs.Do(func() {
- var v core.VersionInfo
- if cfg.If("Gorm") {
- ds, v = jinzhu.NewDataService()
- } else if cfg.If("Sqlx") && cfg.If("MySQL") {
- ds, v = sakila.NewDataService()
- } else if cfg.If("Sqlx") && (cfg.If("Postgres") || cfg.If("PostgreSQL")) {
- ds, v = slonik.NewDataService()
- } else {
- // default use gorm as orm for sql database
- ds, v = jinzhu.NewDataService()
- }
- logrus.Infof("use %s as data service with version %s", v.Name(), v.Version())
- })
+ lazyInitial()
return ds
}
+func WebDataServantA() core.WebDataServantA {
+ lazyInitial()
+ return webDsa
+}
+
func ObjectStorageService() core.ObjectStorageService {
- onceOss.Do(func() {
- var v core.VersionInfo
- if cfg.If("AliOSS") {
- oss, v = storage.MustAliossService()
- } else if cfg.If("COS") {
- oss, v = storage.NewCosService()
- } else if cfg.If("HuaweiOBS") {
- oss, v = storage.MustHuaweiobsService()
- } else if cfg.If("MinIO") {
- oss, v = storage.MustMinioService()
- } else if cfg.If("S3") {
- oss, v = storage.MustS3Service()
- logrus.Infof("use S3 as object storage by version %s", v.Version())
- return
- } else if cfg.If("LocalOSS") {
- oss, v = storage.MustLocalossService()
- } else {
- // default use AliOSS as object storage service
- oss, v = storage.MustAliossService()
- logrus.Infof("use default AliOSS as object storage by version %s", v.Version())
- return
- }
- logrus.Infof("use %s as object storage by version %s", v.Name(), v.Version())
- })
+ lazyInitial()
return oss
}
func TweetSearchService() core.TweetSearchService {
- onceTs.Do(func() {
- var v core.VersionInfo
- ams := newAuthorizationManageService()
- if cfg.If("Zinc") {
- ts, v = search.NewZincTweetSearchService(ams)
- } else if cfg.If("Meili") {
- ts, v = search.NewMeiliTweetSearchService(ams)
- } else {
- // default use Zinc as tweet search service
- ts, v = search.NewZincTweetSearchService(ams)
- }
- logrus.Infof("use %s as tweet search serice by version %s", v.Name(), v.Version())
-
- ts = search.NewBridgeTweetSearchService(ts)
- })
+ lazyInitial()
return ts
}
-func newAuthorizationManageService() (s core.AuthorizationManageService) {
+func newAuthorizationManageService() (ams core.AuthorizationManageService) {
if cfg.If("Gorm") {
- s = jinzhu.NewAuthorizationManageService()
- } else if cfg.If("Sqlx") && cfg.If("MySQL") {
- s = sakila.NewAuthorizationManageService()
- } else if cfg.If("Sqlx") && (cfg.If("Postgres") || cfg.If("PostgreSQL")) {
- s = slonik.NewAuthorizationManageService()
+ ams = jinzhu.NewAuthorizationManageService()
+ } else if cfg.If("Sqlx") {
+ ams = sakila.NewAuthorizationManageService()
+ } else if cfg.If("Sqlc") && cfg.Any("Postgres", "PostgreSQL") {
+ ams = slonik.NewAuthorizationManageService()
} else {
- s = jinzhu.NewAuthorizationManageService()
+ ams = jinzhu.NewAuthorizationManageService()
}
return
}
+
+// lazyInitial do some package lazy initialize for performance
+func lazyInitial() {
+ _onceInitial.Do(func() {
+ initDsX()
+ initOSS()
+ initTsX()
+ })
+}
+
+func initDsX() {
+ var dsVer, dsaVer core.VersionInfo
+ if cfg.If("Gorm") {
+ ds, dsVer = jinzhu.NewDataService()
+ webDsa, dsaVer = jinzhu.NewWebDataServantA()
+ } else if cfg.If("Sqlx") {
+ ds, dsVer = sakila.NewDataService()
+ webDsa, dsaVer = sakila.NewWebDataServantA()
+ } else if cfg.If("Sqlc") && cfg.Any("Postgres", "PostgreSQL") {
+ ds, dsVer = slonik.NewDataService()
+ webDsa, dsaVer = slonik.NewWebDataServantA()
+ } else {
+ // default use gorm as orm for sql database
+ ds, dsVer = jinzhu.NewDataService()
+ webDsa, dsaVer = jinzhu.NewWebDataServantA()
+ }
+ logrus.Infof("use %s as core.DataService with version %s", dsVer.Name(), dsVer.Version())
+ logrus.Infof("use %s as core.ServantA with version %s", dsaVer.Name(), dsaVer.Version())
+}
+
+func initOSS() {
+ var v core.VersionInfo
+ if cfg.If("AliOSS") {
+ oss, v = storage.MustAliossService()
+ } else if cfg.If("COS") {
+ oss, v = storage.NewCosService()
+ } else if cfg.If("HuaweiOBS") {
+ oss, v = storage.MustHuaweiobsService()
+ } else if cfg.If("MinIO") {
+ oss, v = storage.MustMinioService()
+ } else if cfg.If("S3") {
+ oss, v = storage.MustS3Service()
+ logrus.Infof("use S3 as object storage by version %s", v.Version())
+ return
+ } else if cfg.If("LocalOSS") {
+ oss, v = storage.MustLocalossService()
+ } else {
+ // default use AliOSS as object storage service
+ oss, v = storage.MustAliossService()
+ logrus.Infof("use default AliOSS as object storage by version %s", v.Version())
+ return
+ }
+ logrus.Infof("use %s as object storage by version %s", v.Name(), v.Version())
+}
+
+func initTsX() {
+ var v core.VersionInfo
+ ams := newAuthorizationManageService()
+ cfg.On(cfg.Actions{
+ "Zinc": func() {
+ ts, v = search.NewZincTweetSearchService(ams)
+ },
+ "Meili": func() {
+ ts, v = search.NewMeiliTweetSearchService(ams)
+ },
+ }, func() {
+ ts, v = search.NewZincTweetSearchService(ams)
+ })
+ logrus.Infof("use %s as tweet search serice by version %s", v.Name(), v.Version())
+ ts = search.NewBridgeTweetSearchService(ts)
+}
diff --git a/internal/dao/jinzhu/authority.go b/internal/dao/jinzhu/authority.go
index 5932fa24..9921f214 100644
--- a/internal/dao/jinzhu/authority.go
+++ b/internal/dao/jinzhu/authority.go
@@ -6,26 +6,27 @@ package jinzhu
import (
"github.com/rocboss/paopao-ce/internal/core"
+ "github.com/rocboss/paopao-ce/internal/core/ms"
"github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr"
"github.com/rocboss/paopao-ce/pkg/types"
"gorm.io/gorm"
)
var (
- _ core.AuthorizationManageService = (*authorizationManageServant)(nil)
+ _ core.AuthorizationManageService = (*authorizationManageSrv)(nil)
)
-type authorizationManageServant struct {
+type authorizationManageSrv struct {
db *gorm.DB
}
func newAuthorizationManageService(db *gorm.DB) core.AuthorizationManageService {
- return &authorizationManageServant{
+ return &authorizationManageSrv{
db: db,
}
}
-func (s *authorizationManageServant) IsAllow(user *core.User, action *core.Action) bool {
+func (s *authorizationManageSrv) IsAllow(user *ms.User, action *ms.Action) bool {
// user is activation if had bind phone
isActivation := (len(user.Phone) != 0)
isFriend := s.isFriend(user.ID, action.UserId)
@@ -33,37 +34,37 @@ func (s *authorizationManageServant) IsAllow(user *core.User, action *core.Actio
return action.Act.IsAllow(user, action.UserId, isFriend, isActivation)
}
-func (s *authorizationManageServant) MyFriendSet(userId int64) core.FriendSet {
+func (s *authorizationManageSrv) MyFriendSet(userId int64) ms.FriendSet {
ids, err := (&dbr.Contact{UserId: userId}).MyFriendIds(s.db)
if err != nil {
- return core.FriendSet{}
+ return ms.FriendSet{}
}
- resp := make(core.FriendSet, len(ids))
+ resp := make(ms.FriendSet, len(ids))
for _, id := range ids {
resp[id] = types.Empty{}
}
return resp
}
-func (s *authorizationManageServant) BeFriendFilter(userId int64) core.FriendFilter {
+func (s *authorizationManageSrv) BeFriendFilter(userId int64) ms.FriendFilter {
ids, err := (&dbr.Contact{FriendId: userId}).BeFriendIds(s.db)
if err != nil {
- return core.FriendFilter{}
+ return ms.FriendFilter{}
}
- resp := make(core.FriendFilter, len(ids))
+ resp := make(ms.FriendFilter, len(ids))
for _, id := range ids {
resp[id] = types.Empty{}
}
return resp
}
-func (s *authorizationManageServant) BeFriendIds(userId int64) ([]int64, error) {
+func (s *authorizationManageSrv) BeFriendIds(userId int64) ([]int64, error) {
return (&dbr.Contact{FriendId: userId}).BeFriendIds(s.db)
}
-func (s *authorizationManageServant) isFriend(userId int64, friendId int64) bool {
+func (s *authorizationManageSrv) isFriend(userId int64, friendId int64) bool {
contact, err := (&dbr.Contact{UserId: friendId, FriendId: userId}).GetByUserFriend(s.db)
if err == nil || contact.Status == dbr.ContactStatusAgree {
return true
diff --git a/internal/dao/jinzhu/comments.go b/internal/dao/jinzhu/comments.go
index 1af9e5ce..4ac08e18 100644
--- a/internal/dao/jinzhu/comments.go
+++ b/internal/dao/jinzhu/comments.go
@@ -5,41 +5,66 @@
package jinzhu
import (
+ "time"
+
"github.com/rocboss/paopao-ce/internal/core"
+ "github.com/rocboss/paopao-ce/internal/core/cs"
+ "github.com/rocboss/paopao-ce/internal/core/ms"
"github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr"
+ "github.com/rocboss/paopao-ce/pkg/types"
"gorm.io/gorm"
)
var (
- _ core.CommentService = (*commentServant)(nil)
- _ core.CommentManageService = (*commentManageServant)(nil)
+ _ core.CommentService = (*commentSrv)(nil)
+ _ core.CommentManageService = (*commentManageSrv)(nil)
)
-type commentServant struct {
+type commentSrv struct {
db *gorm.DB
}
-type commentManageServant struct {
+type commentManageSrv struct {
db *gorm.DB
}
func newCommentService(db *gorm.DB) core.CommentService {
- return &commentServant{
+ return &commentSrv{
db: db,
}
}
func newCommentManageService(db *gorm.DB) core.CommentManageService {
- return &commentManageServant{
+ return &commentManageSrv{
db: db,
}
}
-func (s *commentServant) GetComments(conditions *core.ConditionsT, offset, limit int) ([]*core.Comment, error) {
+func (s *commentSrv) GetCommentThumbsMap(userId int64, tweetId int64) (cs.CommentThumbsMap, cs.CommentThumbsMap, error) {
+ if userId < 0 {
+ return nil, nil, nil
+ }
+ commentThumbsList := cs.CommentThumbsList{}
+ err := s.db.Model(&dbr.TweetCommentThumbs{}).Where("user_id=? AND tweet_id=?", userId, tweetId).Find(&commentThumbsList).Error
+ if err != nil {
+ return nil, nil, err
+ }
+ commentThumbs, replyThumbs := make(cs.CommentThumbsMap), make(cs.CommentThumbsMap)
+ for _, thumbs := range commentThumbsList {
+ if thumbs.CommentType == 0 {
+ commentThumbs[thumbs.CommentID] = thumbs
+ } else {
+ replyThumbs[thumbs.ReplyID] = thumbs
+ }
+ }
+ return commentThumbs, replyThumbs, nil
+}
+
+func (s *commentSrv) GetComments(conditions *ms.ConditionsT, offset, limit int) ([]*ms.Comment, error) {
return (&dbr.Comment{}).List(s.db, conditions, offset, limit)
}
-func (s *commentServant) GetCommentByID(id int64) (*core.Comment, error) {
+func (s *commentSrv) GetCommentByID(id int64) (*ms.Comment, error) {
comment := &dbr.Comment{
Model: &dbr.Model{
ID: id,
@@ -48,7 +73,7 @@ func (s *commentServant) GetCommentByID(id int64) (*core.Comment, error) {
return comment.Get(s.db)
}
-func (s *commentServant) GetCommentReplyByID(id int64) (*core.CommentReply, error) {
+func (s *commentSrv) GetCommentReplyByID(id int64) (*ms.CommentReply, error) {
reply := &dbr.CommentReply{
Model: &dbr.Model{
ID: id,
@@ -57,21 +82,22 @@ func (s *commentServant) GetCommentReplyByID(id int64) (*core.CommentReply, erro
return reply.Get(s.db)
}
-func (s *commentServant) GetCommentCount(conditions *core.ConditionsT) (int64, error) {
+func (s *commentSrv) GetCommentCount(conditions *ms.ConditionsT) (int64, error) {
return (&dbr.Comment{}).Count(s.db, conditions)
}
-func (s *commentServant) GetCommentContentsByIDs(ids []int64) ([]*core.CommentContent, error) {
+func (s *commentSrv) GetCommentContentsByIDs(ids []int64) ([]*ms.CommentContent, error) {
commentContent := &dbr.CommentContent{}
return commentContent.List(s.db, &dbr.ConditionsT{
"comment_id IN ?": ids,
}, 0, 0)
}
-func (s *commentServant) GetCommentRepliesByID(ids []int64) ([]*core.CommentReplyFormated, error) {
+func (s *commentSrv) GetCommentRepliesByID(ids []int64) ([]*ms.CommentReplyFormated, error) {
CommentReply := &dbr.CommentReply{}
replies, err := CommentReply.List(s.db, &dbr.ConditionsT{
"comment_id IN ?": ids,
+ "ORDER": "id ASC",
}, 0, 0)
if err != nil {
@@ -87,7 +113,7 @@ func (s *commentServant) GetCommentRepliesByID(ids []int64) ([]*core.CommentRepl
if err != nil {
return nil, err
}
- repliesFormated := []*core.CommentReplyFormated{}
+ repliesFormated := []*ms.CommentReplyFormated{}
for _, reply := range replies {
replyFormated := reply.Format()
for _, user := range users {
@@ -105,22 +131,271 @@ func (s *commentServant) GetCommentRepliesByID(ids []int64) ([]*core.CommentRepl
return repliesFormated, nil
}
-func (s *commentManageServant) DeleteComment(comment *core.Comment) error {
- return comment.Delete(s.db)
+func (s *commentManageSrv) DeleteComment(comment *ms.Comment) error {
+ db := s.db.Begin()
+ defer db.Rollback()
+
+ err := comment.Delete(s.db)
+ if err != nil {
+ return err
+ }
+ err = db.Model(&dbr.TweetCommentThumbs{}).Where("user_id=? AND tweet_id=? AND comment_id=?", comment.UserID, comment.PostID, comment.ID).Updates(map[string]any{
+ "deleted_on": time.Now().Unix(),
+ "is_del": 1,
+ }).Error
+ if err != nil {
+ return err
+ }
+ db.Commit()
+ return nil
}
-func (s *commentManageServant) CreateComment(comment *core.Comment) (*core.Comment, error) {
+func (s *commentManageSrv) CreateComment(comment *ms.Comment) (*ms.Comment, error) {
return comment.Create(s.db)
}
-func (s *commentManageServant) CreateCommentReply(reply *core.CommentReply) (*core.CommentReply, error) {
+func (s *commentManageSrv) CreateCommentReply(reply *ms.CommentReply) (*ms.CommentReply, error) {
return reply.Create(s.db)
}
-func (s *commentManageServant) DeleteCommentReply(reply *core.CommentReply) error {
- return reply.Delete(s.db)
+func (s *commentManageSrv) DeleteCommentReply(reply *ms.CommentReply) (err error) {
+ db := s.db.Begin()
+ defer db.Rollback()
+
+ err = reply.Delete(s.db)
+ if err != nil {
+ return
+ }
+ err = db.Model(&dbr.TweetCommentThumbs{}).
+ Where("user_id=? AND comment_id=? AND reply_id=?", reply.UserID, reply.CommentID, reply.ID).Updates(map[string]any{
+ "deleted_on": time.Now().Unix(),
+ "is_del": 1,
+ }).Error
+ if err != nil {
+ return
+ }
+ db.Commit()
+ return
}
-func (s *commentManageServant) CreateCommentContent(content *core.CommentContent) (*core.CommentContent, error) {
+func (s *commentManageSrv) CreateCommentContent(content *ms.CommentContent) (*ms.CommentContent, error) {
return content.Create(s.db)
}
+
+func (s *commentManageSrv) ThumbsUpComment(userId int64, tweetId, commentId int64) error {
+ db := s.db.Begin()
+ defer db.Rollback()
+
+ var (
+ thumbsUpCount int32 = 0
+ thumbsDownCount int32 = 0
+ )
+ commentThumbs := &dbr.TweetCommentThumbs{}
+ // 检查thumbs状态
+ err := s.db.Where("user_id=? AND tweet_id=? AND comment_id=? AND comment_type=0", userId, tweetId, commentId).Take(commentThumbs).Error
+ if err == nil {
+ switch {
+ case commentThumbs.IsThumbsUp == types.Yes && commentThumbs.IsThumbsDown == types.No:
+ thumbsUpCount, thumbsDownCount = -1, 0
+ case commentThumbs.IsThumbsUp == types.No && commentThumbs.IsThumbsDown == types.No:
+ thumbsUpCount, thumbsDownCount = 1, 0
+ default:
+ thumbsUpCount, thumbsDownCount = 1, -1
+ commentThumbs.IsThumbsDown = types.No
+ }
+ commentThumbs.IsThumbsUp = 1 - commentThumbs.IsThumbsUp
+ commentThumbs.ModifiedOn = time.Now().Unix()
+ } else {
+ commentThumbs = &dbr.TweetCommentThumbs{
+ UserID: userId,
+ TweetID: tweetId,
+ CommentID: commentId,
+ IsThumbsUp: types.Yes,
+ IsThumbsDown: types.No,
+ CommentType: 0,
+ Model: &dbr.Model{
+ CreatedOn: time.Now().Unix(),
+ },
+ }
+ thumbsUpCount, thumbsDownCount = 1, 0
+ }
+ // 更新thumbs状态
+ if err = s.db.Save(commentThumbs).Error; err != nil {
+ return err
+ }
+ // 更新thumbsUpCount
+ if err = s.updateCommentThumbsUpCount(&dbr.Comment{}, commentId, thumbsUpCount, thumbsDownCount); err != nil {
+ return err
+ }
+ db.Commit()
+ return nil
+}
+
+func (s *commentManageSrv) ThumbsDownComment(userId int64, tweetId, commentId int64) error {
+ db := s.db.Begin()
+ defer db.Rollback()
+
+ var (
+ thumbsUpCount int32 = 0
+ thumbsDownCount int32 = 0
+ )
+ commentThumbs := &dbr.TweetCommentThumbs{}
+ // 检查thumbs状态
+ err := s.db.Where("user_id=? AND tweet_id=? AND comment_id=? AND comment_type=0", userId, tweetId, commentId).Take(commentThumbs).Error
+ if err == nil {
+ switch {
+ case commentThumbs.IsThumbsDown == types.Yes:
+ thumbsUpCount, thumbsDownCount = 0, -1
+ case commentThumbs.IsThumbsDown == types.No && commentThumbs.IsThumbsUp == types.No:
+ thumbsUpCount, thumbsDownCount = 0, 1
+ default:
+ thumbsUpCount, thumbsDownCount = -1, 1
+ commentThumbs.IsThumbsUp = types.No
+
+ }
+ commentThumbs.IsThumbsDown = 1 - commentThumbs.IsThumbsDown
+ commentThumbs.ModifiedOn = time.Now().Unix()
+ } else {
+ commentThumbs = &dbr.TweetCommentThumbs{
+ UserID: userId,
+ TweetID: tweetId,
+ CommentID: commentId,
+ IsThumbsUp: types.No,
+ IsThumbsDown: types.Yes,
+ CommentType: 0,
+ Model: &dbr.Model{
+ CreatedOn: time.Now().Unix(),
+ },
+ }
+ thumbsUpCount, thumbsDownCount = 0, 1
+ }
+ // 更新thumbs状态
+ if err = s.db.Save(commentThumbs).Error; err != nil {
+ return err
+ }
+ // 更新thumbsUpCount
+ if err = s.updateCommentThumbsUpCount(&dbr.Comment{}, commentId, thumbsUpCount, thumbsDownCount); err != nil {
+ return err
+ }
+ db.Commit()
+ return nil
+}
+
+func (s *commentManageSrv) ThumbsUpReply(userId int64, tweetId, commentId, replyId int64) error {
+ db := s.db.Begin()
+ defer db.Rollback()
+
+ var (
+ thumbsUpCount int32 = 0
+ thumbsDownCount int32 = 0
+ )
+ commentThumbs := &dbr.TweetCommentThumbs{}
+ // 检查thumbs状态
+ err := s.db.Where("user_id=? AND tweet_id=? AND comment_id=? AND reply_id=? AND comment_type=1", userId, tweetId, commentId, replyId).Take(commentThumbs).Error
+ if err == nil {
+ switch {
+ case commentThumbs.IsThumbsUp == types.Yes:
+ thumbsUpCount, thumbsDownCount = -1, 0
+ case commentThumbs.IsThumbsUp == types.No && commentThumbs.IsThumbsDown == types.No:
+ thumbsUpCount, thumbsDownCount = 1, 0
+ default:
+ thumbsUpCount, thumbsDownCount = 1, -1
+ commentThumbs.IsThumbsDown = types.No
+ }
+ commentThumbs.IsThumbsUp = 1 - commentThumbs.IsThumbsUp
+ commentThumbs.ModifiedOn = time.Now().Unix()
+ } else {
+ commentThumbs = &dbr.TweetCommentThumbs{
+ UserID: userId,
+ TweetID: tweetId,
+ CommentID: commentId,
+ ReplyID: replyId,
+ IsThumbsUp: types.Yes,
+ IsThumbsDown: types.No,
+ CommentType: 1,
+ Model: &dbr.Model{
+ CreatedOn: time.Now().Unix(),
+ },
+ }
+ thumbsUpCount, thumbsDownCount = 1, 0
+ }
+ // 更新thumbs状态
+ if err = s.db.Save(commentThumbs).Error; err != nil {
+ return err
+ }
+ // 更新thumbsUpCount
+ if err = s.updateCommentThumbsUpCount(&dbr.CommentReply{}, replyId, thumbsUpCount, thumbsDownCount); err != nil {
+ return err
+ }
+ db.Commit()
+ return nil
+}
+
+func (s *commentManageSrv) ThumbsDownReply(userId int64, tweetId, commentId, replyId int64) error {
+ db := s.db.Begin()
+ defer db.Rollback()
+
+ var (
+ thumbsUpCount int32 = 0
+ thumbsDownCount int32 = 0
+ )
+ commentThumbs := &dbr.TweetCommentThumbs{}
+ // 检查thumbs状态
+ err := s.db.Where("user_id=? AND tweet_id=? AND comment_id=? AND reply_id=? AND comment_type=1", userId, tweetId, commentId, replyId).Take(commentThumbs).Error
+ if err == nil {
+ switch {
+ case commentThumbs.IsThumbsDown == types.Yes:
+ thumbsUpCount, thumbsDownCount = 0, -1
+ case commentThumbs.IsThumbsUp == types.No && commentThumbs.IsThumbsDown == types.No:
+ thumbsUpCount, thumbsDownCount = 0, 1
+ default:
+ thumbsUpCount, thumbsDownCount = -1, 1
+ commentThumbs.IsThumbsUp = types.No
+ }
+ commentThumbs.IsThumbsDown = 1 - commentThumbs.IsThumbsDown
+ commentThumbs.ModifiedOn = time.Now().Unix()
+ } else {
+ commentThumbs = &dbr.TweetCommentThumbs{
+ UserID: userId,
+ TweetID: tweetId,
+ CommentID: commentId,
+ ReplyID: replyId,
+ IsThumbsUp: types.No,
+ IsThumbsDown: types.Yes,
+ CommentType: 1,
+ Model: &dbr.Model{
+ CreatedOn: time.Now().Unix(),
+ },
+ }
+ thumbsUpCount, thumbsDownCount = 0, 1
+ }
+ // 更新thumbs状态
+ if err = s.db.Save(commentThumbs).Error; err != nil {
+ return err
+ }
+ // 更新thumbsUpCount
+ if err = s.updateCommentThumbsUpCount(&dbr.CommentReply{}, replyId, thumbsUpCount, thumbsDownCount); err != nil {
+ return err
+ }
+ db.Commit()
+ return nil
+}
+
+func (s *commentManageSrv) updateCommentThumbsUpCount(obj any, id int64, thumbsUpCount, thumbsDownCount int32) error {
+ updateColumns := make(map[string]any, 2)
+ if thumbsUpCount == 1 {
+ updateColumns["thumbs_up_count"] = gorm.Expr("thumbs_up_count + 1")
+ } else if thumbsUpCount == -1 {
+ updateColumns["thumbs_up_count"] = gorm.Expr("thumbs_up_count - 1")
+ }
+ if thumbsDownCount == 1 {
+ updateColumns["thumbs_down_count"] = gorm.Expr("thumbs_down_count + 1")
+ } else if thumbsDownCount == -1 {
+ updateColumns["thumbs_down_count"] = gorm.Expr("thumbs_down_count - 1")
+ }
+ if len(updateColumns) > 0 {
+ updateColumns["modified_on"] = time.Now().Unix()
+ return s.db.Model(obj).Where("id=?", id).UpdateColumns(updateColumns).Error
+ }
+ return nil
+}
diff --git a/internal/dao/jinzhu/contacts.go b/internal/dao/jinzhu/contacts.go
index c26ae4de..b44307fe 100644
--- a/internal/dao/jinzhu/contacts.go
+++ b/internal/dao/jinzhu/contacts.go
@@ -8,26 +8,27 @@ import (
"time"
"github.com/rocboss/paopao-ce/internal/core"
+ "github.com/rocboss/paopao-ce/internal/core/ms"
"github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr"
"github.com/sirupsen/logrus"
"gorm.io/gorm"
)
var (
- _ core.ContactManageService = (*contactManageServant)(nil)
+ _ core.ContactManageService = (*contactManageSrv)(nil)
)
-type contactManageServant struct {
+type contactManageSrv struct {
db *gorm.DB
}
func newContactManageService(db *gorm.DB) core.ContactManageService {
- return &contactManageServant{
+ return &contactManageSrv{
db: db,
}
}
-func (s *contactManageServant) fetchOrNewContact(db *gorm.DB, userId int64, friendId int64, status int8) (*dbr.Contact, error) {
+func (s *contactManageSrv) fetchOrNewContact(db *gorm.DB, userId int64, friendId int64, status int8) (*dbr.Contact, error) {
contact := &dbr.Contact{
UserId: userId,
FriendId: friendId,
@@ -40,14 +41,14 @@ func (s *contactManageServant) fetchOrNewContact(db *gorm.DB, userId int64, frie
Status: status,
}
if contact, err = contact.Create(db); err != nil {
- logrus.Errorf("contactManageServant.fetchOrNewContact create new contact err:%s", err)
+ logrus.Errorf("contactManageSrv.fetchOrNewContact create new contact err:%s", err)
return nil, err
}
}
return contact, nil
}
-func (s *contactManageServant) RequestingFriend(userId int64, friendId int64, greetings string) (err error) {
+func (s *contactManageSrv) RequestingFriend(userId int64, friendId int64, greetings string) (err error) {
db := s.db.Begin()
defer func() {
if err == nil {
@@ -70,7 +71,7 @@ func (s *contactManageServant) RequestingFriend(userId int64, friendId int64, gr
contact.Status = dbr.ContactStatusRequesting
contact.IsDel = 0 // remove deleted flag if needed
if err = contact.UpdateInUnscoped(db); err != nil {
- logrus.Errorf("contactManageServant.RequestingFriend update exsit contact err:%s", err)
+ logrus.Errorf("contactManageSrv.RequestingFriend update exsit contact err:%s", err)
return
}
}
@@ -84,13 +85,13 @@ func (s *contactManageServant) RequestingFriend(userId int64, friendId int64, gr
ReplyID: int64(dbr.ContactStatusRequesting),
}
if _, err = msg.Create(db); err != nil {
- logrus.Errorf("contactManageServant.RequestingFriend create message err:%s", err)
+ logrus.Errorf("contactManageSrv.RequestingFriend create message err:%s", err)
return
}
return nil
}
-func (s *contactManageServant) AddFriend(userId int64, friendId int64) (err error) {
+func (s *contactManageSrv) AddFriend(userId int64, friendId int64) (err error) {
db := s.db.Begin()
defer func() {
if err == nil {
@@ -109,7 +110,7 @@ func (s *contactManageServant) AddFriend(userId int64, friendId int64) (err erro
}
// 如果还不是请求好友,啥也不干
if contact.Status != dbr.ContactStatusRequesting {
- logrus.Debugf("contactManageServant.AddFriend not reuesting status now so skip")
+ logrus.Debugf("contactManageSrv.AddFriend not reuesting status now so skip")
return nil
}
contact.Status = dbr.ContactStatusAgree
@@ -127,7 +128,7 @@ func (s *contactManageServant) AddFriend(userId int64, friendId int64) (err erro
contact.Status = dbr.ContactStatusAgree
contact.IsDel = 0 // remove deleted flag
if err = contact.UpdateInUnscoped(db); err != nil {
- logrus.Errorf("contactManageServant.AddFriend update contact err:%s", err)
+ logrus.Errorf("contactManageSrv.AddFriend update contact err:%s", err)
return
}
}
@@ -149,7 +150,7 @@ func (s *contactManageServant) AddFriend(userId int64, friendId int64) (err erro
return nil
}
-func (s *contactManageServant) RejectFriend(userId int64, friendId int64) (err error) {
+func (s *contactManageSrv) RejectFriend(userId int64, friendId int64) (err error) {
db := s.db.Begin()
defer func() {
if err == nil {
@@ -192,7 +193,7 @@ func (s *contactManageServant) RejectFriend(userId int64, friendId int64) (err e
return nil
}
-func (s *contactManageServant) DeleteFriend(userId int64, friendId int64) (err error) {
+func (s *contactManageSrv) DeleteFriend(userId int64, friendId int64) (err error) {
db := s.db.Begin()
defer func() {
if err == nil {
@@ -226,7 +227,7 @@ func (s *contactManageServant) DeleteFriend(userId int64, friendId int64) (err e
return nil
}
-func (s *contactManageServant) GetContacts(userId int64, offset int, limit int) (*core.ContactList, error) {
+func (s *contactManageSrv) GetContacts(userId int64, offset int, limit int) (*ms.ContactList, error) {
contact := &dbr.Contact{}
condition := dbr.ConditionsT{
"user_id": userId,
@@ -240,13 +241,13 @@ func (s *contactManageServant) GetContacts(userId int64, offset int, limit int)
if err != nil {
return nil, err
}
- resp := &core.ContactList{
- Contacts: make([]core.ContactItem, 0, len(contacts)),
+ resp := &ms.ContactList{
+ Contacts: make([]ms.ContactItem, 0, len(contacts)),
Total: total,
}
for _, c := range contacts {
if c.User != nil {
- resp.Contacts = append(resp.Contacts, core.ContactItem{
+ resp.Contacts = append(resp.Contacts, ms.ContactItem{
UserId: c.FriendId,
UserName: c.User.Username,
Nickname: c.User.Nickname,
@@ -258,7 +259,7 @@ func (s *contactManageServant) GetContacts(userId int64, offset int, limit int)
return resp, nil
}
-func (s *contactManageServant) IsFriend(userId int64, friendId int64) bool {
+func (s *contactManageSrv) IsFriend(userId int64, friendId int64) bool {
contact := &dbr.Contact{
UserId: friendId,
FriendId: userId,
diff --git a/internal/dao/jinzhu/dbr/comment.go b/internal/dao/jinzhu/dbr/comment.go
index 80192df7..4f673336 100644
--- a/internal/dao/jinzhu/dbr/comment.go
+++ b/internal/dao/jinzhu/dbr/comment.go
@@ -7,27 +7,33 @@ package dbr
import (
"time"
+ "github.com/rocboss/paopao-ce/pkg/types"
"gorm.io/gorm"
)
type Comment struct {
*Model
- PostID int64 `json:"post_id"`
- UserID int64 `json:"user_id"`
- IP string `json:"ip"`
- IPLoc string `json:"ip_loc"`
+ PostID int64 `json:"post_id"`
+ UserID int64 `json:"user_id"`
+ IP string `json:"ip"`
+ IPLoc string `json:"ip_loc"`
+ ThumbsUpCount int32 `json:"thumbs_up_count"`
+ ThumbsDownCount int32 `json:"-"`
}
type CommentFormated struct {
- ID int64 `json:"id"`
- PostID int64 `json:"post_id"`
- UserID int64 `json:"user_id"`
- User *UserFormated `json:"user"`
- Contents []*CommentContent `json:"contents"`
- Replies []*CommentReplyFormated `json:"replies"`
- IPLoc string `json:"ip_loc"`
- CreatedOn int64 `json:"created_on"`
- ModifiedOn int64 `json:"modified_on"`
+ ID int64 `json:"id"`
+ PostID int64 `json:"post_id"`
+ UserID int64 `json:"user_id"`
+ User *UserFormated `json:"user"`
+ Contents []*CommentContent `json:"contents"`
+ Replies []*CommentReplyFormated `json:"replies"`
+ IPLoc string `json:"ip_loc"`
+ ThumbsUpCount int32 `json:"thumbs_up_count"`
+ IsThumbsUp int8 `json:"is_thumbs_up"`
+ IsThumbsDown int8 `json:"is_thumbs_down"`
+ CreatedOn int64 `json:"created_on"`
+ ModifiedOn int64 `json:"modified_on"`
}
func (c *Comment) Format() *CommentFormated {
@@ -35,15 +41,18 @@ func (c *Comment) Format() *CommentFormated {
return &CommentFormated{}
}
return &CommentFormated{
- ID: c.Model.ID,
- PostID: c.PostID,
- UserID: c.UserID,
- User: &UserFormated{},
- Contents: []*CommentContent{},
- Replies: []*CommentReplyFormated{},
- IPLoc: c.IPLoc,
- CreatedOn: c.CreatedOn,
- ModifiedOn: c.ModifiedOn,
+ ID: c.Model.ID,
+ PostID: c.PostID,
+ UserID: c.UserID,
+ User: &UserFormated{},
+ Contents: []*CommentContent{},
+ Replies: []*CommentReplyFormated{},
+ IPLoc: c.IPLoc,
+ ThumbsUpCount: c.ThumbsUpCount,
+ IsThumbsUp: types.No,
+ IsThumbsDown: types.No,
+ CreatedOn: c.CreatedOn,
+ ModifiedOn: c.ModifiedOn,
}
}
@@ -70,7 +79,7 @@ func (c *Comment) List(db *gorm.DB, conditions *ConditionsT, offset, limit int)
db = db.Offset(offset).Limit(limit)
}
if c.PostID > 0 {
- db = db.Where("id = ?", c.PostID)
+ db = db.Where("post_id = ?", c.PostID)
}
for k, v := range *conditions {
diff --git a/internal/dao/jinzhu/dbr/comment_reply.go b/internal/dao/jinzhu/dbr/comment_reply.go
index fe527be5..dcdfde21 100644
--- a/internal/dao/jinzhu/dbr/comment_reply.go
+++ b/internal/dao/jinzhu/dbr/comment_reply.go
@@ -7,30 +7,36 @@ package dbr
import (
"time"
+ "github.com/rocboss/paopao-ce/pkg/types"
"gorm.io/gorm"
)
type CommentReply struct {
*Model
- CommentID int64 `json:"comment_id"`
- UserID int64 `json:"user_id"`
- AtUserID int64 `json:"at_user_id"`
- Content string `json:"content"`
- IP string `json:"ip"`
- IPLoc string `json:"ip_loc"`
+ CommentID int64 `db:"comment_id" json:"comment_id"`
+ UserID int64 `db:"user_id" json:"user_id"`
+ AtUserID int64 `db:"at_user_id" json:"at_user_id"`
+ Content string `json:"content"`
+ IP string `json:"ip"`
+ IPLoc string `json:"ip_loc"`
+ ThumbsUpCount int32 `json:"thumbs_up_count"`
+ ThumbsDownCount int32 `json:"-"`
}
type CommentReplyFormated struct {
- ID int64 `json:"id"`
- CommentID int64 `json:"comment_id"`
- UserID int64 `json:"user_id"`
- User *UserFormated `json:"user"`
- AtUserID int64 `json:"at_user_id"`
- AtUser *UserFormated `json:"at_user"`
- Content string `json:"content"`
- IPLoc string `json:"ip_loc"`
- CreatedOn int64 `json:"created_on"`
- ModifiedOn int64 `json:"modified_on"`
+ ID int64 `json:"id"`
+ CommentID int64 `db:"comment_id" json:"comment_id"`
+ UserID int64 `db:"user_id" json:"user_id"`
+ User *UserFormated `json:"user"`
+ AtUserID int64 `db:"at_user_id" json:"at_user_id"`
+ AtUser *UserFormated `json:"at_user"`
+ Content string `json:"content"`
+ IPLoc string `json:"ip_loc"`
+ ThumbsUpCount int32 `json:"thumbs_up_count"`
+ IsThumbsUp int8 `json:"is_thumbs_up"`
+ IsThumbsDown int8 `json:"is_thumbs_down"`
+ CreatedOn int64 `json:"created_on"`
+ ModifiedOn int64 `json:"modified_on"`
}
func (c *CommentReply) Format() *CommentReplyFormated {
@@ -39,16 +45,19 @@ func (c *CommentReply) Format() *CommentReplyFormated {
}
return &CommentReplyFormated{
- ID: c.ID,
- CommentID: c.CommentID,
- UserID: c.UserID,
- User: &UserFormated{},
- AtUserID: c.AtUserID,
- AtUser: &UserFormated{},
- Content: c.Content,
- IPLoc: c.IPLoc,
- CreatedOn: c.CreatedOn,
- ModifiedOn: c.ModifiedOn,
+ ID: c.ID,
+ CommentID: c.CommentID,
+ UserID: c.UserID,
+ User: &UserFormated{},
+ AtUserID: c.AtUserID,
+ AtUser: &UserFormated{},
+ Content: c.Content,
+ IPLoc: c.IPLoc,
+ ThumbsUpCount: c.ThumbsUpCount,
+ IsThumbsUp: types.No,
+ IsThumbsDown: types.No,
+ CreatedOn: c.CreatedOn,
+ ModifiedOn: c.ModifiedOn,
}
}
diff --git a/internal/dao/jinzhu/dbr/comment_thumbs.go b/internal/dao/jinzhu/dbr/comment_thumbs.go
new file mode 100644
index 00000000..7d66ca46
--- /dev/null
+++ b/internal/dao/jinzhu/dbr/comment_thumbs.go
@@ -0,0 +1,16 @@
+// Copyright 2023 ROC. All rights reserved.
+// Use of this source code is governed by a MIT style
+// license that can be found in the LICENSE file.
+
+package dbr
+
+type TweetCommentThumbs struct {
+ *Model
+ UserID int64 `json:"user_id"`
+ TweetID int64 `json:"tweet_id"`
+ CommentID int64 `json:"comment_id"`
+ ReplyID int64 `json:"reply_id"`
+ CommentType int8 `json:"comment_type"`
+ IsThumbsUp int8 `json:"is_thumbs_up"`
+ IsThumbsDown int8 `json:"is_thumbs_down"`
+}
diff --git a/internal/dao/jinzhu/dbr/contact.go b/internal/dao/jinzhu/dbr/contact.go
index e8c12bd0..a1777e28 100644
--- a/internal/dao/jinzhu/dbr/contact.go
+++ b/internal/dao/jinzhu/dbr/contact.go
@@ -7,6 +7,7 @@ package dbr
import (
"github.com/sirupsen/logrus"
"gorm.io/gorm"
+ "gorm.io/gorm/clause"
)
const (
@@ -73,7 +74,7 @@ func (c *Contact) List(db *gorm.DB, conditions ConditionsT, offset, limit int) (
}
}
- db.Joins("User").Order("`User`.`nickname` ASC")
+ db.Joins("User").Order(clause.OrderByColumn{Column: clause.Column{Name: "nickname"}, Desc: false})
if err = db.Find(&contacts).Error; err != nil {
return nil, err
}
diff --git a/internal/dao/jinzhu/dbr/post.go b/internal/dao/jinzhu/dbr/post.go
index a47dedfc..be4582c6 100644
--- a/internal/dao/jinzhu/dbr/post.go
+++ b/internal/dao/jinzhu/dbr/post.go
@@ -26,6 +26,7 @@ type Post struct {
UserID int64 `json:"user_id"`
CommentCount int64 `json:"comment_count"`
CollectionCount int64 `json:"collection_count"`
+ ShareCount int64 `json:"share_count"`
UpvoteCount int64 `json:"upvote_count"`
Visibility PostVisibleT `json:"visibility"`
IsTop int `json:"is_top"`
@@ -45,6 +46,7 @@ type PostFormated struct {
Contents []*PostContentFormated `json:"contents"`
CommentCount int64 `json:"comment_count"`
CollectionCount int64 `json:"collection_count"`
+ ShareCount int64 `json:"share_count"`
UpvoteCount int64 `json:"upvote_count"`
Visibility PostVisibleT `json:"visibility"`
IsTop int `json:"is_top"`
@@ -71,6 +73,7 @@ func (p *Post) Format() *PostFormated {
Contents: []*PostContentFormated{},
CommentCount: p.CommentCount,
CollectionCount: p.CollectionCount,
+ ShareCount: p.ShareCount,
UpvoteCount: p.UpvoteCount,
Visibility: p.Visibility,
IsTop: p.IsTop,
@@ -117,7 +120,7 @@ func (p *Post) Get(db *gorm.DB) (*Post, error) {
return &post, nil
}
-func (p *Post) List(db *gorm.DB, conditions *ConditionsT, offset, limit int) ([]*Post, error) {
+func (p *Post) List(db *gorm.DB, conditions ConditionsT, offset, limit int) ([]*Post, error) {
var posts []*Post
var err error
if offset >= 0 && limit > 0 {
@@ -126,7 +129,7 @@ func (p *Post) List(db *gorm.DB, conditions *ConditionsT, offset, limit int) ([]
if p.UserID > 0 {
db = db.Where("user_id = ?", p.UserID)
}
- for k, v := range *conditions {
+ for k, v := range conditions {
if k == "ORDER" {
db = db.Order(v)
} else {
@@ -175,12 +178,12 @@ func (p *Post) CountBy(db *gorm.DB, predicates Predicates) (count int64, err err
return
}
-func (p *Post) Count(db *gorm.DB, conditions *ConditionsT) (int64, error) {
+func (p *Post) Count(db *gorm.DB, conditions ConditionsT) (int64, error) {
var count int64
if p.UserID > 0 {
db = db.Where("user_id = ?", p.UserID)
}
- for k, v := range *conditions {
+ for k, v := range conditions {
if k != "ORDER" {
db = db.Where(k, v)
}
diff --git a/internal/dao/jinzhu/dbr/post_collection.go b/internal/dao/jinzhu/dbr/post_collection.go
index 04ca2647..23604ff1 100644
--- a/internal/dao/jinzhu/dbr/post_collection.go
+++ b/internal/dao/jinzhu/dbr/post_collection.go
@@ -8,13 +8,14 @@ import (
"time"
"gorm.io/gorm"
+ "gorm.io/gorm/clause"
)
type PostCollection struct {
*Model
Post *Post `json:"-"`
- PostID int64 `json:"post_id"`
- UserID int64 `json:"user_id"`
+ PostID int64 `db:"post_id" json:"post_id"`
+ UserID int64 `db:"user_id" json:"user_id"`
}
func (p *PostCollection) Get(db *gorm.DB) (*PostCollection, error) {
@@ -31,7 +32,7 @@ func (p *PostCollection) Get(db *gorm.DB) (*PostCollection, error) {
db = db.Where(tn+"user_id = ?", p.UserID)
}
- db = db.Joins("Post").Where("Post.visibility <> ?", PostVisitPrivate).Order("Post.id DESC")
+ db = db.Joins("Post").Where("visibility <> ? OR (visibility = ? AND ? = ?)", PostVisitPrivate, PostVisitPrivate, clause.Column{Table: "Post", Name: "user_id"}, p.UserID).Order(clause.OrderByColumn{Column: clause.Column{Table: "Post", Name: "id"}, Desc: true})
err := db.First(&star).Error
if err != nil {
return &star, err
@@ -73,7 +74,7 @@ func (p *PostCollection) List(db *gorm.DB, conditions *ConditionsT, offset, limi
}
}
- db = db.Joins("Post").Where("Post.visibility <> ?", PostVisitPrivate).Order("Post.id DESC")
+ db = db.Joins("Post").Where(`visibility <> ? OR (visibility = ? AND ? = ?)`, PostVisitPrivate, PostVisitPrivate, clause.Column{Table: "Post", Name: "user_id"}, p.UserID).Order(clause.OrderByColumn{Column: clause.Column{Table: "Post", Name: "id"}, Desc: true})
if err = db.Where(tn+"is_del = ?", 0).Find(&collections).Error; err != nil {
return nil, err
}
@@ -97,7 +98,7 @@ func (p *PostCollection) Count(db *gorm.DB, conditions *ConditionsT) (int64, err
}
}
- db = db.Joins("Post").Where("Post.visibility <> ?", PostVisitPrivate)
+ db = db.Joins("Post").Where(`visibility <> ? OR (visibility = ? AND ? = ?)`, PostVisitPrivate, PostVisitPrivate, clause.Column{Table: "Post", Name: "user_id"}, p.UserID)
if err := db.Model(p).Count(&count).Error; err != nil {
return 0, err
}
diff --git a/internal/dao/jinzhu/dbr/post_content.go b/internal/dao/jinzhu/dbr/post_content.go
index 672cc57e..5f257630 100644
--- a/internal/dao/jinzhu/dbr/post_content.go
+++ b/internal/dao/jinzhu/dbr/post_content.go
@@ -44,7 +44,7 @@ type PostContent struct {
}
type PostContentFormated struct {
- ID int64 `json:"id"`
+ ID int64 `db:"id" json:"id"`
PostID int64 `json:"post_id"`
Content string `json:"content"`
Type PostContentT `json:"type"`
diff --git a/internal/dao/jinzhu/dbr/post_star.go b/internal/dao/jinzhu/dbr/post_star.go
index 45c48f45..33173e4b 100644
--- a/internal/dao/jinzhu/dbr/post_star.go
+++ b/internal/dao/jinzhu/dbr/post_star.go
@@ -7,7 +7,9 @@ package dbr
import (
"time"
+ "github.com/rocboss/paopao-ce/internal/core/cs"
"gorm.io/gorm"
+ "gorm.io/gorm/clause"
)
type PostStar struct {
@@ -31,7 +33,7 @@ func (p *PostStar) Get(db *gorm.DB) (*PostStar, error) {
db = db.Where(tn+"user_id = ?", p.UserID)
}
- db = db.Joins("Post").Where("Post.visibility <> ?", PostVisitPrivate).Order("Post.id DESC")
+ db = db.Joins("Post").Where("visibility <> ? OR (visibility = ? AND ? = ?)", PostVisitPrivate, PostVisitPrivate, clause.Column{Table: "Post", Name: "user_id"}, p.UserID).Order(clause.OrderByColumn{Column: clause.Column{Table: "Post", Name: "id"}, Desc: true})
if err := db.First(&star).Error; err != nil {
return nil, err
}
@@ -51,18 +53,14 @@ func (p *PostStar) Delete(db *gorm.DB) error {
}).Error
}
-func (p *PostStar) List(db *gorm.DB, conditions *ConditionsT, offset, limit int) ([]*PostStar, error) {
- var stars []*PostStar
- var err error
+func (p *PostStar) List(db *gorm.DB, conditions *ConditionsT, typ cs.RelationTyp, limit int, offset int) (res []*PostStar, err error) {
tn := db.NamingStrategy.TableName("PostStar") + "."
-
if offset >= 0 && limit > 0 {
db = db.Offset(offset).Limit(limit)
}
if p.UserID > 0 {
db = db.Where(tn+"user_id = ?", p.UserID)
}
-
for k, v := range *conditions {
if k == "ORDER" {
db = db.Order(v)
@@ -70,18 +68,24 @@ func (p *PostStar) List(db *gorm.DB, conditions *ConditionsT, offset, limit int)
db = db.Where(tn+k, v)
}
}
-
- db = db.Joins("Post").Where("Post.visibility <> ?", PostVisitPrivate).Order("Post.id DESC")
- if err = db.Find(&stars).Error; err != nil {
- return nil, err
+ db = db.Joins("Post")
+ switch typ {
+ case cs.RelationAdmin:
+ // admin have all permition to visit all type tweets
+ case cs.RelationFriend:
+ db = db.Where("visibility = ? OR visibility = ?", PostVisitPublic, PostVisitFriend)
+ case cs.RelationSelf:
+ db = db.Where("visibility <> ? OR (visibility = ? AND ? = ?)", PostVisitPrivate, PostVisitPrivate, clause.Column{Table: "Post", Name: "user_id"}, p.UserID)
+ default:
+ db = db.Where("visibility=?", PostVisitPublic)
}
- return stars, nil
+ db = db.Order(clause.OrderByColumn{Column: clause.Column{Table: "Post", Name: "id"}, Desc: true})
+ err = db.Find(&res).Error
+ return
}
-func (p *PostStar) Count(db *gorm.DB, conditions *ConditionsT) (int64, error) {
- var count int64
+func (p *PostStar) Count(db *gorm.DB, typ cs.RelationTyp, conditions *ConditionsT) (res int64, err error) {
tn := db.NamingStrategy.TableName("PostStar") + "."
-
if p.PostID > 0 {
db = db.Where(tn+"post_id = ?", p.PostID)
}
@@ -93,10 +97,17 @@ func (p *PostStar) Count(db *gorm.DB, conditions *ConditionsT) (int64, error) {
db = db.Where(tn+k, v)
}
}
-
- db = db.Joins("Post").Where("Post.visibility <> ?", PostVisitPrivate)
- if err := db.Model(p).Count(&count).Error; err != nil {
- return 0, err
+ db = db.Joins("Post")
+ switch typ {
+ case cs.RelationAdmin:
+ // admin have all permition to visit all type tweets
+ case cs.RelationFriend:
+ db = db.Where("visibility = ? OR visibility = ?", PostVisitPublic, PostVisitFriend)
+ case cs.RelationSelf:
+ db = db.Where("visibility <> ? OR (visibility = ? AND ? = ?)", PostVisitPrivate, PostVisitPrivate, clause.Column{Table: "Post", Name: "user_id"}, p.UserID)
+ default:
+ db = db.Where("visibility=?", PostVisitPublic)
}
- return count, nil
+ err = db.Model(p).Count(&res).Error
+ return
}
diff --git a/internal/dao/jinzhu/dbr/tag.go b/internal/dao/jinzhu/dbr/topic.go
similarity index 65%
rename from internal/dao/jinzhu/dbr/tag.go
rename to internal/dao/jinzhu/dbr/topic.go
index 8570f574..45cabfef 100644
--- a/internal/dao/jinzhu/dbr/tag.go
+++ b/internal/dao/jinzhu/dbr/topic.go
@@ -16,12 +16,27 @@ type Tag struct {
Tag string `json:"tag"`
QuoteNum int64 `json:"quote_num"`
}
+
+type TopicUser struct {
+ *Model
+ UserID int64 `json:"user_id"`
+ TopicID int64 `json:"topic_id"`
+ AliasName string `json:"-"`
+ Remark string `json:"-"`
+ QuoteNum int64 `json:"quote_num"`
+ IsTop int8 `json:"is_top"`
+ ReserveA string `json:"-"`
+ ReserveB string `json:"-"`
+}
+
type TagFormated struct {
- ID int64 `json:"id"`
- UserID int64 `json:"user_id"`
- User *UserFormated `json:"user"`
- Tag string `json:"tag"`
- QuoteNum int64 `json:"quote_num"`
+ ID int64 `json:"id"`
+ UserID int64 `json:"user_id"`
+ User *UserFormated `json:"user"`
+ Tag string `json:"tag"`
+ QuoteNum int64 `json:"quote_num"`
+ IsFollowing int8 `json:"is_following"`
+ IsTop int8 `json:"is_top"`
}
func (t *Tag) Format() *TagFormated {
@@ -30,11 +45,13 @@ func (t *Tag) Format() *TagFormated {
}
return &TagFormated{
- ID: t.ID,
- UserID: t.UserID,
- User: &UserFormated{},
- Tag: t.Tag,
- QuoteNum: t.QuoteNum,
+ ID: t.ID,
+ UserID: t.UserID,
+ User: &UserFormated{},
+ Tag: t.Tag,
+ QuoteNum: t.QuoteNum,
+ IsFollowing: 0,
+ IsTop: 0,
}
}
@@ -71,9 +88,7 @@ func (t *Tag) Delete(db *gorm.DB) error {
}).Error
}
-func (t *Tag) List(db *gorm.DB, conditions *ConditionsT, offset, limit int) ([]*Tag, error) {
- var tags []*Tag
- var err error
+func (t *Tag) List(db *gorm.DB, conditions *ConditionsT, offset, limit int) (tags []*Tag, err error) {
if offset >= 0 && limit > 0 {
db = db.Offset(offset).Limit(limit)
}
@@ -87,12 +102,8 @@ func (t *Tag) List(db *gorm.DB, conditions *ConditionsT, offset, limit int) ([]*
db = db.Where(k, v)
}
}
-
- if err = db.Where("is_del = 0 and quote_num > 0").Find(&tags).Error; err != nil {
- return nil, err
- }
-
- return tags, nil
+ err = db.Where("is_del = 0 and quote_num > 0").Find(&tags).Error
+ return
}
func (t *Tag) TagsFrom(db *gorm.DB, tags []string) (res []*Tag, err error) {
diff --git a/internal/dao/jinzhu/dbr/user.go b/internal/dao/jinzhu/dbr/user.go
index a10d5432..7297e39f 100644
--- a/internal/dao/jinzhu/dbr/user.go
+++ b/internal/dao/jinzhu/dbr/user.go
@@ -4,7 +4,10 @@
package dbr
-import "gorm.io/gorm"
+import (
+ "github.com/rocboss/paopao-ce/internal/core/cs"
+ "gorm.io/gorm"
+)
const (
UserStatusNormal int = iota + 1
@@ -25,7 +28,7 @@ type User struct {
}
type UserFormated struct {
- ID int64 `json:"id"`
+ ID int64 `db:"id" json:"id"`
Nickname string `json:"nickname"`
Username string `json:"username"`
Status int `json:"status"`
@@ -87,6 +90,11 @@ func (u *User) List(db *gorm.DB, conditions *ConditionsT, offset, limit int) ([]
return users, nil
}
+func (u *User) ListUserInfoById(db *gorm.DB, ids []int64) (res cs.UserInfoList, err error) {
+ err = db.Model(u).Where("id IN ?", ids).Find(&res).Error
+ return
+}
+
func (u *User) Create(db *gorm.DB) (*User, error) {
err := db.Create(&u).Error
diff --git a/internal/dao/jinzhu/gorm.go b/internal/dao/jinzhu/gorm.go
new file mode 100644
index 00000000..8cd44639
--- /dev/null
+++ b/internal/dao/jinzhu/gorm.go
@@ -0,0 +1,55 @@
+// Copyright 2023 ROC. All rights reserved.
+// Use of this source code is governed by a MIT style
+// license that can be found in the LICENSE file.
+
+package jinzhu
+
+import (
+ "github.com/rocboss/paopao-ce/internal/conf"
+)
+
+// 数据库表名,统一使用 _