diff --git a/.github/workflows/ci-main.sh b/.github/workflows/ci-main.sh
index 58a9f9adf..f32f34f3a 100644
--- a/.github/workflows/ci-main.sh
+++ b/.github/workflows/ci-main.sh
@@ -7,27 +7,25 @@ for file in `find . -name go.mod`; do
dirpath=$(dirname $file)
echo $dirpath
+ # ignore mssql tests as its docker service failed
+ # TODO remove this ignoring codes after the mssql docker service OK
+ if [ "mssql" = $(basename $dirpath) ]; then
+ continue 1
+ fi
+
if [[ $file =~ "/testdata/" ]]; then
echo "ignore testdata path $file"
continue 1
fi
- # package kuhecm needs golang >= v1.19
+ # package kuhecm was moved to sub ci procedure.
if [ "kubecm" = $(basename $dirpath) ]; then
continue 1
- if ! go version|grep -qE "go1.[2-9][0-9]"; then
- echo "ignore kubecm as go version: $(go version)"
- continue 1
- fi
fi
# package consul needs golang >= v1.19
if [ "consul" = $(basename $dirpath) ]; then
continue 1
- if ! go version|grep -qE "go1.[2-9][0-9]"; then
- echo "ignore consul as go version: $(go version)"
- continue 1
- fi
fi
# package etcd needs golang >= v1.19
diff --git a/.github/workflows/ci-main.yml b/.github/workflows/ci-main.yml
index 7d8b8f3aa..2f4b98bf6 100644
--- a/.github/workflows/ci-main.yml
+++ b/.github/workflows/ci-main.yml
@@ -32,7 +32,7 @@ env:
jobs:
code-test:
- runs-on: ubuntu-latest
+ runs-on: ubuntu-20.04
# Service containers to run with `code-test`
services:
@@ -58,6 +58,11 @@ jobs:
- 6379:6379
# MySQL backend server.
+ # docker run -d --name mysql \
+ # -p 3306:3306 \
+ # -e MYSQL_DATABASE=test \
+ # -e MYSQL_ROOT_PASSWORD=12345678 \
+ # loads/mysql:5.7
mysql:
image: loads/mysql:5.7
env:
@@ -185,7 +190,7 @@ jobs:
strategy:
matrix:
- go-version: [ "1.21", "1.22" ]
+ go-version: ["1.22", "1.23" ]
goarch: ["386", "amd64" ]
steps:
@@ -215,7 +220,19 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- cache-dependency-path: '**/go.sum'
+ cache-dependency-path: '**/go.sum'
+
+ - name: Install Protoc
+ uses: arduino/setup-protoc@v3
+ with:
+ version: "29.x"
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Install the protocol compiler plugins for Go
+ run: |
+ go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
+ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
+ export PATH="$PATH:$(go env GOPATH)/bin"
- name: Before Script
run: bash .github/workflows/before_script.sh
diff --git a/.github/workflows/ci-sub.yml b/.github/workflows/ci-sub.yml
index 096fbf7d4..977516b21 100644
--- a/.github/workflows/ci-sub.yml
+++ b/.github/workflows/ci-sub.yml
@@ -37,7 +37,7 @@ jobs:
strategy:
matrix:
- go-version: [ "1.21", "1.22" ]
+ go-version: [ "1.22", "1.23" ]
goarch: [ "386","amd64" ]
steps:
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
new file mode 100644
index 000000000..b0c313801
--- /dev/null
+++ b/.github/workflows/codeql.yml
@@ -0,0 +1,92 @@
+# For most projects, this workflow file will not need changing; you simply need
+# to commit it to your repository.
+#
+# You may wish to alter this file to override the set of languages analyzed,
+# or to provide custom queries or build logic.
+#
+# ******** NOTE ********
+# We have attempted to detect the languages in your repository. Please check
+# the `language` matrix defined below to confirm you have the correct set of
+# supported CodeQL languages.
+#
+name: "CodeQL Advanced"
+
+on:
+ push:
+ branches: [ "master", "develop" ]
+ pull_request:
+ branches: [ "master", "develop" ]
+ schedule:
+ - cron: '43 20 * * 0'
+
+jobs:
+ analyze:
+ name: Analyze (${{ matrix.language }})
+ # Runner size impacts CodeQL analysis time. To learn more, please see:
+ # - https://gh.io/recommended-hardware-resources-for-running-codeql
+ # - https://gh.io/supported-runners-and-hardware-resources
+ # - https://gh.io/using-larger-runners (GitHub.com only)
+ # Consider using larger runners or machines with greater resources for possible analysis time improvements.
+ runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
+ permissions:
+ # required for all workflows
+ security-events: write
+
+ # required to fetch internal or private CodeQL packs
+ packages: read
+
+ # only required for workflows in private repositories
+ actions: read
+ contents: read
+
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - language: go
+ build-mode: autobuild
+ # CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
+ # Use `c-cpp` to analyze code written in C, C++ or both
+ # Use 'java-kotlin' to analyze code written in Java, Kotlin or both
+ # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
+ # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
+ # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
+ # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
+ # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+
+ # Initializes the CodeQL tools for scanning.
+ - name: Initialize CodeQL
+ uses: github/codeql-action/init@v3
+ with:
+ languages: ${{ matrix.language }}
+ build-mode: ${{ matrix.build-mode }}
+ # If you wish to specify custom queries, you can do so here or in a config file.
+ # By default, queries listed here will override any specified in a config file.
+ # Prefix the list here with "+" to use these queries and those in the config file.
+
+ # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
+ # queries: security-extended,security-and-quality
+
+ # If the analyze step fails for one of the languages you are analyzing with
+ # "We were unable to automatically build your code", modify the matrix above
+ # to set the build mode to "manual" for that language. Then modify this step
+ # to build your code.
+ # ℹ️ Command-line programs to run using the OS shell.
+ # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
+ - if: matrix.build-mode == 'manual'
+ shell: bash
+ run: |
+ echo 'If you are using a "manual" build mode for one or more of the' \
+ 'languages you are analyzing, replace this with the commands to build' \
+ 'your code, for example:'
+ echo ' make bootstrap'
+ echo ' make release'
+ exit 1
+
+ - name: Perform CodeQL Analysis
+ uses: github/codeql-action/analyze@v3
+ with:
+ category: "/language:${{matrix.language}}"
diff --git a/.github/workflows/doc-build.yml b/.github/workflows/doc-build.yml
index d0bf402e1..9ab2d274f 100644
--- a/.github/workflows/doc-build.yml
+++ b/.github/workflows/doc-build.yml
@@ -12,15 +12,15 @@ jobs:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
with:
ref: doc-build
- - uses: actions/setup-node@v3
+ - uses: actions/setup-node@v4
with:
node-version: 18
cache: npm
- name: Set Up Golang Environment
- uses: actions/setup-go@v4
+ uses: actions/setup-go@v5
with:
go-version: 1.22.5
cache: false
@@ -31,7 +31,7 @@ jobs:
- name: Build website
run: npm run build
- name: Deploy to GitHub Pages
- uses: peaceiris/actions-gh-pages@v3
+ uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml
index 3e2892b1b..456fd7d6d 100644
--- a/.github/workflows/golangci-lint.yml
+++ b/.github/workflows/golangci-lint.yml
@@ -1,17 +1,8 @@
-# Tencent is pleased to support the open source community by making Polaris available.
+# Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
#
-# Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
-#
-# Licensed under the BSD 3-Clause License (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# https://opensource.org/licenses/BSD-3-Clause
-#
-# Unless required by applicable law or agreed to in writing, software distributed
-# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-# CONDITIONS OF ANY KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations under the License.
+# This Source Code Form is subject to the terms of the MIT License.
+# If a copy of the MIT was not distributed with this file,
+# You can obtain one at https://github.com/gogf/gf.
name: GolangCI-Lint
on:
@@ -36,7 +27,7 @@ jobs:
golangci:
strategy:
matrix:
- go-version: [ '1.21.4','1.22' ]
+ go-version: [ '1.22', '1.23' ]
name: golangci-lint
runs-on: ubuntu-latest
steps:
@@ -50,5 +41,5 @@ jobs:
uses: golangci/golangci-lint-action@v6
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
- version: v1.58.2
+ version: v1.62.2
args: --timeout 3m0s
diff --git a/.github/workflows/sonarcloud.yaml b/.github/workflows/sonarcloud.yaml
new file mode 100644
index 000000000..d24d89cd5
--- /dev/null
+++ b/.github/workflows/sonarcloud.yaml
@@ -0,0 +1,53 @@
+name: Sonarcloud Scan
+
+on:
+ schedule:
+ # Weekly on Saturdays.
+ - cron: '30 1 * * 6'
+ push:
+ branches: [ master ]
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+# Declare default permissions as read only.
+permissions: read
+
+jobs:
+ analysis:
+ name: Scorecards analysis
+ runs-on: ubuntu-22.04
+ permissions:
+ # Needed to upload the results to code-scanning dashboard.
+ security-events: write
+ # Used to receive a badge. (Upcoming feature)
+ id-token: write
+ # Needs for private repositories.
+ contents: read
+ actions: read
+
+ steps:
+ - name: "Checkout code"
+ uses: actions/checkout@v4
+ with:
+ persist-credentials: false
+
+ - name: "Run analysis"
+ uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
+ with:
+ results_file: results.sarif
+ results_format: sarif
+ publish_results: true
+
+ - name: "Upload artifact"
+ uses: actions/upload-artifact@v4
+ with:
+ name: SARIF file
+ path: results.sarif
+ retention-days: 5
+
+ - name: "Upload to code-scanning"
+ uses: github/codeql-action/upload-sarif@3ebbd71c74ef574dbc558c82f70e52732c8b44fe # v2.2.1
+ with:
+ sarif_file: results.sarif
diff --git a/.gitignore b/.gitignore
index 1c8cc1fb0..b5318f47e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,6 +14,7 @@ bin/
cmd/gf/main
cmd/gf/gf
temp/
+example/log
go.work
go.work.sum
!cmd/gf/go.work
diff --git a/.golangci.yml b/.golangci.yml
index 11c072949..35b2998c8 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -125,7 +125,7 @@ linters-settings:
# Checks the number of lines in a function.
# If lower than 0, disable the check.
# Default: 60
- lines: 330
+ lines: 340
# Checks the number of statements in a function.
# If lower than 0, disable the check.
# Default: 40
@@ -180,6 +180,9 @@ linters-settings:
# https://golangci-lint.run/usage/linters/#govet
govet:
+ # Report about shadowed variables.
+ # Default: false
+ # check-shadowing: true
# Settings per analyzer.
settings:
# Analyzer name, run `go tool vet help` to see all analyzers.
diff --git a/README.MD b/README.MD
index 8dfa539e4..47d93bce5 100644
--- a/README.MD
+++ b/README.MD
@@ -1,7 +1,7 @@
-# GoFrame
+
-

+

[](https://pkg.go.dev/github.com/gogf/gf/v2)
[](https://github.com/gogf/gf/actions/workflows/ci-main.yml)
@@ -20,86 +20,26 @@
-`GoFrame` is a modular, powerful, high-performance and enterprise-class application development framework of Golang.
+A powerful framework for faster, easier, and more efficient project development.
-# Features
-
-- modular, loosely coupled design
-- rich components, out-of-the-box
-- automatic codes generating for efficiency
-- simple and easy to use, detailed documentation
-- interface designed components, with high scalability
-- fully supported tracing and error stack feature
-- specially developed and powerful ORM component
-- robust engineering design specifications
-- convenient development CLI tool provide
-- OpenTelemetry observability features support
-- OpenAPIV3 documentation generating, automatically
-- much, much more...ready to explore?
-
-# Installation
-
-Enter your repo. directory and execute following command:
-
-## primary module
-
-```bash
-go get -u -v github.com/gogf/gf/v2
-```
-
-## cli tool
-
-```bash
-go install github.com/gogf/gf/cmd/gf/v2@latest
-```
-
-# Limitation
-
-```
-golang version >= 1.21
-```
# Documentation
-- Chinese Official Site(中文官网): [https://goframe.org](https://goframe.org/display/gf)
-- Chinese Pages Document(中文镜像文档): [https://pages.goframe.org](https://pages.goframe.org)
-- Chinese Offline Document(中文离线文档): [https://github.com/gogf/goframe.org-pdf](https://github.com/gogf/goframe.org-pdf)
+- GoFrame Official Site: [https://goframe.org](https://goframe.org)
+- GoFrame Official Site(en): [https://goframe.org/en](https://goframe.org/en)
+- GoFrame Mirror Site(中文): [https://goframe.org.cn](https://goframe.org.cn)
+- GoFrame Mirror Site(github pages): [https://pages.goframe.org](https://pages.goframe.org)
- GoDoc API: [https://pkg.go.dev/github.com/gogf/gf/v2](https://pkg.go.dev/github.com/gogf/gf/v2)
+
+# Contributors
+
+💖 [Thanks to all the contributors who made GoFrame possible](https://github.com/gogf/gf/graphs/contributors) 💖
+
+
+
+
+
# License
`GoFrame` is licensed under the [MIT License](LICENSE), 100% free and open-source, forever.
-
-# Part Of Users
-
-- [Tencent](https://www.tencent.com/)
-- [ZTE](https://www.zte.com.cn/china/)
-- [Ant Financial Services](https://www.antfin.com/)
-- [VIVO](https://www.vivo.com/)
-- [MedLinker](https://www.medlinker.com/)
-- [KuCoin](https://www.kucoin.io/)
-- [LeYouJia](https://www.leyoujia.com/)
-- [IGG](https://igg.com)
-- [37](https://www.37.com)
-- [XiMaLaYa](https://www.ximalaya.com)
-- [ZYBang](https://www.zybang.com/)
-
-> We list part of the users here, if your company or products are using `GoFrame`, please let us know [here](https://goframe.org/pages/viewpage.action?pageId=1114415).
-
-# Contributors
-
-This project exists thanks to all the people who contribute. [[Contributors](https://github.com/gogf/gf/graphs/contributors)].
-
-
-# Donators
-
-If you love `GoFrame`, why not [buy developer a cup of coffee](https://goframe.org/pages/viewpage.action?pageId=1115633)?
-
-# Sponsors
-
-We appreciate any kind of sponsorship for `GoFrame` development. If you've got some interesting, please contact WeChat `389961817` / Email `john@goframe.org`.
-
-# Thanks
-
-
-
diff --git a/cmd/gf/Makefile b/cmd/gf/Makefile
index e82397130..ae7d69716 100644
--- a/cmd/gf/Makefile
+++ b/cmd/gf/Makefile
@@ -1,3 +1,4 @@
+.DEFAULT_GOAL := pack
pack: pack.template-single pack.template-mono pack.template-mono-app
@@ -17,6 +18,9 @@ pack.template-mono:
@cd temp && gf pack template-mono ../internal/packed/template-mono.go -n=packed -y
@rm -fr temp
+# Note:
+# command `sed` only works on MacOS.
+# use `grep -irl 'template-single' temp| xargs sed -i'' -e 's/template-single/template-mono-app/g'` on other platforms.
pack.template-mono-app:
@rm -fr temp
@mkdir temp || exit 0
@@ -27,6 +31,6 @@ pack.template-mono-app:
@rm -fr temp/template-mono-app/.gitignore
@rm -fr temp/template-mono-app/go.mod
@rm -fr temp/template-mono-app/go.sum
- @sed -i 's/template-single/template-mono-app/g' temp/template-mono-app/main.go
+ @grep -irl 'template-single' temp| xargs sed -i '' -e 's/template-single/template-mono-app/g'
@cd temp && gf pack template-mono-app ../internal/packed/template-mono-app.go -n=packed -y
@rm -fr temp
\ No newline at end of file
diff --git a/cmd/gf/gfcmd/gfcmd.go b/cmd/gf/gfcmd/gfcmd.go
index 9869e6ae5..4a8dd0622 100644
--- a/cmd/gf/gfcmd/gfcmd.go
+++ b/cmd/gf/gfcmd/gfcmd.go
@@ -73,7 +73,7 @@ func (c *Command) Run(ctx context.Context) {
func GetCommand(ctx context.Context) (*Command, error) {
root, err := gcmd.NewFromObject(cmd.GF)
if err != nil {
- panic(err)
+ return nil, err
}
err = root.AddObject(
cmd.Up,
diff --git a/cmd/gf/go.mod b/cmd/gf/go.mod
index a8d4038f1..8b3d4d5b6 100644
--- a/cmd/gf/go.mod
+++ b/cmd/gf/go.mod
@@ -3,36 +3,36 @@ module github.com/gogf/gf/cmd/gf/v2
go 1.18
require (
- github.com/gogf/gf/contrib/drivers/clickhouse/v2 v2.7.2
- github.com/gogf/gf/contrib/drivers/mssql/v2 v2.7.2
- github.com/gogf/gf/contrib/drivers/mysql/v2 v2.7.2
- github.com/gogf/gf/contrib/drivers/oracle/v2 v2.7.2
- github.com/gogf/gf/contrib/drivers/pgsql/v2 v2.7.2
- github.com/gogf/gf/contrib/drivers/sqlite/v2 v2.7.2
- github.com/gogf/gf/v2 v2.7.2
+ github.com/gogf/gf/contrib/drivers/clickhouse/v2 v2.8.1
+ github.com/gogf/gf/contrib/drivers/mssql/v2 v2.8.1
+ github.com/gogf/gf/contrib/drivers/mysql/v2 v2.8.1
+ github.com/gogf/gf/contrib/drivers/oracle/v2 v2.8.1
+ github.com/gogf/gf/contrib/drivers/pgsql/v2 v2.8.1
+ github.com/gogf/gf/contrib/drivers/sqlite/v2 v2.8.1
+ github.com/gogf/gf/v2 v2.8.1
github.com/gogf/selfupdate v0.0.0-20231215043001-5c48c528462f
github.com/olekukonko/tablewriter v0.0.5
golang.org/x/mod v0.17.0
- golang.org/x/tools v0.18.0
+ golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d
)
require (
aead.dev/minisign v0.2.0 // indirect
- github.com/BurntSushi/toml v1.3.2 // indirect
+ github.com/BurntSushi/toml v1.4.0 // indirect
github.com/ClickHouse/clickhouse-go/v2 v2.0.15 // indirect
github.com/clbanning/mxj/v2 v2.7.0 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
- github.com/fatih/color v1.16.0 // indirect
+ github.com/fatih/color v1.17.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/glebarez/go-sqlite v1.21.2 // indirect
- github.com/go-logr/logr v1.2.4 // indirect
+ github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-sql-driver/mysql v1.7.1 // indirect
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect
github.com/golang-sql/sqlexp v0.1.0 // indirect
github.com/google/uuid v1.6.0 // indirect
- github.com/gorilla/websocket v1.5.1 // indirect
+ github.com/gorilla/websocket v1.5.3 // indirect
github.com/grokify/html-strip-tags-go v0.1.0 // indirect
github.com/lib/pq v1.10.9 // indirect
github.com/magiconair/properties v1.8.7 // indirect
@@ -43,17 +43,18 @@ require (
github.com/paulmach/orb v0.7.1 // indirect
github.com/pierrec/lz4/v4 v4.1.14 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
- github.com/rivo/uniseg v0.4.4 // indirect
+ github.com/rivo/uniseg v0.4.7 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/sijms/go-ora/v2 v2.7.10 // indirect
- go.opentelemetry.io/otel v1.14.0 // indirect
- go.opentelemetry.io/otel/sdk v1.14.0 // indirect
- go.opentelemetry.io/otel/trace v1.14.0 // indirect
- golang.org/x/crypto v0.23.0 // indirect
- golang.org/x/net v0.25.0 // indirect
+ go.opentelemetry.io/otel v1.24.0 // indirect
+ go.opentelemetry.io/otel/metric v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.24.0 // indirect
+ go.opentelemetry.io/otel/trace v1.24.0 // indirect
+ golang.org/x/crypto v0.25.0 // indirect
+ golang.org/x/net v0.27.0 // indirect
golang.org/x/sync v0.7.0 // indirect
- golang.org/x/sys v0.20.0 // indirect
- golang.org/x/text v0.15.0 // indirect
+ golang.org/x/sys v0.22.0 // indirect
+ golang.org/x/text v0.16.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
modernc.org/libc v1.22.5 // indirect
modernc.org/mathutil v1.5.0 // indirect
diff --git a/cmd/gf/go.sum b/cmd/gf/go.sum
index 8ccde0d55..e66bcfaa1 100644
--- a/cmd/gf/go.sum
+++ b/cmd/gf/go.sum
@@ -6,8 +6,8 @@ github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.1 h1:6oNBlSdi1QqM1PNW7FPA6xO
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.0.1 h1:MyVTgWR8qd/Jw1Le0NZebGBUCLbtak3bJ3z1OlqZBpw=
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.0.0 h1:D3occbWoio4EBLkbkevetNMAVX197GkzbUMtqjGWn80=
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1 h1:DzHpqpoJVaCgOUdVHxE8QB52S6NiVdDQvGlny1qvPqA=
-github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
-github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
+github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
+github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/ClickHouse/clickhouse-go v1.5.4/go.mod h1:EaI/sW7Azgz9UATzd5ZdZHRUhHgv5+JMS9NSr2smCJI=
github.com/ClickHouse/clickhouse-go/v2 v2.0.15 h1:lLAZliqrZEygkxosLaW1qHyeTb4Ho7fVCZ0WKCpLocU=
github.com/ClickHouse/clickhouse-go/v2 v2.0.15/go.mod h1:Z21o82zD8FFqefOQDg93c0XITlxGbTsWQuRm588Azkk=
@@ -22,16 +22,16 @@ github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkp
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
-github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
-github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
+github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
+github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/glebarez/go-sqlite v1.21.2 h1:3a6LFC4sKahUunAmynQKLZceZCOzUthkRkEAl9gAXWo=
github.com/glebarez/go-sqlite v1.21.2/go.mod h1:sfxdZyhQjTM2Wry3gVYWaW072Ri1WMdWJi0k6+3382k=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.2.3/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/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
+github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM=
@@ -50,15 +50,15 @@ github.com/golang-sql/sqlexp v0.1.0/go.mod h1:J4ad9Vo8ZCWQ2GMrC4UCQy1JpCbwU9m3EO
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
-github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
+github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 h1:Xim43kblpZXfIBQsbuBVKCudVG457BR2GZFIz3uw3hQ=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ=
github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
-github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
-github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
+github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
+github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grokify/html-strip-tags-go v0.1.0 h1:03UrQLjAny8xci+R+qjCce/MYnpNXCtgzltlQbOBae4=
github.com/grokify/html-strip-tags-go v0.1.0/go.mod h1:ZdzgfHEzAfz9X6Xe5eBLVblWIxXfYSQ40S/VKrAOGpc=
github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks=
@@ -97,8 +97,8 @@ github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qq
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/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
-github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
-github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
+github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
+github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/shirou/gopsutil v2.19.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc=
@@ -118,19 +118,21 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
go.opentelemetry.io/otel v1.7.0/go.mod h1:5BdUoMIz5WEs0vt0CUEMtSSaTSHBBVwrhnz7+nrD5xk=
-go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM=
-go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU=
-go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY=
-go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
go.opentelemetry.io/otel/trace v1.7.0/go.mod h1:fzLSB9nqR2eXzxPXb2JW9IKE+ScyXA48yyE4TNvoHqU=
-go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M=
-go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
-golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=
-golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
+golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30=
+golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA=
@@ -139,8 +141,8 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
-golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
-golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
+golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
+golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -157,19 +159,19 @@ golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220429233432-b5fbb4746d32/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
-golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
+golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
-golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk=
-golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
+golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
+golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
-golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ=
-golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg=
+golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg=
+golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
diff --git a/cmd/gf/internal/cmd/cmd.go b/cmd/gf/internal/cmd/cmd.go
index bd5e8922e..4a39fd17b 100644
--- a/cmd/gf/internal/cmd/cmd.go
+++ b/cmd/gf/internal/cmd/cmd.go
@@ -59,7 +59,7 @@ func (c cGF) Index(ctx context.Context, in cGFInput) (out *cGFOutput, err error)
answer := "n"
// No argument or option, do installation checks.
if data, isInstalled := service.Install.IsInstalled(); !isInstalled {
- mlog.Print("hi, it seams it's the first time you installing gf cli.")
+ mlog.Print("hi, it seems it's the first time you installing gf cli.")
answer = gcmd.Scanf("do you want to install gf(%s) binary to your system? [y/n]: ", gf.VERSION)
} else if !data.IsSelf {
mlog.Print("hi, you have installed gf cli.")
diff --git a/cmd/gf/internal/cmd/cmd_build.go b/cmd/gf/internal/cmd/cmd_build.go
index edb7c382e..2454da574 100644
--- a/cmd/gf/internal/cmd/cmd_build.go
+++ b/cmd/gf/internal/cmd/cmd_build.go
@@ -138,11 +138,6 @@ type cBuildInput struct {
type cBuildOutput struct{}
func (c cBuild) Index(ctx context.Context, in cBuildInput) (out *cBuildOutput, err error) {
- // print used go env
- if in.DumpENV {
- _, _ = Env.Index(ctx, cEnvInput{})
- }
-
mlog.SetHeaderPrint(true)
mlog.Debugf(`build command input: %+v`, in)
@@ -217,7 +212,7 @@ func (c cBuild) Index(ctx context.Context, in cBuildInput) (out *cBuildOutput, e
if !gfile.Exists(in.PackDst) {
// Remove the go file that is automatically packed resource.
defer func() {
- _ = gfile.Remove(in.PackDst)
+ _ = gfile.RemoveFile(in.PackDst)
mlog.Printf(`remove the automatically generated resource go file: %s`, in.PackDst)
}()
}
@@ -241,6 +236,10 @@ func (c cBuild) Index(ctx context.Context, in cBuildInput) (out *cBuildOutput, e
} else {
genv.MustSet("CGO_ENABLED", "0")
}
+ // print used go env
+ if in.DumpENV {
+ _, _ = Env.Index(ctx, cEnvInput{})
+ }
for system, item := range platformMap {
if len(customSystems) > 0 && customSystems[0] != "all" && !gstr.InArray(customSystems, system) {
continue
diff --git a/cmd/gf/internal/cmd/cmd_doc.go b/cmd/gf/internal/cmd/cmd_doc.go
index 9b1b855ed..78501a8a1 100644
--- a/cmd/gf/internal/cmd/cmd_doc.go
+++ b/cmd/gf/internal/cmd/cmd_doc.go
@@ -8,6 +8,7 @@ package cmd
import (
"context"
+ "fmt"
"io"
"net/http"
"os"
@@ -22,8 +23,12 @@ import (
)
const (
+ GitName = "gf-site"
+ BranchName = "gh-pages"
+
+ SiteFileName = GitName + "-" + BranchName
// DocURL is the download address of the document
- DocURL = "https://github.com/gogf/gf/archive/refs/heads/gh-pages.zip"
+ DocURL = "https://github.com/gogf/" + GitName + "/archive/refs/heads/" + BranchName + ".zip"
)
var (
@@ -70,12 +75,13 @@ func (c cDoc) Index(ctx context.Context, in cDocInput) (out *cDocOutput, err err
mlog.Print("Failed to download document:", err)
return
}
- s := g.Server()
- s.SetServerRoot(docs.DocDir)
- s.SetPort(in.Port)
- s.SetDumpRouterMap(false)
- mlog.Printf("Access address http://127.0.0.1:%d", in.Port)
- s.Run()
+
+ http.Handle("/", http.FileServer(http.Dir(docs.DocDir)))
+ mlog.Printf("Access address http://127.0.0.1:%d in %s", in.Port, docs.DocDir)
+ err = http.ListenAndServe(fmt.Sprintf(":%d", in.Port), nil)
+ if err != nil {
+ return nil, err
+ }
return
}
@@ -89,7 +95,7 @@ type DocSetting struct {
// NewDocSetting new DocSetting
func NewDocSetting(ctx context.Context, in cDocInput) *DocSetting {
- fileName := "gf-doc-md.zip"
+ fileName := SiteFileName + ".zip"
tempDir := in.Path
if tempDir == "" {
tempDir = gfile.Temp("goframe/docs")
@@ -99,17 +105,17 @@ func NewDocSetting(ctx context.Context, in cDocInput) *DocSetting {
return &DocSetting{
TempDir: filepath.FromSlash(tempDir),
- DocDir: filepath.FromSlash(path.Join(tempDir, "gf-gh-pages")),
+ DocDir: filepath.FromSlash(path.Join(tempDir, SiteFileName)),
DocURL: in.Proxy + DocURL,
DocZipFile: filepath.FromSlash(path.Join(tempDir, fileName)),
}
}
-// Clean clean the temporary directory
+// Clean cleans the temporary directory
func (d *DocSetting) Clean() error {
if _, err := os.Stat(d.TempDir); err == nil {
- err = gfile.Remove(d.TempDir)
+ err = gfile.RemoveAll(d.TempDir)
if err != nil {
mlog.Print("Failed to delete temporary directory:", err)
return err
@@ -168,7 +174,7 @@ func (d *DocSetting) DownloadDoc() error {
err := gcompress.UnZipFile(d.DocZipFile, d.TempDir)
if err != nil {
mlog.Print("Failed to unzip the file, please run again:", err)
- gfile.Remove(d.DocZipFile)
+ _ = gfile.RemoveFile(d.DocZipFile)
return err
}
diff --git a/cmd/gf/internal/cmd/cmd_run.go b/cmd/gf/internal/cmd/cmd_run.go
index 8c30c4e34..490a93a8b 100644
--- a/cmd/gf/internal/cmd/cmd_run.go
+++ b/cmd/gf/internal/cmd/cmd_run.go
@@ -93,6 +93,12 @@ type (
)
func (c cRun) Index(ctx context.Context, in cRunInput) (out *cRunOutput, err error) {
+ if !gfile.Exists(in.File) {
+ mlog.Fatalf(`given file "%s" not found`, in.File)
+ }
+ if !gfile.IsFile(in.File) {
+ mlog.Fatalf(`given "%s" is not a file`, in.File)
+ }
// Necessary check.
if gproc.SearchBinary("go") == "" {
mlog.Fatalf(`command "go" not found in your environment, please install golang first to proceed this command`)
@@ -205,7 +211,7 @@ func (app *cRunApp) End(ctx context.Context, sig os.Signal, outputPath string) {
mlog.Debugf("kill process error: %s", err.Error())
}
}
- if err := gfile.Remove(outputPath); err != nil {
+ if err := gfile.RemoveFile(outputPath); err != nil {
mlog.Printf("delete binary file error: %s", err.Error())
} else {
mlog.Printf("deleted binary file: %s", outputPath)
diff --git a/cmd/gf/internal/cmd/cmd_up.go b/cmd/gf/internal/cmd/cmd_up.go
index ab9963bd8..2bef38896 100644
--- a/cmd/gf/internal/cmd/cmd_up.go
+++ b/cmd/gf/internal/cmd/cmd_up.go
@@ -142,8 +142,9 @@ func (c cUp) doUpgradeVersion(ctx context.Context, in cUpInput) (out *doUpgradeV
}
for _, pkg := range packages {
mlog.Printf(`upgrading "%s" from "%s" to "latest"`, pkg.Name, pkg.Version)
- // go get -u
- command := fmt.Sprintf(`cd %s && go get -u %s@latest`, dirPath, pkg.Name)
+ mlog.Printf(`running command: go get %s@latest`, pkg.Name)
+ // go get @latest
+ command := fmt.Sprintf(`cd %s && go get %s@latest`, dirPath, pkg.Name)
if err = gproc.ShellRun(ctx, command); err != nil {
return
}
@@ -191,7 +192,7 @@ func (c cUp) doUpgradeCLI(ctx context.Context) (err error) {
defer func() {
mlog.Printf(`new version cli binary is successfully installed to "%s"`, gfile.SelfPath())
mlog.Printf(`remove temporary buffer file "%s"`, localSaveFilePath)
- _ = gfile.Remove(localSaveFilePath)
+ _ = gfile.RemoveFile(localSaveFilePath)
}()
// It fails if file not exist or its size is less than 1MB.
diff --git a/cmd/gf/internal/cmd/cmd_z_unit_gen_dao_test.go b/cmd/gf/internal/cmd/cmd_z_unit_gen_dao_test.go
index 5958e238e..dd920b663 100644
--- a/cmd/gf/internal/cmd/cmd_z_unit_gen_dao_test.go
+++ b/cmd/gf/internal/cmd/cmd_z_unit_gen_dao_test.go
@@ -691,3 +691,151 @@ func Test_Gen_Dao_Issue3459(t *testing.T) {
}
})
}
+
+// https://github.com/gogf/gf/issues/3749
+func Test_Gen_Dao_Issue3749(t *testing.T) {
+ gtest.C(t, func(t *gtest.T) {
+ var (
+ err error
+ db = testDB
+ table = "table_user"
+ sqlContent = fmt.Sprintf(
+ gtest.DataContent(`issue`, `3749`, `user.tpl.sql`),
+ table,
+ )
+ )
+ dropTableWithDb(db, table)
+ array := gstr.SplitAndTrim(sqlContent, ";")
+ for _, v := range array {
+ if _, err = db.Exec(ctx, v); err != nil {
+ t.AssertNil(err)
+ }
+ }
+ defer dropTableWithDb(db, table)
+
+ var (
+ path = gfile.Temp(guid.S())
+ group = "test"
+ in = gendao.CGenDaoInput{
+ Path: path,
+ Link: link,
+ Group: group,
+ }
+ )
+
+ err = gutil.FillStructWithDefault(&in)
+ t.AssertNil(err)
+
+ err = gfile.Mkdir(path)
+ t.AssertNil(err)
+
+ // for go mod import path auto retrieve.
+ err = gfile.Copy(
+ gtest.DataPath("gendao", "go.mod.txt"),
+ gfile.Join(path, "go.mod"),
+ )
+ t.AssertNil(err)
+
+ _, err = gendao.CGenDao{}.Dao(ctx, in)
+ t.AssertNil(err)
+ defer gfile.Remove(path)
+
+ // files
+ files, err := gfile.ScanDir(path, "*.go", true)
+ t.AssertNil(err)
+ t.Assert(files, []string{
+ filepath.FromSlash(path + "/dao/internal/table_user.go"),
+ filepath.FromSlash(path + "/dao/table_user.go"),
+ filepath.FromSlash(path + "/model/do/table_user.go"),
+ filepath.FromSlash(path + "/model/entity/table_user.go"),
+ })
+ // content
+ testPath := gtest.DataPath(`issue`, `3749`)
+ expectFiles := []string{
+ filepath.FromSlash(testPath + "/dao/internal/table_user.go"),
+ filepath.FromSlash(testPath + "/dao/table_user.go"),
+ filepath.FromSlash(testPath + "/model/do/table_user.go"),
+ filepath.FromSlash(testPath + "/model/entity/table_user.go"),
+ }
+ for i, _ := range files {
+ t.Assert(gfile.GetContents(files[i]), gfile.GetContents(expectFiles[i]))
+ }
+ })
+}
+
+func Test_Gen_Dao_Sqlite3(t *testing.T) {
+ gtest.C(t, func(t *gtest.T) {
+ var (
+ err error
+ table = "table_user"
+ path = gfile.Temp(guid.S())
+ linkSqlite3 = fmt.Sprintf("sqlite::@file(%s/db.sqlite3)", path)
+ sqlContent = fmt.Sprintf(
+ gtest.DataContent(`gendao`, `sqlite3`, `user.sqlite3.sql`),
+ table,
+ )
+ )
+ err = gfile.Mkdir(path)
+ t.AssertNil(err)
+ defer gfile.Remove(path)
+
+ dbSqlite3, err := gdb.New(gdb.ConfigNode{
+ Link: linkSqlite3,
+ })
+ t.AssertNil(err)
+
+ array := gstr.SplitAndTrim(sqlContent, ";")
+ for _, v := range array {
+ if v == "" {
+ continue
+ }
+ if _, err = dbSqlite3.Exec(ctx, v); err != nil {
+ t.AssertNil(err)
+ }
+ }
+
+ var (
+ group = "test"
+ in = gendao.CGenDaoInput{
+ Path: path,
+ Link: linkSqlite3,
+ Group: group,
+ Tables: table,
+ }
+ )
+ err = gutil.FillStructWithDefault(&in)
+ t.AssertNil(err)
+
+ // for go mod import path auto retrieve.
+ err = gfile.Copy(
+ gtest.DataPath("gendao", "go.mod.txt"),
+ gfile.Join(path, "go.mod"),
+ )
+ t.AssertNil(err)
+
+ _, err = gendao.CGenDao{}.Dao(ctx, in)
+ t.AssertNil(err)
+ defer gfile.Remove(path)
+
+ // files
+ files, err := gfile.ScanDir(path, "*.go", true)
+ t.AssertNil(err)
+ t.Assert(files, []string{
+ filepath.FromSlash(path + "/dao/internal/table_user.go"),
+ filepath.FromSlash(path + "/dao/table_user.go"),
+ filepath.FromSlash(path + "/model/do/table_user.go"),
+ filepath.FromSlash(path + "/model/entity/table_user.go"),
+ })
+ // content
+ testPath := gtest.DataPath("gendao", "generated_user_sqlite3")
+ expectFiles := []string{
+ filepath.FromSlash(testPath + "/dao/internal/table_user.go"),
+ filepath.FromSlash(testPath + "/dao/table_user.go"),
+ filepath.FromSlash(testPath + "/model/do/table_user.go"),
+ filepath.FromSlash(testPath + "/model/entity/table_user.go"),
+ }
+ for i, _ := range files {
+ t.Assert(gfile.GetContents(files[i]), gfile.GetContents(expectFiles[i]))
+ }
+ })
+}
diff --git a/cmd/gf/internal/cmd/cmd_z_unit_gen_pb_test.go b/cmd/gf/internal/cmd/cmd_z_unit_gen_pb_test.go
new file mode 100644
index 000000000..f1ec5be5c
--- /dev/null
+++ b/cmd/gf/internal/cmd/cmd_z_unit_gen_pb_test.go
@@ -0,0 +1,50 @@
+// Copyright GoFrame gf Author(https://goframe.org). All Rights Reserved.
+//
+// This Source Code Form is subject to the terms of the MIT License.
+// If a copy of the MIT was not distributed with this file,
+// You can obtain one at https://github.com/gogf/gf.
+
+package cmd
+
+import (
+ "path/filepath"
+ "testing"
+
+ "github.com/gogf/gf/cmd/gf/v2/internal/cmd/genpb"
+ "github.com/gogf/gf/v2/os/gfile"
+ "github.com/gogf/gf/v2/test/gtest"
+ "github.com/gogf/gf/v2/text/gstr"
+ "github.com/gogf/gf/v2/util/guid"
+)
+
+func TestGenPbIssue3882(t *testing.T) {
+ gtest.C(t, func(t *gtest.T) {
+ var (
+ outputPath = gfile.Temp(guid.S())
+ outputApiPath = filepath.Join(outputPath, "api")
+ outputCtrlPath = filepath.Join(outputPath, "controller")
+
+ protobufFolder = gtest.DataPath("issue", "3882")
+ in = genpb.CGenPbInput{
+ Path: protobufFolder,
+ OutputApi: outputApiPath,
+ OutputCtrl: outputCtrlPath,
+ }
+ err error
+ )
+ err = gfile.Mkdir(outputApiPath)
+ t.AssertNil(err)
+ err = gfile.Mkdir(outputCtrlPath)
+ t.AssertNil(err)
+ defer gfile.Remove(outputPath)
+
+ _, err = genpb.CGenPb{}.Pb(ctx, in)
+ t.AssertNil(err)
+
+ var (
+ genContent = gfile.GetContents(filepath.Join(outputApiPath, "issue3882.pb.go"))
+ exceptText = `dc:"Some comment on field with 'one' 'two' 'three' in the comment."`
+ )
+ t.Assert(gstr.Contains(genContent, exceptText), true)
+ })
+}
diff --git a/cmd/gf/internal/cmd/cmd_z_unit_gen_pbentity_test.go b/cmd/gf/internal/cmd/cmd_z_unit_gen_pbentity_test.go
index 4a105697d..851dc2a7e 100644
--- a/cmd/gf/internal/cmd/cmd_z_unit_gen_pbentity_test.go
+++ b/cmd/gf/internal/cmd/cmd_z_unit_gen_pbentity_test.go
@@ -52,6 +52,8 @@ func Test_Gen_Pbentity_Default(t *testing.T) {
NameCase: "",
JsonCase: "",
Option: "",
+ TypeMapping: nil,
+ FieldMapping: nil,
}
)
err = gutil.FillStructWithDefault(&in)
@@ -115,6 +117,8 @@ func Test_Gen_Pbentity_NameCase_SnakeScreaming(t *testing.T) {
NameCase: "SnakeScreaming",
JsonCase: "",
Option: "",
+ TypeMapping: nil,
+ FieldMapping: nil,
}
)
err = gutil.FillStructWithDefault(&in)
@@ -179,6 +183,8 @@ func Test_Issue_3545(t *testing.T) {
NameCase: "",
JsonCase: "",
Option: "",
+ TypeMapping: nil,
+ FieldMapping: nil,
}
)
err = gutil.FillStructWithDefault(&in)
@@ -208,3 +214,74 @@ func Test_Issue_3545(t *testing.T) {
}
})
}
+
+// https://github.com/gogf/gf/issues/3685
+func Test_Issue_3685(t *testing.T) {
+ gtest.C(t, func(t *gtest.T) {
+ var (
+ err error
+ db = testDB
+ table = "table_user"
+ sqlContent = fmt.Sprintf(
+ gtest.DataContent(`issue`, `3685`, `user.tpl.sql`),
+ table,
+ )
+ )
+ dropTableWithDb(db, table)
+ array := gstr.SplitAndTrim(sqlContent, ";")
+ for _, v := range array {
+ if _, err = db.Exec(ctx, v); err != nil {
+ t.AssertNil(err)
+ }
+ }
+ defer dropTableWithDb(db, table)
+
+ var (
+ path = gfile.Temp(guid.S())
+ in = genpbentity.CGenPbEntityInput{
+ Path: path,
+ Package: "",
+ Link: link,
+ Tables: "",
+ Prefix: "",
+ RemovePrefix: "",
+ RemoveFieldPrefix: "",
+ NameCase: "",
+ JsonCase: "",
+ Option: "",
+ TypeMapping: map[genpbentity.DBFieldTypeName]genpbentity.CustomAttributeType{
+ "json": {
+ Type: "google.protobuf.Value",
+ Import: "google/protobuf/struct.proto",
+ },
+ },
+ FieldMapping: nil,
+ }
+ )
+ err = gutil.FillStructWithDefault(&in)
+ t.AssertNil(err)
+
+ err = gfile.Mkdir(path)
+ t.AssertNil(err)
+ defer gfile.Remove(path)
+
+ _, err = genpbentity.CGenPbEntity{}.PbEntity(ctx, in)
+ t.AssertNil(err)
+
+ // files
+ files, err := gfile.ScanDir(path, "*.proto", false)
+ t.AssertNil(err)
+ t.Assert(files, []string{
+ path + filepath.FromSlash("/table_user.proto"),
+ })
+
+ // contents
+ testPath := gtest.DataPath("issue", "3685")
+ expectFiles := []string{
+ testPath + filepath.FromSlash("/table_user.proto"),
+ }
+ for i := range files {
+ t.Assert(gfile.GetContents(files[i]), gfile.GetContents(expectFiles[i]))
+ }
+ })
+}
diff --git a/cmd/gf/internal/cmd/cmd_z_unit_gen_service_test.go b/cmd/gf/internal/cmd/cmd_z_unit_gen_service_test.go
index 4491a3fcb..e2362bbb5 100644
--- a/cmd/gf/internal/cmd/cmd_z_unit_gen_service_test.go
+++ b/cmd/gf/internal/cmd/cmd_z_unit_gen_service_test.go
@@ -22,9 +22,9 @@ func Test_Gen_Service_Default(t *testing.T) {
var (
path = gfile.Temp(guid.S())
dstFolder = path + filepath.FromSlash("/service")
- apiFolder = gtest.DataPath("genservice", "logic")
+ srvFolder = gtest.DataPath("genservice", "logic")
in = genservice.CGenServiceInput{
- SrcFolder: apiFolder,
+ SrcFolder: srvFolder,
DstFolder: dstFolder,
DstFileNameCase: "Snake",
WatchFile: "",
@@ -46,11 +46,11 @@ func Test_Gen_Service_Default(t *testing.T) {
// logic file
var (
- genApi = apiFolder + filepath.FromSlash("/logic.go")
- genApiExpect = apiFolder + filepath.FromSlash("/logic_expect.go")
+ genSrv = srvFolder + filepath.FromSlash("/logic.go")
+ genSrvExpect = srvFolder + filepath.FromSlash("/logic_expect.go")
)
- defer gfile.Remove(genApi)
- t.Assert(gfile.GetContents(genApi), gfile.GetContents(genApiExpect))
+ defer gfile.Remove(genSrv)
+ t.Assert(gfile.GetContents(genSrv), gfile.GetContents(genSrvExpect))
// files
files, err := gfile.ScanDir(dstFolder, "*.go", true)
@@ -73,3 +73,83 @@ func Test_Gen_Service_Default(t *testing.T) {
}
})
}
+
+// https://github.com/gogf/gf/issues/3328
+func Test_Issue3328(t *testing.T) {
+ gtest.C(t, func(t *gtest.T) {
+ var (
+ path = gfile.Temp(guid.S())
+ dstFolder = path + filepath.FromSlash("/service")
+ srvFolder = gtest.DataPath("issue", "3328", "logic")
+ logicGoPath = srvFolder + filepath.FromSlash("/logic.go")
+ in = genservice.CGenServiceInput{
+ SrcFolder: srvFolder,
+ DstFolder: dstFolder,
+ DstFileNameCase: "Snake",
+ WatchFile: "",
+ StPattern: "",
+ Packages: nil,
+ ImportPrefix: "",
+ Clear: false,
+ }
+ )
+ gfile.Remove(logicGoPath)
+ defer gfile.Remove(logicGoPath)
+
+ err := gutil.FillStructWithDefault(&in)
+ t.AssertNil(err)
+
+ err = gfile.Mkdir(path)
+ t.AssertNil(err)
+ defer gfile.Remove(path)
+
+ _, err = genservice.CGenService{}.Service(ctx, in)
+ t.AssertNil(err)
+
+ files, err := gfile.ScanDir(srvFolder, "*", true)
+ for _, file := range files {
+ if file == logicGoPath {
+ if gfile.IsDir(logicGoPath) {
+ t.Fatalf("%s should not is folder", logicGoPath)
+ }
+ }
+ }
+ })
+}
+
+// https://github.com/gogf/gf/issues/3835
+func Test_Issue3835(t *testing.T) {
+ gtest.C(t, func(t *gtest.T) {
+ var (
+ path = gfile.Temp(guid.S())
+ dstFolder = path + filepath.FromSlash("/service")
+ srvFolder = gtest.DataPath("issue", "3835", "logic")
+ in = genservice.CGenServiceInput{
+ SrcFolder: srvFolder,
+ DstFolder: dstFolder,
+ DstFileNameCase: "Snake",
+ WatchFile: "",
+ StPattern: "",
+ Packages: nil,
+ ImportPrefix: "",
+ Clear: false,
+ }
+ )
+ err := gutil.FillStructWithDefault(&in)
+ t.AssertNil(err)
+
+ err = gfile.Mkdir(path)
+ t.AssertNil(err)
+ defer gfile.Remove(path)
+
+ _, err = genservice.CGenService{}.Service(ctx, in)
+ t.AssertNil(err)
+
+ // contents
+ var (
+ genFile = dstFolder + filepath.FromSlash("/issue_3835.go")
+ expectFile = gtest.DataPath("issue", "3835", "service", "issue_3835.go")
+ )
+ t.Assert(gfile.GetContents(genFile), gfile.GetContents(expectFile))
+ })
+}
diff --git a/cmd/gf/internal/cmd/genctrl/genctrl.go b/cmd/gf/internal/cmd/genctrl/genctrl.go
index d6788620a..87d87766e 100644
--- a/cmd/gf/internal/cmd/genctrl/genctrl.go
+++ b/cmd/gf/internal/cmd/genctrl/genctrl.go
@@ -128,7 +128,7 @@ func (c CGenCtrl) generateByWatchFile(watchFile, sdkPath string, sdkStdVersion,
return
}
}
- defer gfile.Remove(flockFilePath)
+ defer gfile.RemoveFile(flockFilePath)
_ = gfile.PutContents(flockFilePath, gtime.TimestampStr())
// check this updated file is an api file.
diff --git a/cmd/gf/internal/cmd/genctrl/genctrl_generate_ctrl.go b/cmd/gf/internal/cmd/genctrl/genctrl_generate_ctrl.go
index edaeb51a3..d966338f8 100644
--- a/cmd/gf/internal/cmd/genctrl/genctrl_generate_ctrl.go
+++ b/cmd/gf/internal/cmd/genctrl/genctrl_generate_ctrl.go
@@ -89,7 +89,7 @@ func (c *controllerGenerator) doGenerateCtrlNewByModuleAndVersion(
if err = gfile.PutContents(moduleFilePath, gstr.TrimLeft(content)); err != nil {
return err
}
- mlog.Printf(`generated: %s`, moduleFilePath)
+ mlog.Printf(`generated: %s`, gfile.RealPath(moduleFilePath))
}
if !gfile.Exists(moduleFilePathNew) {
content := gstr.ReplaceByMap(consts.TemplateGenCtrlControllerNewEmpty, g.MapStrStr{
@@ -99,7 +99,7 @@ func (c *controllerGenerator) doGenerateCtrlNewByModuleAndVersion(
if err = gfile.PutContents(moduleFilePathNew, gstr.TrimLeft(content)); err != nil {
return err
}
- mlog.Printf(`generated: %s`, moduleFilePathNew)
+ mlog.Printf(`generated: %s`, gfile.RealPath(moduleFilePathNew))
}
filePaths, err := gfile.ScanDir(dstModuleFolderPath, "*.go", false)
if err != nil {
@@ -161,7 +161,7 @@ func (c *controllerGenerator) doGenerateCtrlItem(dstModuleFolderPath string, ite
return err
}
}
- mlog.Printf(`generated: %s`, methodFilePath)
+ mlog.Printf(`generated: %s`, gfile.RealPath(methodFilePath))
return
}
@@ -221,7 +221,7 @@ func (c *controllerGenerator) doGenerateCtrlMergeItem(dstModuleFolderPath string
if err = gfile.PutContentsAppend(ctrlFilePath, ctrlFileItem.controllers.String()); err != nil {
return err
}
- mlog.Printf(`generated: %s`, ctrlFilePath)
+ mlog.Printf(`generated: %s`, gfile.RealPath(ctrlFilePath))
}
return
}
diff --git a/cmd/gf/internal/cmd/genctrl/genctrl_generate_ctrl_clear.go b/cmd/gf/internal/cmd/genctrl/genctrl_generate_ctrl_clear.go
index 73d562648..af328f8dd 100644
--- a/cmd/gf/internal/cmd/genctrl/genctrl_generate_ctrl_clear.go
+++ b/cmd/gf/internal/cmd/genctrl/genctrl_generate_ctrl_clear.go
@@ -49,7 +49,7 @@ func (c *controllerClearer) doClear(dstModuleFolderPath string, item apiItem) (e
`remove unimplemented and of no api definitions controller file: %s`,
methodFilePath,
)
- err = gfile.Remove(methodFilePath)
+ err = gfile.RemoveFile(methodFilePath)
}
}
return
diff --git a/cmd/gf/internal/cmd/genctrl/genctrl_generate_interface.go b/cmd/gf/internal/cmd/genctrl/genctrl_generate_interface.go
index c0ba77e1f..c678c0194 100644
--- a/cmd/gf/internal/cmd/genctrl/genctrl_generate_interface.go
+++ b/cmd/gf/internal/cmd/genctrl/genctrl_generate_interface.go
@@ -94,7 +94,7 @@ func (c *apiInterfaceGenerator) doGenerate(apiModuleFolderPath string, module st
"{Interfaces}": gstr.TrimRightStr(interfaceDefinition, "\n", 2),
}))
err = gfile.PutContents(moduleFilePath, interfaceContent)
- mlog.Printf(`generated: %s`, moduleFilePath)
+ mlog.Printf(`generated: %s`, gfile.RealPath(moduleFilePath))
return
}
diff --git a/cmd/gf/internal/cmd/genctrl/genctrl_generate_sdk.go b/cmd/gf/internal/cmd/genctrl/genctrl_generate_sdk.go
index e045ae0d9..b5a82afb6 100644
--- a/cmd/gf/internal/cmd/genctrl/genctrl_generate_sdk.go
+++ b/cmd/gf/internal/cmd/genctrl/genctrl_generate_sdk.go
@@ -65,7 +65,7 @@ func (c *apiSdkGenerator) doGenerateSdkPkgFile(sdkFolderPath string) (err error)
"{PkgName}": pkgName,
}))
err = gfile.PutContents(pkgFilePath, fileContent)
- mlog.Printf(`generated: %s`, pkgFilePath)
+ mlog.Printf(`generated: %s`, gfile.RealPath(pkgFilePath))
return
}
@@ -130,9 +130,9 @@ func (c *apiSdkGenerator) doGenerateSdkIClient(
if isDirty {
err = gfile.PutContents(iClientFilePath, fileContent)
if isExist {
- mlog.Printf(`updated: %s`, iClientFilePath)
+ mlog.Printf(`updated: %s`, gfile.RealPath(iClientFilePath))
} else {
- mlog.Printf(`generated: %s`, iClientFilePath)
+ mlog.Printf(`generated: %s`, gfile.RealPath(iClientFilePath))
}
}
return
@@ -183,7 +183,7 @@ func (c *apiSdkGenerator) doGenerateSdkImplementer(
implementerFileContent += "\n"
}
err = gfile.PutContents(implementerFilePath, implementerFileContent)
- mlog.Printf(`generated: %s`, implementerFilePath)
+ mlog.Printf(`generated: %s`, gfile.RealPath(implementerFilePath))
return
}
diff --git a/cmd/gf/internal/cmd/gendao/gendao.go b/cmd/gf/internal/cmd/gendao/gendao.go
index 7a048016e..a19d0c5a1 100644
--- a/cmd/gf/internal/cmd/gendao/gendao.go
+++ b/cmd/gf/internal/cmd/gendao/gendao.go
@@ -208,9 +208,11 @@ type (
NoModelComment bool `name:"noModelComment" short:"m" brief:"{CGenDaoBriefNoModelComment}" orphan:"true"`
Clear bool `name:"clear" short:"a" brief:"{CGenDaoBriefClear}" orphan:"true"`
- TypeMapping map[DBFieldTypeName]CustomAttributeType `name:"typeMapping" short:"y" brief:"{CGenDaoBriefTypeMapping}" orphan:"true"`
- FieldMapping map[DBTableFieldName]CustomAttributeType `name:"fieldMapping" short:"fm" brief:"{CGenDaoBriefFieldMapping}" orphan:"true"`
- genItems *CGenDaoInternalGenItems
+ TypeMapping map[DBFieldTypeName]CustomAttributeType `name:"typeMapping" short:"y" brief:"{CGenDaoBriefTypeMapping}" orphan:"true"`
+ FieldMapping map[DBTableFieldName]CustomAttributeType `name:"fieldMapping" short:"fm" brief:"{CGenDaoBriefFieldMapping}" orphan:"true"`
+
+ // internal usage purpose.
+ genItems *CGenDaoInternalGenItems
}
CGenDaoOutput struct{}
diff --git a/cmd/gf/internal/cmd/gendao/gendao_clear.go b/cmd/gf/internal/cmd/gendao/gendao_clear.go
index ad05918c3..181804641 100644
--- a/cmd/gf/internal/cmd/gendao/gendao_clear.go
+++ b/cmd/gf/internal/cmd/gendao/gendao_clear.go
@@ -40,7 +40,7 @@ func doClearItem(item CGenDaoInternalGenItem, allGeneratedFilePaths []string) {
}
for _, filePath := range generatedFilePaths {
if !gstr.InArray(allGeneratedFilePaths, filePath) {
- if err := gfile.Remove(filePath); err != nil {
+ if err := gfile.RemoveFile(filePath); err != nil {
mlog.Print(err)
}
}
diff --git a/cmd/gf/internal/cmd/gendao/gendao_dao.go b/cmd/gf/internal/cmd/gendao/gendao_dao.go
index 3d3b8a4d6..1c2363347 100644
--- a/cmd/gf/internal/cmd/gendao/gendao_dao.go
+++ b/cmd/gf/internal/cmd/gendao/gendao_dao.go
@@ -58,8 +58,8 @@ func generateDaoSingle(ctx context.Context, in generateDaoSingleInput) {
mlog.Fatalf(`fetching tables fields failed for table "%s": %+v`, in.TableName, err)
}
var (
- tableNameCamelCase = gstr.CaseCamel(strings.ToLower(in.NewTableName))
- tableNameCamelLowerCase = gstr.CaseCamelLower(strings.ToLower(in.NewTableName))
+ tableNameCamelCase = formatFieldName(in.NewTableName, FieldNameCaseCamel)
+ tableNameCamelLowerCase = formatFieldName(in.NewTableName, FieldNameCaseCamelLower)
tableNameSnakeCase = gstr.CaseSnake(in.NewTableName)
importPrefix = in.ImportPrefix
)
@@ -123,7 +123,7 @@ func generateDaoIndex(in generateDaoIndexInput) {
mlog.Fatalf("writing content to '%s' failed: %v", path, err)
} else {
utils.GoFmt(path)
- mlog.Print("generated:", path)
+ mlog.Print("generated:", gfile.RealPath(path))
}
}
}
@@ -157,7 +157,7 @@ func generateDaoInternal(in generateDaoInternalInput) {
mlog.Fatalf("writing content to '%s' failed: %v", path, err)
} else {
utils.GoFmt(path)
- mlog.Print("generated:", path)
+ mlog.Print("generated:", gfile.RealPath(path))
}
}
@@ -179,7 +179,7 @@ func generateColumnNamesForDao(fieldMap map[string]*gdb.TableField, removeFieldP
}
array[index] = []string{
- " #" + gstr.CaseCamel(strings.ToLower(newFiledName)) + ":",
+ " #" + formatFieldName(newFiledName, FieldNameCaseCamel) + ":",
fmt.Sprintf(` #"%s",`, field.Name),
}
}
@@ -219,7 +219,7 @@ func generateColumnDefinitionForDao(fieldMap map[string]*gdb.TableField, removeF
newFiledName = gstr.TrimLeftStr(newFiledName, v, 1)
}
array[index] = []string{
- " #" + gstr.CaseCamel(strings.ToLower(newFiledName)),
+ " #" + formatFieldName(newFiledName, FieldNameCaseCamel),
" # " + "string",
" #" + fmt.Sprintf(`// %s`, comment),
}
diff --git a/cmd/gf/internal/cmd/gendao/gendao_do.go b/cmd/gf/internal/cmd/gendao/gendao_do.go
index 16a4c15eb..7a3cb542c 100644
--- a/cmd/gf/internal/cmd/gendao/gendao_do.go
+++ b/cmd/gf/internal/cmd/gendao/gendao_do.go
@@ -40,7 +40,7 @@ func generateDo(ctx context.Context, in CGenDaoInternalInput) {
structDefinition, _ = generateStructDefinition(ctx, generateStructDefinitionInput{
CGenDaoInternalInput: in,
TableName: tableName,
- StructName: gstr.CaseCamel(strings.ToLower(newTableName)),
+ StructName: formatFieldName(newTableName, FieldNameCaseCamel),
FieldMap: fieldMap,
IsDo: true,
})
@@ -61,7 +61,7 @@ func generateDo(ctx context.Context, in CGenDaoInternalInput) {
ctx,
in,
tableName,
- gstr.CaseCamel(strings.ToLower(newTableName)),
+ formatFieldName(newTableName, FieldNameCaseCamel),
structDefinition,
)
in.genItems.AppendGeneratedFilePath(doFilePath)
@@ -70,7 +70,7 @@ func generateDo(ctx context.Context, in CGenDaoInternalInput) {
mlog.Fatalf(`writing content to "%s" failed: %v`, doFilePath, err)
} else {
utils.GoFmt(doFilePath)
- mlog.Print("generated:", doFilePath)
+ mlog.Print("generated:", gfile.RealPath(doFilePath))
}
}
}
diff --git a/cmd/gf/internal/cmd/gendao/gendao_entity.go b/cmd/gf/internal/cmd/gendao/gendao_entity.go
index 7a36bf428..9d38db428 100644
--- a/cmd/gf/internal/cmd/gendao/gendao_entity.go
+++ b/cmd/gf/internal/cmd/gendao/gendao_entity.go
@@ -36,7 +36,7 @@ func generateEntity(ctx context.Context, in CGenDaoInternalInput) {
structDefinition, appendImports = generateStructDefinition(ctx, generateStructDefinitionInput{
CGenDaoInternalInput: in,
TableName: tableName,
- StructName: gstr.CaseCamel(strings.ToLower(newTableName)),
+ StructName: formatFieldName(newTableName, FieldNameCaseCamel),
FieldMap: fieldMap,
IsDo: false,
})
@@ -44,7 +44,7 @@ func generateEntity(ctx context.Context, in CGenDaoInternalInput) {
ctx,
in,
newTableName,
- gstr.CaseCamel(strings.ToLower(newTableName)),
+ formatFieldName(newTableName, FieldNameCaseCamel),
structDefinition,
appendImports,
)
@@ -55,7 +55,7 @@ func generateEntity(ctx context.Context, in CGenDaoInternalInput) {
mlog.Fatalf("writing content to '%s' failed: %v", entityFilePath, err)
} else {
utils.GoFmt(entityFilePath)
- mlog.Print("generated:", entityFilePath)
+ mlog.Print("generated:", gfile.RealPath(entityFilePath))
}
}
}
diff --git a/cmd/gf/internal/cmd/gendao/gendao_structure.go b/cmd/gf/internal/cmd/gendao/gendao_structure.go
index e9acc8bff..01f334cb9 100644
--- a/cmd/gf/internal/cmd/gendao/gendao_structure.go
+++ b/cmd/gf/internal/cmd/gendao/gendao_structure.go
@@ -99,7 +99,7 @@ func generateStructFieldDefinition(
}
localTypeNameStr = string(localTypeName)
switch localTypeName {
- case gdb.LocalTypeDate, gdb.LocalTypeDatetime:
+ case gdb.LocalTypeDate, gdb.LocalTypeTime, gdb.LocalTypeDatetime:
if in.StdTime {
localTypeNameStr = "time.Time"
} else {
@@ -140,7 +140,7 @@ func generateStructFieldDefinition(
}
attrLines = []string{
- " #" + gstr.CaseCamel(strings.ToLower(newFiledName)),
+ " #" + formatFieldName(newFiledName, FieldNameCaseCamel),
" #" + localTypeNameStr,
}
attrLines = append(attrLines, fmt.Sprintf(` #%sjson:"%s"`, tagKey, jsonTag))
@@ -167,6 +167,43 @@ func generateStructFieldDefinition(
return attrLines, appendImport
}
+type FieldNameCase string
+
+const (
+ FieldNameCaseCamel FieldNameCase = "CaseCamel"
+ FieldNameCaseCamelLower FieldNameCase = "CaseCamelLower"
+)
+
+// formatFieldName formats and returns a new field name that is used for golang codes generating.
+func formatFieldName(fieldName string, nameCase FieldNameCase) string {
+ // For normal databases like mysql, pgsql, sqlite,
+ // field/table names of that are in normal case.
+ var newFieldName = fieldName
+ if isAllUpper(fieldName) {
+ // For special databases like dm, oracle,
+ // field/table names of that are in upper case.
+ newFieldName = strings.ToLower(fieldName)
+ }
+ switch nameCase {
+ case FieldNameCaseCamel:
+ return gstr.CaseCamel(newFieldName)
+ case FieldNameCaseCamelLower:
+ return gstr.CaseCamelLower(newFieldName)
+ default:
+ return ""
+ }
+}
+
+// isAllUpper checks and returns whether given `fieldName` all letters are upper case.
+func isAllUpper(fieldName string) bool {
+ for _, b := range fieldName {
+ if b >= 'a' && b <= 'z' {
+ return false
+ }
+ }
+ return true
+}
+
// formatComment formats the comment string to fit the golang code without any lines.
func formatComment(comment string) string {
comment = gstr.ReplaceByArray(comment, g.SliceStr{
diff --git a/cmd/gf/internal/cmd/genpb/genpb.go b/cmd/gf/internal/cmd/genpb/genpb.go
index e1c4f8836..023cdb984 100644
--- a/cmd/gf/internal/cmd/genpb/genpb.go
+++ b/cmd/gf/internal/cmd/genpb/genpb.go
@@ -94,6 +94,9 @@ func (c CGenPb) Pb(ctx context.Context, in CGenPbInput) (out *CGenPbOutput, err
mlog.Fatalf(`no proto files found in folder "%s"`, in.Path)
}
+ var originPwd = gfile.Pwd()
+ defer gfile.Chdir(originPwd)
+
if err = gfile.Chdir(protoPath); err != nil {
mlog.Fatal(err)
}
diff --git a/cmd/gf/internal/cmd/genpb/genpb_tag.go b/cmd/gf/internal/cmd/genpb/genpb_tag.go
index 5bc401a6e..f8cfad7e5 100644
--- a/cmd/gf/internal/cmd/genpb/genpb_tag.go
+++ b/cmd/gf/internal/cmd/genpb/genpb_tag.go
@@ -12,6 +12,7 @@ import (
"github.com/gogf/gf/cmd/gf/v2/internal/utility/utils"
"github.com/gogf/gf/v2/container/gmap"
+ "github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gfile"
"github.com/gogf/gf/v2/text/gregex"
"github.com/gogf/gf/v2/text/gstr"
@@ -90,8 +91,12 @@ func (c CGenPb) tagCommentIntoListMap(comment string, lineTagMap *gmap.ListMap)
lineTagMap.Set(tagName, lineTagMap.GetVar(tagName).String()+tagContent)
} else {
var (
- tagName = "dc"
- tagContent = comment
+ tagName = "dc"
+ // Convert backticks and double quotes to single quotes.
+ tagContent = gstr.ReplaceByMap(comment, g.MapStrStr{
+ "`": `'`,
+ `"`: `'`,
+ })
)
lineTagMap.Set(tagName, lineTagMap.GetVar(tagName).String()+tagContent)
}
diff --git a/cmd/gf/internal/cmd/genpbentity/genpbentity.go b/cmd/gf/internal/cmd/genpbentity/genpbentity.go
index 0c375593d..29a660b08 100644
--- a/cmd/gf/internal/cmd/genpbentity/genpbentity.go
+++ b/cmd/gf/internal/cmd/genpbentity/genpbentity.go
@@ -11,6 +11,7 @@ import (
"context"
"fmt"
"path/filepath"
+ "regexp"
"strings"
"github.com/gogf/gf/cmd/gf/v2/internal/utility/utils"
@@ -18,6 +19,7 @@ import (
"github.com/gogf/gf/cmd/gf/v2/internal/consts"
"github.com/gogf/gf/cmd/gf/v2/internal/utility/mlog"
+ "github.com/gogf/gf/v2/container/garray"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gctx"
@@ -43,6 +45,9 @@ type (
NameCase string `name:"nameCase" short:"n" brief:"{CGenPbEntityBriefNameCase}" d:"Camel"`
JsonCase string `name:"jsonCase" short:"j" brief:"{CGenPbEntityBriefJsonCase}" d:"none"`
Option string `name:"option" short:"o" brief:"{CGenPbEntityBriefOption}"`
+
+ TypeMapping map[DBFieldTypeName]CustomAttributeType `name:"typeMapping" short:"y" brief:"{CGenPbEntityBriefTypeMapping}" orphan:"true"`
+ FieldMapping map[DBTableFieldName]CustomAttributeType `name:"fieldMapping" short:"fm" brief:"{CGenPbEntityBriefFieldMapping}" orphan:"true"`
}
CGenPbEntityOutput struct{}
@@ -52,6 +57,13 @@ type (
TableName string // TableName specifies the table name of the table.
NewTableName string // NewTableName specifies the prefix-stripped name of the table.
}
+
+ DBTableFieldName = string
+ DBFieldTypeName = string
+ CustomAttributeType struct {
+ Type string `brief:"custom attribute type name"`
+ Import string `brief:"custom import for this type"`
+ }
)
const (
@@ -69,7 +81,7 @@ gf gen pbentity -r user_
CGenPbEntityAd = `
CONFIGURATION SUPPORT
Options are also supported by configuration file.
- It's suggested using configuration file instead of command line arguments making producing.
+ It's suggested using configuration file instead of command line arguments making producing.
The configuration node name is "gf.gen.pbentity", which also supports multiple databases, for example(config.yaml):
gfcli:
gen:
@@ -88,6 +100,13 @@ CONFIGURATION SUPPORT
option go_package = "protobuf/demos";
option java_package = "protobuf/demos";
option php_namespace = "protobuf/demos";
+ typeMapping:
+ json:
+ type: google.protobuf.Value
+ import: google/protobuf/struct.proto
+ jsonb:
+ type: google.protobuf.Value
+ import: google/protobuf/struct.proto
`
CGenPbEntityBriefPath = `directory path for generated files storing`
CGenPbEntityBriefPackage = `package path for all entity proto files`
@@ -106,7 +125,7 @@ it's not necessary and the default value is "default"
case for message attribute names, default is "Camel":
| Case | Example |
|---------------- |--------------------|
-| Camel | AnyKindOfString |
+| Camel | AnyKindOfString |
| CamelLower | anyKindOfString | default
| Snake | any_kind_of_string |
| SnakeScreaming | ANY_KIND_OF_STRING |
@@ -119,8 +138,95 @@ case for message attribute names, default is "Camel":
case for message json tag, cases are the same as "nameCase", default "CamelLower".
set it to "none" to ignore json tag generating.
`
+
+ CGenPbEntityBriefTypeMapping = `custom local type mapping for generated struct attributes relevant to fields of table`
+ CGenPbEntityBriefFieldMapping = `custom local type mapping for generated struct attributes relevant to specific fields of table`
)
+var defaultTypeMapping = map[DBFieldTypeName]CustomAttributeType{
+ // gdb.LocalTypeString
+ "string": {
+ Type: "string",
+ },
+ // gdb.LocalTypeTime
+ // "time": {
+ // Type: "google.protobuf.Duration",
+ // Import: "google/protobuf/duration.proto",
+ // },
+ // gdb.LocalTypeDate
+ "date": {
+ Type: "google.protobuf.Timestamp",
+ Import: "google/protobuf/timestamp.proto",
+ },
+ // gdb.LocalTypeDatetime
+ "datetime": {
+ Type: "google.protobuf.Timestamp",
+ Import: "google/protobuf/timestamp.proto",
+ },
+ // gdb.LocalTypeInt
+ "int": {
+ Type: "int32",
+ },
+ // gdb.LocalTypeUint
+ "uint": {
+ Type: "uint32",
+ },
+ // gdb.LocalTypeInt64
+ "int64": {
+ Type: "int64",
+ },
+ // gdb.LocalTypeUint64
+ "uint64": {
+ Type: "uint64",
+ },
+ // gdb.LocalTypeIntSlice
+ "[]int": {
+ Type: "repeated int32",
+ },
+ // gdb.LocalTypeInt64Slice
+ "[]int64": {
+ Type: "repeated int64",
+ },
+ // gdb.LocalTypeUint64Slice
+ "[]uint64": {
+ Type: "repeated uint64",
+ },
+ // gdb.LocalTypeInt64Bytes
+ "int64-bytes": {
+ Type: "repeated int64",
+ },
+ // gdb.LocalTypeUint64Bytes
+ "uint64-bytes": {
+ Type: "repeated uint64",
+ },
+ // gdb.LocalTypeFloat32
+ "float32": {
+ Type: "float",
+ },
+ // gdb.LocalTypeFloat64
+ "float64": {
+ Type: "double",
+ },
+ // gdb.LocalTypeBytes
+ "[]byte": {
+ Type: "bytes",
+ },
+ // gdb.LocalTypeBool
+ "bool": {
+ Type: "bool",
+ },
+ // gdb.LocalTypeJson
+ // "json": {
+ // Type: "google.protobuf.Value",
+ // Import: "google/protobuf/struct.proto",
+ // },
+ // gdb.LocalTypeJsonb
+ // "jsonb": {
+ // Type: "google.protobuf.Value",
+ // Import: "google/protobuf/struct.proto",
+ // },
+}
+
func init() {
gtag.Sets(g.MapStrStr{
`CGenPbEntityConfig`: CGenPbEntityConfig,
@@ -138,6 +244,8 @@ func init() {
`CGenPbEntityBriefNameCase`: CGenPbEntityBriefNameCase,
`CGenPbEntityBriefJsonCase`: CGenPbEntityBriefJsonCase,
`CGenPbEntityBriefOption`: CGenPbEntityBriefOption,
+ `CGenPbEntityBriefTypeMapping`: CGenPbEntityBriefTypeMapping,
+ `CGenPbEntityBriefFieldMapping`: CGenPbEntityBriefFieldMapping,
})
}
@@ -210,6 +318,16 @@ func doGenPbEntityForArray(ctx context.Context, index int, in CGenPbEntityInput)
mlog.Fatalf("fetching tables failed: \n %v", err)
}
}
+ // merge default typeMapping to input typeMapping.
+ if in.TypeMapping == nil {
+ in.TypeMapping = defaultTypeMapping
+ } else {
+ for key, typeMapping := range defaultTypeMapping {
+ if _, ok := in.TypeMapping[key]; !ok {
+ in.TypeMapping[key] = typeMapping
+ }
+ }
+ }
for _, tableName := range tableNames {
newTableName := tableName
@@ -234,18 +352,24 @@ func generatePbEntityContentFile(ctx context.Context, in CGenPbEntityInternalInp
// Change the `newTableName` if `Prefix` is given.
newTableName := in.Prefix + in.NewTableName
var (
- imports string
- tableNameCamelCase = gstr.CaseCamel(newTableName)
- tableNameSnakeCase = gstr.CaseSnake(newTableName)
- entityMessageDefine = generateEntityMessageDefinition(tableNameCamelCase, fieldMap, in)
- fileName = gstr.Trim(tableNameSnakeCase, "-_.")
- path = filepath.FromSlash(gfile.Join(in.Path, fileName+".proto"))
+ tableNameCamelCase = gstr.CaseCamel(newTableName)
+ tableNameSnakeCase = gstr.CaseSnake(newTableName)
+ entityMessageDefine, appendImports = generateEntityMessageDefinition(tableNameCamelCase, fieldMap, in)
+ fileName = gstr.Trim(tableNameSnakeCase, "-_.")
+ path = filepath.FromSlash(gfile.Join(in.Path, fileName+".proto"))
)
- if gstr.Contains(entityMessageDefine, "google.protobuf.Timestamp") {
- imports = `import "google/protobuf/timestamp.proto";`
+ packageImportStr := ""
+ var packageImportsArray = garray.NewStrArray()
+ if len(appendImports) > 0 {
+ for _, appendImport := range appendImports {
+ packageImportStr = fmt.Sprintf(`import "%s";`, appendImport)
+ if packageImportsArray.Search(packageImportStr) == -1 {
+ packageImportsArray.Append(packageImportStr)
+ }
+ }
}
entityContent := gstr.ReplaceByMap(getTplPbEntityContent(""), g.MapStrStr{
- "{Imports}": imports,
+ "{Imports}": packageImportsArray.Join("\n"),
"{PackageName}": gfile.Basename(in.Package),
"{GoPackage}": in.Package,
"{OptionContent}": in.Option,
@@ -254,19 +378,24 @@ func generatePbEntityContentFile(ctx context.Context, in CGenPbEntityInternalInp
if err := gfile.PutContents(path, strings.TrimSpace(entityContent)); err != nil {
mlog.Fatalf("writing content to '%s' failed: %v", path, err)
} else {
- mlog.Print("generated:", path)
+ mlog.Print("generated:", gfile.RealPath(path))
}
}
// generateEntityMessageDefinition generates and returns the message definition for specified table.
-func generateEntityMessageDefinition(entityName string, fieldMap map[string]*gdb.TableField, in CGenPbEntityInternalInput) string {
+func generateEntityMessageDefinition(entityName string, fieldMap map[string]*gdb.TableField, in CGenPbEntityInternalInput) (string, []string) {
var (
- buffer = bytes.NewBuffer(nil)
- array = make([][]string, len(fieldMap))
- names = sortFieldKeyForPbEntity(fieldMap)
+ appendImports []string
+ buffer = bytes.NewBuffer(nil)
+ array = make([][]string, len(fieldMap))
+ names = sortFieldKeyForPbEntity(fieldMap)
)
for index, name := range names {
- array[index] = generateMessageFieldForPbEntity(index+1, fieldMap[name], in)
+ var imports string
+ array[index], imports = generateMessageFieldForPbEntity(index+1, fieldMap[name], in)
+ if imports != "" {
+ appendImports = append(appendImports, imports)
+ }
}
tw := tablewriter.NewWriter(buffer)
tw.SetBorder(false)
@@ -277,48 +406,38 @@ func generateEntityMessageDefinition(entityName string, fieldMap map[string]*gdb
tw.Render()
stContent := buffer.String()
// Let's do this hack of table writer for indent!
- stContent = gstr.Replace(stContent, " #", "")
+ stContent = regexp.MustCompile(`\s+\n`).ReplaceAllString(gstr.Replace(stContent, " #", ""), "\n")
buffer.Reset()
buffer.WriteString(fmt.Sprintf("message %s {\n", entityName))
buffer.WriteString(stContent)
buffer.WriteString("}")
- return buffer.String()
+ return buffer.String(), appendImports
}
// generateMessageFieldForPbEntity generates and returns the message definition for specified field.
-func generateMessageFieldForPbEntity(index int, field *gdb.TableField, in CGenPbEntityInternalInput) []string {
+func generateMessageFieldForPbEntity(index int, field *gdb.TableField, in CGenPbEntityInternalInput) (attrLines []string, appendImport string) {
var (
- localTypeName gdb.LocalType
- comment string
- jsonTagStr string
- err error
- ctx = gctx.GetInitCtx()
+ localTypeNameStr string
+ localTypeName gdb.LocalType
+ comment string
+ jsonTagStr string
+ err error
+ ctx = gctx.GetInitCtx()
)
- localTypeName, err = in.DB.CheckLocalTypeForField(ctx, field.Type, nil)
- if err != nil {
- panic(err)
+
+ if in.TypeMapping != nil && len(in.TypeMapping) > 0 {
+ localTypeName, err = in.DB.CheckLocalTypeForField(ctx, field.Type, nil)
+ if err != nil {
+ panic(err)
+ }
+ if localTypeName != "" {
+ if typeMapping, ok := in.TypeMapping[strings.ToLower(string(localTypeName))]; ok {
+ localTypeNameStr = typeMapping.Type
+ appendImport = typeMapping.Import
+ }
+ }
}
- var typeMapping = map[gdb.LocalType]string{
- gdb.LocalTypeString: "string",
- gdb.LocalTypeDate: "google.protobuf.Timestamp",
- gdb.LocalTypeDatetime: "google.protobuf.Timestamp",
- gdb.LocalTypeInt: "int32",
- gdb.LocalTypeUint: "uint32",
- gdb.LocalTypeInt64: "int64",
- gdb.LocalTypeUint64: "uint64",
- gdb.LocalTypeIntSlice: "repeated int32",
- gdb.LocalTypeInt64Slice: "repeated int64",
- gdb.LocalTypeUint64Slice: "repeated uint64",
- gdb.LocalTypeInt64Bytes: "repeated int64",
- gdb.LocalTypeUint64Bytes: "repeated uint64",
- gdb.LocalTypeFloat32: "float",
- gdb.LocalTypeFloat64: "double",
- gdb.LocalTypeBytes: "bytes",
- gdb.LocalTypeBool: "bool",
- gdb.LocalTypeJson: "string",
- gdb.LocalTypeJsonb: "string",
- }
- localTypeNameStr := typeMapping[localTypeName]
+
if localTypeNameStr == "" {
localTypeNameStr = "string"
}
@@ -351,12 +470,19 @@ func generateMessageFieldForPbEntity(index int, field *gdb.TableField, in CGenPb
newFiledName = gstr.TrimLeftStr(newFiledName, v, 1)
}
+ if in.FieldMapping != nil && len(in.FieldMapping) > 0 {
+ if typeMapping, ok := in.FieldMapping[fmt.Sprintf("%s.%s", in.TableName, newFiledName)]; ok {
+ localTypeNameStr = typeMapping.Type
+ appendImport = typeMapping.Import
+ }
+ }
+
return []string{
" #" + localTypeNameStr,
" #" + formatCase(newFiledName, in.NameCase),
" #= " + gconv.String(index) + jsonTagStr + ";",
" #" + fmt.Sprintf(`// %s`, comment),
- }
+ }, appendImport
}
func getTplPbEntityContent(tplEntityPath string) string {
diff --git a/cmd/gf/internal/cmd/genservice/genservice.go b/cmd/gf/internal/cmd/genservice/genservice.go
index 5b9ae7efc..e02ed91ea 100644
--- a/cmd/gf/internal/cmd/genservice/genservice.go
+++ b/cmd/gf/internal/cmd/genservice/genservice.go
@@ -114,7 +114,7 @@ func (c CGenService) Service(ctx context.Context, in CGenServiceInput) (out *CGe
return
}
}
- defer gfile.Remove(flockFilePath)
+ defer gfile.RemoveFile(flockFilePath)
_ = gfile.PutContents(flockFilePath, gtime.TimestampStr())
// It works only if given WatchFile is in SrcFolder.
@@ -253,7 +253,7 @@ func (c CGenService) Service(ctx context.Context, in CGenServiceInput) (out *CGe
utils.IsFileDoNotEdit(relativeFilePath) {
mlog.Printf(`remove no longer used service file: %s`, relativeFilePath)
- if err = gfile.Remove(file); err != nil {
+ if err = gfile.RemoveFile(file); err != nil {
return nil, err
}
}
@@ -289,7 +289,7 @@ func (c CGenService) checkAndUpdateMain(srcFolder string) (err error) {
var (
logicPackageName = gstr.ToLower(gfile.Basename(srcFolder))
logicFilePath = gfile.Join(srcFolder, logicPackageName+".go")
- importPath = utils.GetImportPath(logicFilePath)
+ importPath = utils.GetImportPath(srcFolder)
importStr = fmt.Sprintf(`_ "%s"`, importPath)
mainFilePath = gfile.Join(gfile.Dir(gfile.Dir(gfile.Dir(logicFilePath))), "main.go")
mainFileContent = gfile.GetContents(mainFilePath)
diff --git a/cmd/gf/internal/cmd/genservice/genservice_ast_parse.go b/cmd/gf/internal/cmd/genservice/genservice_ast_parse.go
index 6a7785ffa..c4205cc58 100644
--- a/cmd/gf/internal/cmd/genservice/genservice_ast_parse.go
+++ b/cmd/gf/internal/cmd/genservice/genservice_ast_parse.go
@@ -12,6 +12,7 @@ import (
"go/token"
"github.com/gogf/gf/v2/os/gfile"
+ "github.com/gogf/gf/v2/text/gstr"
)
type pkgItem struct {
@@ -78,12 +79,19 @@ func (c CGenService) parseImportPackages(node *ast.ImportSpec) (packages pkgItem
path = node.Path.Value
rawImport string
)
+
if node.Name != nil {
alias = node.Name.Name
- rawImport = alias + " " + path
+ rawImport = node.Name.Name + " " + path
} else {
rawImport = path
}
+
+ // if the alias is empty, it will further retrieve the real alias.
+ if alias == "" {
+ alias = c.getRealAlias(path)
+ }
+
return pkgItem{
Alias: alias,
Path: path,
@@ -91,6 +99,33 @@ func (c CGenService) parseImportPackages(node *ast.ImportSpec) (packages pkgItem
}
}
+// getRealAlias retrieves the real alias of the package.
+// If package is "github.com/gogf/gf", the alias is "gf".
+// If package is "github.com/gogf/gf/v2", the alias is "gf" instead of "v2".
+func (c CGenService) getRealAlias(importPath string) (pkgName string) {
+ importPath = gstr.Trim(importPath, `"`)
+ parts := gstr.Split(importPath, "/")
+ if len(parts) == 0 {
+ return
+ }
+
+ pkgName = parts[len(parts)-1]
+
+ if !gstr.HasPrefix(pkgName, "v") {
+ return pkgName
+ }
+
+ if len(parts) < 2 {
+ return pkgName
+ }
+
+ if gstr.IsNumeric(gstr.SubStr(pkgName, 1)) {
+ pkgName = parts[len(parts)-2]
+ }
+
+ return pkgName
+}
+
// parseFuncReceiverTypeName retrieves the receiver type of the function.
// For example:
//
diff --git a/cmd/gf/internal/cmd/testdata/build/varmap/go.mod b/cmd/gf/internal/cmd/testdata/build/varmap/go.mod
index 745729204..c8c721416 100644
--- a/cmd/gf/internal/cmd/testdata/build/varmap/go.mod
+++ b/cmd/gf/internal/cmd/testdata/build/varmap/go.mod
@@ -2,11 +2,11 @@ module github.com/gogf/gf/cmd/gf/cmd/gf/testdata/vardump/v2
go 1.18
-require github.com/gogf/gf/v2 v2.6.1
+require github.com/gogf/gf/v2 v2.8.1
require (
- go.opentelemetry.io/otel v1.14.0 // indirect
- go.opentelemetry.io/otel/trace v1.14.0 // indirect
+ go.opentelemetry.io/otel v1.24.0 // indirect
+ go.opentelemetry.io/otel/trace v1.24.0 // indirect
)
replace github.com/gogf/gf/v2 => ../../../../../../../
diff --git a/cmd/gf/internal/cmd/testdata/build/varmap/go.sum b/cmd/gf/internal/cmd/testdata/build/varmap/go.sum
index 4e5a51bb8..4f2c0c5da 100644
--- a/cmd/gf/internal/cmd/testdata/build/varmap/go.sum
+++ b/cmd/gf/internal/cmd/testdata/build/varmap/go.sum
@@ -1,27 +1,29 @@
-github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
+github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
github.com/clbanning/mxj/v2 v2.7.0 h1:WA/La7UGCanFe5NpHF0Q3DNtnCsVoxbPKuyBNHWRyME=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
-github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
+github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
-github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0=
+github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
-github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
-github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
+github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
+github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
github.com/grokify/html-strip-tags-go v0.1.0 h1:03UrQLjAny8xci+R+qjCce/MYnpNXCtgzltlQbOBae4=
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
-github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=
+github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U=
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
-github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
-go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM=
-go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU=
-go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY=
-go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M=
-go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8=
-golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
-golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
-golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
+github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
+github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
+golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
+golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
+golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
diff --git a/cmd/gf/internal/cmd/testdata/gendao/generated_user_sqlite3/dao/internal/table_user.go b/cmd/gf/internal/cmd/testdata/gendao/generated_user_sqlite3/dao/internal/table_user.go
new file mode 100644
index 000000000..3c84716f2
--- /dev/null
+++ b/cmd/gf/internal/cmd/testdata/gendao/generated_user_sqlite3/dao/internal/table_user.go
@@ -0,0 +1,83 @@
+// ==========================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// ==========================================================================
+
+package internal
+
+import (
+ "context"
+
+ "github.com/gogf/gf/v2/database/gdb"
+ "github.com/gogf/gf/v2/frame/g"
+)
+
+// TableUserDao is the data access object for table table_user.
+type TableUserDao struct {
+ table string // table is the underlying table name of the DAO.
+ group string // group is the database configuration group name of current DAO.
+ columns TableUserColumns // columns contains all the column names of Table for convenient usage.
+}
+
+// TableUserColumns defines and stores column names for table table_user.
+type TableUserColumns struct {
+ Id string //
+ Passport string //
+ Password string //
+ Nickname string //
+ CreatedAt string //
+ UpdatedAt string //
+}
+
+// tableUserColumns holds the columns for table table_user.
+var tableUserColumns = TableUserColumns{
+ Id: "id",
+ Passport: "passport",
+ Password: "password",
+ Nickname: "nickname",
+ CreatedAt: "created_at",
+ UpdatedAt: "updated_at",
+}
+
+// NewTableUserDao creates and returns a new DAO object for table data access.
+func NewTableUserDao() *TableUserDao {
+ return &TableUserDao{
+ group: "test",
+ table: "table_user",
+ columns: tableUserColumns,
+ }
+}
+
+// DB retrieves and returns the underlying raw database management object of current DAO.
+func (dao *TableUserDao) DB() gdb.DB {
+ return g.DB(dao.group)
+}
+
+// Table returns the table name of current dao.
+func (dao *TableUserDao) Table() string {
+ return dao.table
+}
+
+// Columns returns all column names of current dao.
+func (dao *TableUserDao) Columns() TableUserColumns {
+ return dao.columns
+}
+
+// Group returns the configuration group name of database of current dao.
+func (dao *TableUserDao) Group() string {
+ return dao.group
+}
+
+// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
+func (dao *TableUserDao) Ctx(ctx context.Context) *gdb.Model {
+ return dao.DB().Model(dao.table).Safe().Ctx(ctx)
+}
+
+// Transaction wraps the transaction logic using function f.
+// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
+// It commits the transaction and returns nil if function f returns nil.
+//
+// Note that, you should not Commit or Rollback the transaction in function f
+// as it is automatically handled by this function.
+func (dao *TableUserDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
+ return dao.Ctx(ctx).Transaction(ctx, f)
+}
diff --git a/cmd/gf/internal/cmd/testdata/gendao/generated_user_sqlite3/dao/table_user.go b/cmd/gf/internal/cmd/testdata/gendao/generated_user_sqlite3/dao/table_user.go
new file mode 100644
index 000000000..9bc9cff6f
--- /dev/null
+++ b/cmd/gf/internal/cmd/testdata/gendao/generated_user_sqlite3/dao/table_user.go
@@ -0,0 +1,27 @@
+// =================================================================================
+// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
+// =================================================================================
+
+package dao
+
+import (
+ "for-gendao-test/pkg/dao/internal"
+)
+
+// internalTableUserDao is internal type for wrapping internal DAO implements.
+type internalTableUserDao = *internal.TableUserDao
+
+// tableUserDao is the data access object for table table_user.
+// You can define custom methods on it to extend its functionality as you wish.
+type tableUserDao struct {
+ internalTableUserDao
+}
+
+var (
+ // TableUser is globally public accessible object for table table_user operations.
+ TableUser = tableUserDao{
+ internal.NewTableUserDao(),
+ }
+)
+
+// Fill with you ideas below.
diff --git a/cmd/gf/internal/cmd/testdata/gendao/generated_user_sqlite3/model/do/table_user.go b/cmd/gf/internal/cmd/testdata/gendao/generated_user_sqlite3/model/do/table_user.go
new file mode 100644
index 000000000..75fcb5db1
--- /dev/null
+++ b/cmd/gf/internal/cmd/testdata/gendao/generated_user_sqlite3/model/do/table_user.go
@@ -0,0 +1,21 @@
+// =================================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// =================================================================================
+
+package do
+
+import (
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/os/gtime"
+)
+
+// TableUser is the golang structure of table table_user for DAO operations like Where/Data.
+type TableUser struct {
+ g.Meta `orm:"table:table_user, do:true"`
+ Id interface{} //
+ Passport interface{} //
+ Password interface{} //
+ Nickname interface{} //
+ CreatedAt *gtime.Time //
+ UpdatedAt *gtime.Time //
+}
diff --git a/cmd/gf/internal/cmd/testdata/gendao/generated_user_sqlite3/model/entity/table_user.go b/cmd/gf/internal/cmd/testdata/gendao/generated_user_sqlite3/model/entity/table_user.go
new file mode 100644
index 000000000..67ff1831a
--- /dev/null
+++ b/cmd/gf/internal/cmd/testdata/gendao/generated_user_sqlite3/model/entity/table_user.go
@@ -0,0 +1,19 @@
+// =================================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// =================================================================================
+
+package entity
+
+import (
+ "github.com/gogf/gf/v2/os/gtime"
+)
+
+// TableUser is the golang structure for table table_user.
+type TableUser struct {
+ Id int `json:"id" orm:"id" ` //
+ Passport string `json:"passport" orm:"passport" ` //
+ Password string `json:"password" orm:"password" ` //
+ Nickname string `json:"nickname" orm:"nickname" ` //
+ CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" ` //
+ UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at" ` //
+}
diff --git a/cmd/gf/internal/cmd/testdata/gendao/sqlite3/user.sqlite3.sql b/cmd/gf/internal/cmd/testdata/gendao/sqlite3/user.sqlite3.sql
new file mode 100644
index 000000000..16c602a12
--- /dev/null
+++ b/cmd/gf/internal/cmd/testdata/gendao/sqlite3/user.sqlite3.sql
@@ -0,0 +1,8 @@
+create table `%s`(
+ id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE,
+ passport VARCHAR(45) NOT NULL DEFAULT passport,
+ password VARCHAR(128) NOT NULL DEFAULT password,
+ nickname VARCHAR(45),
+ created_at TIMESTAMP,
+ updated_at TIMESTAMP
+)
\ No newline at end of file
diff --git a/cmd/gf/internal/cmd/testdata/genpbentity/generated/table_user.proto b/cmd/gf/internal/cmd/testdata/genpbentity/generated/table_user.proto
index e5074b491..874a55a05 100644
--- a/cmd/gf/internal/cmd/testdata/genpbentity/generated/table_user.proto
+++ b/cmd/gf/internal/cmd/testdata/genpbentity/generated/table_user.proto
@@ -11,11 +11,11 @@ option go_package = "unittest";
import "google/protobuf/timestamp.proto";
message TableUser {
- uint32 Id = 1; // User ID
- string Passport = 2; // User Passport
- string Password = 3; // User Password
- string Nickname = 4; // User Nickname
- string Score = 5; // Total score amount.
- google.protobuf.Timestamp CreateAt = 6; // Created Time
- google.protobuf.Timestamp UpdateAt = 7; // Updated Time
+ uint32 Id = 1; // User ID
+ string Passport = 2; // User Passport
+ string Password = 3; // User Password
+ string Nickname = 4; // User Nickname
+ string Score = 5; // Total score amount.
+ google.protobuf.Timestamp CreateAt = 6; // Created Time
+ google.protobuf.Timestamp UpdateAt = 7; // Updated Time
}
\ No newline at end of file
diff --git a/cmd/gf/internal/cmd/testdata/genpbentity/generated/table_user_snake_screaming.proto b/cmd/gf/internal/cmd/testdata/genpbentity/generated/table_user_snake_screaming.proto
index 365999ece..9613131da 100644
--- a/cmd/gf/internal/cmd/testdata/genpbentity/generated/table_user_snake_screaming.proto
+++ b/cmd/gf/internal/cmd/testdata/genpbentity/generated/table_user_snake_screaming.proto
@@ -11,11 +11,11 @@ option go_package = "unittest";
import "google/protobuf/timestamp.proto";
message TableUser {
- uint32 ID = 1; // User ID
- string PASSPORT = 2; // User Passport
- string PASSWORD = 3; // User Password
- string NICKNAME = 4; // User Nickname
- string SCORE = 5; // Total score amount.
- google.protobuf.Timestamp CREATE_AT = 6; // Created Time
- google.protobuf.Timestamp UPDATE_AT = 7; // Updated Time
+ uint32 ID = 1; // User ID
+ string PASSPORT = 2; // User Passport
+ string PASSWORD = 3; // User Password
+ string NICKNAME = 4; // User Nickname
+ string SCORE = 5; // Total score amount.
+ google.protobuf.Timestamp CREATE_AT = 6; // Created Time
+ google.protobuf.Timestamp UPDATE_AT = 7; // Updated Time
}
\ No newline at end of file
diff --git a/cmd/gf/internal/cmd/testdata/issue/3328/logic/.gitkeep b/cmd/gf/internal/cmd/testdata/issue/3328/logic/.gitkeep
new file mode 100644
index 000000000..e69de29bb
diff --git a/cmd/gf/internal/cmd/testdata/issue/3545/table_user.proto b/cmd/gf/internal/cmd/testdata/issue/3545/table_user.proto
index 6282f3a61..2b95b4056 100644
--- a/cmd/gf/internal/cmd/testdata/issue/3545/table_user.proto
+++ b/cmd/gf/internal/cmd/testdata/issue/3545/table_user.proto
@@ -11,11 +11,11 @@ option go_package = "github.com/gogf/gf/cmd/gf/v2/internal/cmd/api/pbentity";
import "google/protobuf/timestamp.proto";
message TableUser {
- uint32 Id = 1; // User ID
- string Passport = 2; // User Passport
- string Password = 3; // User Password
- string Nickname = 4; // User Nickname
- string Score = 5; // Total score amount.
- google.protobuf.Timestamp CreateAt = 6; // Created Time
- google.protobuf.Timestamp UpdateAt = 7; // Updated Time
+ uint32 Id = 1; // User ID
+ string Passport = 2; // User Passport
+ string Password = 3; // User Password
+ string Nickname = 4; // User Nickname
+ string Score = 5; // Total score amount.
+ google.protobuf.Timestamp CreateAt = 6; // Created Time
+ google.protobuf.Timestamp UpdateAt = 7; // Updated Time
}
\ No newline at end of file
diff --git a/cmd/gf/internal/cmd/testdata/issue/3685/table_user.proto b/cmd/gf/internal/cmd/testdata/issue/3685/table_user.proto
new file mode 100644
index 000000000..803cfa81f
--- /dev/null
+++ b/cmd/gf/internal/cmd/testdata/issue/3685/table_user.proto
@@ -0,0 +1,23 @@
+// ==========================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// ==========================================================================
+
+syntax = "proto3";
+
+package pbentity;
+
+option go_package = "github.com/gogf/gf/cmd/gf/v2/internal/cmd/api/pbentity";
+
+import "google/protobuf/struct.proto";
+import "google/protobuf/timestamp.proto";
+
+message TableUser {
+ uint32 Id = 1; // User ID
+ string Passport = 2; // User Passport
+ string Password = 3; // User Password
+ string Nickname = 4; // User Nickname
+ string Score = 5; // Total score amount.
+ google.protobuf.Value Data = 6; // User Data
+ google.protobuf.Timestamp CreateAt = 7; // Created Time
+ google.protobuf.Timestamp UpdateAt = 8; // Updated Time
+}
\ No newline at end of file
diff --git a/cmd/gf/internal/cmd/testdata/issue/3685/user.tpl.sql b/cmd/gf/internal/cmd/testdata/issue/3685/user.tpl.sql
new file mode 100644
index 000000000..87493a6f8
--- /dev/null
+++ b/cmd/gf/internal/cmd/testdata/issue/3685/user.tpl.sql
@@ -0,0 +1,11 @@
+CREATE TABLE `%s` (
+ `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'User ID',
+ `passport` varchar(45) NOT NULL COMMENT 'User Passport',
+ `password` varchar(45) NOT NULL COMMENT 'User Password',
+ `nickname` varchar(45) NOT NULL COMMENT 'User Nickname',
+ `score` decimal(10,2) unsigned DEFAULT NULL COMMENT 'Total score amount.',
+ `data` json DEFAULT NULL COMMENT 'User Data',
+ `create_at` datetime DEFAULT NULL COMMENT 'Created Time',
+ `update_at` datetime DEFAULT NULL COMMENT 'Updated Time',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
\ No newline at end of file
diff --git a/cmd/gf/internal/cmd/testdata/issue/3749/dao/internal/table_user.go b/cmd/gf/internal/cmd/testdata/issue/3749/dao/internal/table_user.go
new file mode 100644
index 000000000..871b7d657
--- /dev/null
+++ b/cmd/gf/internal/cmd/testdata/issue/3749/dao/internal/table_user.go
@@ -0,0 +1,85 @@
+// ==========================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// ==========================================================================
+
+package internal
+
+import (
+ "context"
+
+ "github.com/gogf/gf/v2/database/gdb"
+ "github.com/gogf/gf/v2/frame/g"
+)
+
+// TableUserDao is the data access object for table table_user.
+type TableUserDao struct {
+ table string // table is the underlying table name of the DAO.
+ group string // group is the database configuration group name of current DAO.
+ columns TableUserColumns // columns contains all the column names of Table for convenient usage.
+}
+
+// TableUserColumns defines and stores column names for table table_user.
+type TableUserColumns struct {
+ Id string // User ID
+ ParentId string //
+ Passport string // User Passport
+ PassWord string // User Password
+ Nickname2 string // User Nickname
+ CreateAt string // Created Time
+ UpdateAt string // Updated Time
+}
+
+// tableUserColumns holds the columns for table table_user.
+var tableUserColumns = TableUserColumns{
+ Id: "Id",
+ ParentId: "parentId",
+ Passport: "PASSPORT",
+ PassWord: "PASS_WORD",
+ Nickname2: "NICKNAME2",
+ CreateAt: "create_at",
+ UpdateAt: "update_at",
+}
+
+// NewTableUserDao creates and returns a new DAO object for table data access.
+func NewTableUserDao() *TableUserDao {
+ return &TableUserDao{
+ group: "test",
+ table: "table_user",
+ columns: tableUserColumns,
+ }
+}
+
+// DB retrieves and returns the underlying raw database management object of current DAO.
+func (dao *TableUserDao) DB() gdb.DB {
+ return g.DB(dao.group)
+}
+
+// Table returns the table name of current dao.
+func (dao *TableUserDao) Table() string {
+ return dao.table
+}
+
+// Columns returns all column names of current dao.
+func (dao *TableUserDao) Columns() TableUserColumns {
+ return dao.columns
+}
+
+// Group returns the configuration group name of database of current dao.
+func (dao *TableUserDao) Group() string {
+ return dao.group
+}
+
+// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
+func (dao *TableUserDao) Ctx(ctx context.Context) *gdb.Model {
+ return dao.DB().Model(dao.table).Safe().Ctx(ctx)
+}
+
+// Transaction wraps the transaction logic using function f.
+// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
+// It commits the transaction and returns nil if function f returns nil.
+//
+// Note that, you should not Commit or Rollback the transaction in function f
+// as it is automatically handled by this function.
+func (dao *TableUserDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
+ return dao.Ctx(ctx).Transaction(ctx, f)
+}
diff --git a/cmd/gf/internal/cmd/testdata/issue/3749/dao/table_user.go b/cmd/gf/internal/cmd/testdata/issue/3749/dao/table_user.go
new file mode 100644
index 000000000..9bc9cff6f
--- /dev/null
+++ b/cmd/gf/internal/cmd/testdata/issue/3749/dao/table_user.go
@@ -0,0 +1,27 @@
+// =================================================================================
+// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
+// =================================================================================
+
+package dao
+
+import (
+ "for-gendao-test/pkg/dao/internal"
+)
+
+// internalTableUserDao is internal type for wrapping internal DAO implements.
+type internalTableUserDao = *internal.TableUserDao
+
+// tableUserDao is the data access object for table table_user.
+// You can define custom methods on it to extend its functionality as you wish.
+type tableUserDao struct {
+ internalTableUserDao
+}
+
+var (
+ // TableUser is globally public accessible object for table table_user operations.
+ TableUser = tableUserDao{
+ internal.NewTableUserDao(),
+ }
+)
+
+// Fill with you ideas below.
diff --git a/cmd/gf/internal/cmd/testdata/issue/3749/model/do/table_user.go b/cmd/gf/internal/cmd/testdata/issue/3749/model/do/table_user.go
new file mode 100644
index 000000000..6fe512a44
--- /dev/null
+++ b/cmd/gf/internal/cmd/testdata/issue/3749/model/do/table_user.go
@@ -0,0 +1,22 @@
+// =================================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// =================================================================================
+
+package do
+
+import (
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/os/gtime"
+)
+
+// TableUser is the golang structure of table table_user for DAO operations like Where/Data.
+type TableUser struct {
+ g.Meta `orm:"table:table_user, do:true"`
+ Id interface{} // User ID
+ ParentId interface{} //
+ Passport interface{} // User Passport
+ PassWord interface{} // User Password
+ Nickname2 interface{} // User Nickname
+ CreateAt *gtime.Time // Created Time
+ UpdateAt *gtime.Time // Updated Time
+}
diff --git a/cmd/gf/internal/cmd/testdata/issue/3749/model/entity/table_user.go b/cmd/gf/internal/cmd/testdata/issue/3749/model/entity/table_user.go
new file mode 100644
index 000000000..effe0ce2c
--- /dev/null
+++ b/cmd/gf/internal/cmd/testdata/issue/3749/model/entity/table_user.go
@@ -0,0 +1,20 @@
+// =================================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// =================================================================================
+
+package entity
+
+import (
+ "github.com/gogf/gf/v2/os/gtime"
+)
+
+// TableUser is the golang structure for table table_user.
+type TableUser struct {
+ Id uint `json:"id" orm:"Id" ` // User ID
+ ParentId string `json:"parentId" orm:"parentId" ` //
+ Passport string `json:"pASSPORT" orm:"PASSPORT" ` // User Passport
+ PassWord string `json:"pASSWORD" orm:"PASS_WORD" ` // User Password
+ Nickname2 string `json:"nICKNAME2" orm:"NICKNAME2" ` // User Nickname
+ CreateAt *gtime.Time `json:"createAt" orm:"create_at" ` // Created Time
+ UpdateAt *gtime.Time `json:"updateAt" orm:"update_at" ` // Updated Time
+}
diff --git a/cmd/gf/internal/cmd/testdata/issue/3749/user.tpl.sql b/cmd/gf/internal/cmd/testdata/issue/3749/user.tpl.sql
new file mode 100644
index 000000000..59896315c
--- /dev/null
+++ b/cmd/gf/internal/cmd/testdata/issue/3749/user.tpl.sql
@@ -0,0 +1,10 @@
+CREATE TABLE `%s` (
+ `Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'User ID',
+ `parentId` varchar(45) NOT NULL COMMENT '',
+ `PASSPORT` varchar(45) NOT NULL COMMENT 'User Passport',
+ `PASS_WORD` varchar(45) NOT NULL COMMENT 'User Password',
+ `NICKNAME2` varchar(45) NOT NULL COMMENT 'User Nickname',
+ `create_at` datetime DEFAULT NULL COMMENT 'Created Time',
+ `update_at` datetime DEFAULT NULL COMMENT 'Updated Time',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
diff --git a/cmd/gf/internal/cmd/testdata/issue/3835/logic/issue3835/issue3835.go b/cmd/gf/internal/cmd/testdata/issue/3835/logic/issue3835/issue3835.go
new file mode 100644
index 000000000..888b5a994
--- /dev/null
+++ b/cmd/gf/internal/cmd/testdata/issue/3835/logic/issue3835/issue3835.go
@@ -0,0 +1,23 @@
+package issue3835
+
+import (
+ "context"
+
+ "github.com/gogf/gf/cmd/gf/v2/internal/cmd/testdata/issue/3835/service"
+ "github.com/gogf/gf/contrib/drivers/mysql/v2"
+)
+
+func init() {
+ service.RegisterItest(New())
+}
+
+type sItest struct {
+}
+
+func New() *sItest {
+ return &sItest{}
+}
+
+func (s *sItest) F(ctx context.Context) (d mysql.Driver, err error) {
+ return mysql.Driver{}, nil
+}
diff --git a/cmd/gf/internal/cmd/testdata/issue/3835/logic/logic.go b/cmd/gf/internal/cmd/testdata/issue/3835/logic/logic.go
new file mode 100644
index 000000000..acb117df3
--- /dev/null
+++ b/cmd/gf/internal/cmd/testdata/issue/3835/logic/logic.go
@@ -0,0 +1,9 @@
+// ==========================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// ==========================================================================
+
+package logic
+
+import (
+ _ "github.com/gogf/gf/cmd/gf/v2/internal/cmd/testdata/issue/3835/logic/issue3835"
+)
diff --git a/cmd/gf/internal/cmd/testdata/issue/3835/service/issue_3835.go b/cmd/gf/internal/cmd/testdata/issue/3835/service/issue_3835.go
new file mode 100644
index 000000000..7ae835570
--- /dev/null
+++ b/cmd/gf/internal/cmd/testdata/issue/3835/service/issue_3835.go
@@ -0,0 +1,33 @@
+// ================================================================================
+// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
+// You can delete these comments if you wish manually maintain this interface file.
+// ================================================================================
+
+package service
+
+import (
+ "context"
+
+ "github.com/gogf/gf/contrib/drivers/mysql/v2"
+)
+
+type (
+ IItest interface {
+ F(ctx context.Context) (d mysql.Driver, err error)
+ }
+)
+
+var (
+ localItest IItest
+)
+
+func Itest() IItest {
+ if localItest == nil {
+ panic("implement not found for interface IItest, forgot register?")
+ }
+ return localItest
+}
+
+func RegisterItest(i IItest) {
+ localItest = i
+}
diff --git a/cmd/gf/internal/cmd/testdata/issue/3882/issue3882.proto b/cmd/gf/internal/cmd/testdata/issue/3882/issue3882.proto
new file mode 100644
index 000000000..b37d037e6
--- /dev/null
+++ b/cmd/gf/internal/cmd/testdata/issue/3882/issue3882.proto
@@ -0,0 +1,10 @@
+syntax = "proto3";
+
+package test;
+
+option go_package = "github.com/gogf/gf/cmd/gf/test";
+
+message SomeMessage {
+ // Some comment on field with "one" `two` 'three' in the comment.
+ string field = 1;
+}
\ No newline at end of file
diff --git a/cmd/gf/internal/packed/template-mono-app.go b/cmd/gf/internal/packed/template-mono-app.go
index 3df41147c..46fb81ca9 100644
--- a/cmd/gf/internal/packed/template-mono-app.go
+++ b/cmd/gf/internal/packed/template-mono-app.go
@@ -3,7 +3,7 @@ package packed
import "github.com/gogf/gf/v2/os/gres"
func init() {
- if err := gres.Add("H4sIAAAAAAAC/7RaCTjU2xs+tuxLsiQi+24oWcq1VmTsImRJjDEZM5hB6lKKtMh+leWmREjI0iZZs4a4KloIlWQpRZH1/3Tv5T8/y5gZXc/TzKOe3vf9vu+c8/vO73vN4DS0XIABMIBB5jwbQPCzCTACPMLTC+2MR8h7YjFYeWcvL5ixswfCDYVGWO2jA1SHOXa5MX0dZz/r/4XFwszM7JaVWatUs0FTvbmUlGnru6+4MV9WNi+8Hx1cOj3tunh8X5yU9/176yYm9GtOpen0imfdp1M/K55VXJ0Q8FE9y9BeYba5K1fn3vv7W0djcIaWFtxjY9s4YwsrQhwxKlsAmJszg9MzHM2SveYJADgHAFhZPf+y6i126+wy3q1gvGtBPtfjfKZKbRbQMlMq0o2O1LvI8yinN/Mbve4FpQ4V4QuTU+/v3C3ZbF/kn8woqPwqRKclu2oLsylesi0O48SnpUh7FB/1fSTi1u3HCd+sXK41v4hCNWldPW51yuWMwoeBwdF9huqCL/2Y57WbDIgZHQYAeBBoB0u0cy+r3dkLtaD6Jxbh/1gZi38lLJg7Ao3Groq4NLNixBH/+VRA/h+6KML48KA2R0j7gCWX3V52LdYd2tY+QbTCpw8WYOHDXzhQdoK+4cZ1naf+kPM5kXZVekLqRoP66+nv0Tj3It4jZ2M60uhrBUXD3AVSxzocvPL8z+rrjHZU7gtjGmS9rHLgde4rT7rJWGdl7/EGR68oZ7NURZNEFjpEQEbrO7Q6Iu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w+VrsAPaDJ+zGUgdUesgTDEzcsw1/NBeb/ktxpQ5rCgdFU8Iwv4u8MCGjipUUABErjIGkCjw4Jy7S5rAVUGBEqbj/uU4M5rQFiYQQnCICwAlmJAgBaBdMS+BVKEMBpoFpy6zaUlnXxvhdDmCII/Os2fy0w6hIa2PjFC4A/N2cnVUgVSywPCYKnD7oWpNCFUH2mkmmfYDc0o6UDXEJJRBxHwnwy75yogHawaQRSEioL/Zow8VwLpLNMUIuGAGPjP5rmUb3fR4oCqKSo0OtJpIrSB6qYEd74p6lwK0lkg6Yt24NCndYCmISW55IhAkhMjAaiYMC7cIEhDUtO1OOpSmmJ9GKByuLiwcFWI8EuUIZMbLlLelPBJAsrmipSudFeygL/PFRfGlYTgPqAEd+5cceGUw6EXb1KA5rkiuRCkISEcpYjlt5HiwkEoQxc8FfDUhSELCcNCGtA2TVyYQBFCkE8VwZxp4sLZUoNka7UMWPI0kfKmMZI6trmDxIWD0oAE9YUGGurCUoCEhZYFNM8QKd0OK6nlWMquriUHqBwfUnrVEU8ZMnXi10DEz8xL8fvkcGHJ0HGEqTygZnJITig3idAZnez5gElwGBj/9moaApggAN/lf/72vwAAAP//E9IPLjBJAAA="); err != nil {
panic("add binary content to resource manager failed: " + err.Error())
}
}
diff --git a/cmd/gf/internal/packed/template-mono.go b/cmd/gf/internal/packed/template-mono.go
index 67c325d75..97f98f20c 100644
--- a/cmd/gf/internal/packed/template-mono.go
+++ b/cmd/gf/internal/packed/template-mono.go
@@ -3,7 +3,7 @@ package packed
import "github.com/gogf/gf/v2/os/gres"
func init() {
- if err := gres.Add("H4sIAAAAAAAC/+y9BVRW29Y+vinpRlApSekO6VY6BQUBpbsbBJEQpUsBAUmREBCVEASlu1FUJAQRJSSk8z/uuVcPL8LrW57/7/vud8Y4MHQ45rOeudbee+05n70edSUUVBIAA8AATtgdvwjs+48CwARczewcbY1czdjtHOwdODksrFyNXF2drYzdXM1ctC+gAUhGVhOmfZotrR1KnJ1sHL2dCh1KnCrKa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wKImgoLzsA/LHW4FJLCJJafQ8A/CGKoGM6fI4fFciYsn4a6KeHKH4f9PBBZadAgrLfBCA5EBAcXRIQuulewC9POzt63YAynj8qFnQ3puOHBnggIecNHHnQGRr6H/+qBCgB+pQAINj7jz/9fwEAAP//W5J0EHvNAAA="); err != nil {
panic("add binary content to resource manager failed: " + err.Error())
}
}
diff --git a/cmd/gf/internal/packed/template-single.go b/cmd/gf/internal/packed/template-single.go
index 37510b84f..c95abb834 100644
--- a/cmd/gf/internal/packed/template-single.go
+++ b/cmd/gf/internal/packed/template-single.go
@@ -3,7 +3,7 @@ package packed
import "github.com/gogf/gf/v2/os/gres"
func init() {
- if err := gres.Add("H4sIAAAAAAAC/7SbBVRVy/fHD51SkhJKd0qDpEi3lBISl0vnBcRAKZFOQULpFpBUUQHpDkFAukFaQDr+6/3fkx9Xad9jLbkLxc/+7j1z5uyZvUdJFg4eF0AGkAF8SzwN4MAXGYACQECWNhb6EBCzvakV2ALEygI2hehDIHamBg4QkL3aTQQARtt01OizSm1doyxrExNLW5N0oyyrvJxiocMaEjwA7O0pySIhtyux85MAAIAPAMDRBi8dYdAUbGVtB9o3xukni+HOhn59zR4Xf5X6HhyGEgLbJzzvxMpvk6t4rVYDUtZJkqpdD+k/8bTicxlnis2piST3iBsjaX152vCNwlVUvo+rpjoOHG2JXZ0UyY4u9+a7ULGaqHaw28RFKmtXB9Z+InojnWS+PU9ZBoJvFz+7FAR0WDh/WY9e3kD86c+M7Ez5IwAAso71h/AQf+T1zUHGphb/8wZ1aQ3T2+k7uoqSktJrNaU2umappjplOjrFtrEl+xWHCxg2EEcEWfrkpBTq8IkwOtt3bxHX1yWr3ZNER6jT3yHweVOnF1dFOn/jS5fRZtltHsgWfTv+jmM5xF5GVQVvZeUqTmj+Jw9dK+4rP7XfS2dMtAQAwOdY7USHaFeREL0uL8Eif31fPG5DLmq5CDrQulNCMWQRKB6BX5k1kvYDScyfvZub3H9za7zozQdS7QKnGBQyzl4P0dbMiitoihDa9j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EYHqeTB1dwd0/1BzIIS655Dooy0TZgT5l88DR29+7u8ABMGBZ4eGH80FFgQXsHmA4/Q998ezI+DNj4Df1ffcP04XEOLUeEQTR4sWYgkofAE4fstzf4f4EBx6cWQjR3OJDcElMl7gmN3Ow970nI9m4W/u22PITO3R6DzspoQoH3CcRicy4eQIwpP2MPBnj3N/uYjtgKX9aUcTib9D5LaYEj+ApL2JjvHz9xQBRaCZCgAe8v/86f8CAAD//w4CtDV7VQAA"); err != nil {
panic("add binary content to resource manager failed: " + err.Error())
}
}
diff --git a/cmd/gf/internal/utility/utils/utils.go b/cmd/gf/internal/utility/utils/utils.go
index 66625079a..94047db19 100644
--- a/cmd/gf/internal/utility/utils/utils.go
+++ b/cmd/gf/internal/utility/utils/utils.go
@@ -75,28 +75,24 @@ func ReplaceGeneratedContentGFV2(folderPath string) (err error) {
}, folderPath, "*.go", true)
}
-// GetImportPath calculates and returns the golang import path for given `filePath`.
+// GetImportPath calculates and returns the golang import path for given `dirPath`.
// Note that it needs a `go.mod` in current working directory or parent directories to detect the path.
-func GetImportPath(filePath string) string {
+func GetImportPath(dirPath string) string {
// If `filePath` does not exist, create it firstly to find the import path.
- var realPath = gfile.RealPath(filePath)
+ var realPath = gfile.RealPath(dirPath)
if realPath == "" {
- _ = gfile.Mkdir(filePath)
- realPath = gfile.RealPath(filePath)
+ _ = gfile.Mkdir(dirPath)
+ realPath = gfile.RealPath(dirPath)
}
var (
newDir = gfile.Dir(realPath)
oldDir string
- suffix string
+ suffix = gfile.Basename(dirPath)
goModName = "go.mod"
goModPath string
importPath string
)
-
- if gfile.IsDir(filePath) {
- suffix = gfile.Basename(filePath)
- }
for {
goModPath = gfile.Join(newDir, goModName)
if gfile.Exists(goModPath) {
diff --git a/container/glist/glist_z_unit_test.go b/container/glist/glist_z_unit_test.go
index 36984790f..d530f0973 100644
--- a/container/glist/glist_z_unit_test.go
+++ b/container/glist/glist_z_unit_test.go
@@ -291,7 +291,7 @@ func TestRemove(t *testing.T) {
})
}
-func TestIssue4103(t *testing.T) {
+func Test_Issue4103(t *testing.T) {
l1 := New()
l1.PushBack(1)
l1.PushBack(2)
@@ -312,7 +312,7 @@ func TestIssue4103(t *testing.T) {
}
}
-func TestIssue6349(t *testing.T) {
+func Test_Issue6349(t *testing.T) {
l := New()
l.PushBack(1)
l.PushBack(2)
diff --git a/container/gtree/gtree.go b/container/gtree/gtree.go
index 284ffbd4f..185c7c020 100644
--- a/container/gtree/gtree.go
+++ b/container/gtree/gtree.go
@@ -13,66 +13,77 @@ import "github.com/gogf/gf/v2/container/gvar"
// iTree defines the interface for basic operations of a tree.
type iTree interface {
- // Set inserts node into the tree.
+ // Set sets key-value pair into the tree.
Set(key interface{}, value interface{})
// Sets batch sets key-values to the tree.
Sets(data map[interface{}]interface{})
// SetIfNotExist sets `value` to the map if the `key` does not exist, and then returns true.
- // It returns false if `key` exists, and `value` would be ignored.
+ // It returns false if `key` exists, and such setting key-value pair operation would be ignored.
SetIfNotExist(key interface{}, value interface{}) bool
// SetIfNotExistFunc sets value with return value of callback function `f`, and then returns true.
- // It returns false if `key` exists, and `value` would be ignored.
+ // It returns false if `key` exists, and such setting key-value pair operation would be ignored.
SetIfNotExistFunc(key interface{}, f func() interface{}) bool
// SetIfNotExistFuncLock sets value with return value of callback function `f`, and then returns true.
- // It returns false if `key` exists, and `value` would be ignored.
+ // It returns false if `key` exists, and such setting key-value pair operation would be ignored.
+ //
// SetIfNotExistFuncLock differs with SetIfNotExistFunc function is that
- // it executes function `f` with mutex.Lock of the hash map.
+ // it executes function `f` within mutex.Lock of the hash map.
SetIfNotExistFuncLock(key interface{}, f func() interface{}) bool
- // Get searches the node in the tree by `key` and returns its value or nil if key is not found in tree.
+ // Get searches the `key` in the tree and returns its associated `value` or nil if key is not found in tree.
+ //
+ // Note that, the `nil` value from Get function cannot be used to determine key existence, please use Contains
+ // function to do so.
Get(key interface{}) (value interface{})
- // GetOrSet returns the value by key,
- // or sets value with given `value` if it does not exist and then returns this value.
+ // GetOrSet returns its `value` of `key`, or sets value with given `value` if it does not exist and then returns
+ // this value.
GetOrSet(key interface{}, value interface{}) interface{}
- // GetOrSetFunc returns the value by key,
- // or sets value with returned value of callback function `f` if it does not exist
- // and then returns this value.
+ // GetOrSetFunc returns its `value` of `key`, or sets value with returned value of callback function `f` if it does
+ // not exist and then returns this value.
GetOrSetFunc(key interface{}, f func() interface{}) interface{}
- // GetOrSetFuncLock returns the value by key,
- // or sets value with returned value of callback function `f` if it does not exist
- // and then returns this value.
- // GetOrSetFuncLock differs with GetOrSetFunc function is that it executes function `f`
- // with mutex.Lock of the hash map.
+ // GetOrSetFuncLock returns its `value` of `key`, or sets value with returned value of callback function `f` if it
+ // does not exist and then returns this value.
+ //
+ // GetOrSetFuncLock differs with GetOrSetFunc function is that it executes function `f` within mutex.Lock of the
+ // hash map.
GetOrSetFuncLock(key interface{}, f func() interface{}) interface{}
// GetVar returns a gvar.Var with the value by given `key`.
- // The returned gvar.Var is un-concurrent safe.
+ // Note that, the returned gvar.Var is un-concurrent safe.
+ //
+ // Also see function Get.
GetVar(key interface{}) *gvar.Var
// GetVarOrSet returns a gvar.Var with result from GetVarOrSet.
- // The returned gvar.Var is un-concurrent safe.
+ // Note that, the returned gvar.Var is un-concurrent safe.
+ //
+ // Also see function GetOrSet.
GetVarOrSet(key interface{}, value interface{}) *gvar.Var
// GetVarOrSetFunc returns a gvar.Var with result from GetOrSetFunc.
- // The returned gvar.Var is un-concurrent safe.
+ // Note that, the returned gvar.Var is un-concurrent safe.
+ //
+ // Also see function GetOrSetFunc.
GetVarOrSetFunc(key interface{}, f func() interface{}) *gvar.Var
// GetVarOrSetFuncLock returns a gvar.Var with result from GetOrSetFuncLock.
- // The returned gvar.Var is un-concurrent safe.
+ // Note that, the returned gvar.Var is un-concurrent safe.
+ //
+ // Also see function GetOrSetFuncLock.
GetVarOrSetFuncLock(key interface{}, f func() interface{}) *gvar.Var
// Search searches the tree with given `key`.
// Second return parameter `found` is true if key was found, otherwise false.
Search(key interface{}) (value interface{}, found bool)
- // Contains checks whether `key` exists in the tree.
+ // Contains checks and returns whether given `key` exists in the tree.
Contains(key interface{}) bool
// Size returns number of nodes in the tree.
@@ -81,23 +92,23 @@ type iTree interface {
// IsEmpty returns true if tree does not contain any nodes.
IsEmpty() bool
- // Remove removes the node from the tree by key.
- // Key should adhere to the comparator's type assertion, otherwise method panics.
+ // Remove removes the node from the tree by `key`, and returns its associated value of `key`.
+ // The given `key` should adhere to the comparator's type assertion, otherwise method panics.
Remove(key interface{}) (value interface{})
- // Removes batch deletes values of the tree by `keys`.
+ // Removes batch deletes key-value pairs from the tree by `keys`.
Removes(keys []interface{})
// Clear removes all nodes from the tree.
Clear()
- // Keys returns all keys in asc order.
+ // Keys returns all keys from the tree in order by its comparator.
Keys() []interface{}
- // Values returns all values in asc order based on the key.
+ // Values returns all values from the true in order by its comparator based on the key.
Values() []interface{}
- // Replace the data of the tree with given `data`.
+ // Replace clears the data of the tree and sets the nodes by given `data`.
Replace(data map[interface{}]interface{})
// Print prints the tree to stdout.
@@ -109,32 +120,66 @@ type iTree interface {
// MarshalJSON implements the interface MarshalJSON for json.Marshal.
MarshalJSON() (jsonBytes []byte, err error)
+ // Map returns all key-value pairs as map.
Map() map[interface{}]interface{}
+
+ // MapStrAny returns all key-value items as map[string]any.
MapStrAny() map[string]interface{}
// Iterator is alias of IteratorAsc.
+ //
+ // Also see IteratorAsc.
Iterator(f func(key, value interface{}) bool)
// IteratorFrom is alias of IteratorAscFrom.
+ //
+ // Also see IteratorAscFrom.
IteratorFrom(key interface{}, match bool, f func(key, value interface{}) bool)
// IteratorAsc iterates the tree readonly in ascending order with given callback function `f`.
- // If `f` returns true, then it continues iterating; or false to stop.
+ // If callback function `f` returns true, then it continues iterating; or false to stop.
IteratorAsc(f func(key, value interface{}) bool)
// IteratorAscFrom iterates the tree readonly in ascending order with given callback function `f`.
- // The parameter `key` specifies the start entry for iterating. The `match` specifies whether
- // starting iterating if the `key` is fully matched, or else using index searching iterating.
- // If `f` returns true, then it continues iterating; or false to stop.
+ //
+ // The parameter `key` specifies the start entry for iterating.
+ // The parameter `match` specifies whether starting iterating only if the `key` is fully matched, or else using
+ // index searching iterating.
+ // If callback function `f` returns true, then it continues iterating; or false to stop.
IteratorAscFrom(key interface{}, match bool, f func(key, value interface{}) bool)
// IteratorDesc iterates the tree readonly in descending order with given callback function `f`.
- // If `f` returns true, then it continues iterating; or false to stop.
+ //
+ // If callback function `f` returns true, then it continues iterating; or false to stop.
IteratorDesc(f func(key, value interface{}) bool)
// IteratorDescFrom iterates the tree readonly in descending order with given callback function `f`.
- // The parameter `key` specifies the start entry for iterating. The `match` specifies whether
- // starting iterating if the `key` is fully matched, or else using index searching iterating.
- // If `f` returns true, then it continues iterating; or false to stop.
+ //
+ // The parameter `key` specifies the start entry for iterating.
+ // The parameter `match` specifies whether starting iterating only if the `key` is fully matched, or else using
+ // index searching iterating.
+ // If callback function `f` returns true, then it continues iterating; or false to stop.
IteratorDescFrom(key interface{}, match bool, f func(key, value interface{}) bool)
}
+
+// iteratorFromGetIndex returns the index of the key in the keys slice.
+//
+// The parameter `match` specifies whether starting iterating only if the `key` is fully matched,
+// or else using index searching iterating.
+// If `isIterator` is true, iterator is available; or else not.
+func iteratorFromGetIndex(key any, keys []any, match bool) (index int, canIterator bool) {
+ if match {
+ for i, k := range keys {
+ if k == key {
+ canIterator = true
+ index = i
+ }
+ }
+ } else {
+ if i, ok := key.(int); ok {
+ canIterator = true
+ index = i
+ }
+ }
+ return
+}
diff --git a/container/gtree/gtree_avltree.go b/container/gtree/gtree_avltree.go
index 49c359369..ac8a51a86 100644
--- a/container/gtree/gtree_avltree.go
+++ b/container/gtree/gtree_avltree.go
@@ -22,20 +22,21 @@ var _ iTree = (*AVLTree)(nil)
type AVLTree struct {
mu rwmutex.RWMutex
root *AVLTreeNode
- comparator func(v1, v2 interface{}) int
+ comparator func(v1, v2 any) int
tree *avltree.Tree
}
// AVLTreeNode is a single element within the tree.
type AVLTreeNode struct {
- Key interface{}
- Value interface{}
+ Key any
+ Value any
}
// NewAVLTree instantiates an AVL tree with the custom key comparator.
+//
// The parameter `safe` is used to specify whether using tree in concurrent-safety,
// which is false in default.
-func NewAVLTree(comparator func(v1, v2 interface{}) int, safe ...bool) *AVLTree {
+func NewAVLTree(comparator func(v1, v2 any) int, safe ...bool) *AVLTree {
return &AVLTree{
mu: rwmutex.Create(safe...),
comparator: comparator,
@@ -44,9 +45,9 @@ func NewAVLTree(comparator func(v1, v2 interface{}) int, safe ...bool) *AVLTree
}
// NewAVLTreeFrom instantiates an AVL tree with the custom key comparator and data map.
-// The parameter `safe` is used to specify whether using tree in concurrent-safety,
-// which is false in default.
-func NewAVLTreeFrom(comparator func(v1, v2 interface{}) int, data map[interface{}]interface{}, safe ...bool) *AVLTree {
+//
+// The parameter `safe` is used to specify whether using tree in concurrent-safety, which is false in default.
+func NewAVLTreeFrom(comparator func(v1, v2 any) int, data map[any]any, safe ...bool) *AVLTree {
tree := NewAVLTree(comparator, safe...)
for k, v := range data {
tree.doSet(k, v)
@@ -54,22 +55,22 @@ func NewAVLTreeFrom(comparator func(v1, v2 interface{}) int, data map[interface{
return tree
}
-// Clone returns a new tree with a copy of current tree.
+// Clone clones and returns a new tree from current tree.
func (tree *AVLTree) Clone() *AVLTree {
newTree := NewAVLTree(tree.comparator, tree.mu.IsSafe())
newTree.Sets(tree.Map())
return newTree
}
-// Set inserts node into the tree.
-func (tree *AVLTree) Set(key interface{}, value interface{}) {
+// Set sets key-value pair into the tree.
+func (tree *AVLTree) Set(key any, value any) {
tree.mu.Lock()
defer tree.mu.Unlock()
tree.doSet(key, value)
}
// Sets batch sets key-values to the tree.
-func (tree *AVLTree) Sets(data map[interface{}]interface{}) {
+func (tree *AVLTree) Sets(data map[any]any) {
tree.mu.Lock()
defer tree.mu.Unlock()
for key, value := range data {
@@ -78,8 +79,8 @@ func (tree *AVLTree) Sets(data map[interface{}]interface{}) {
}
// SetIfNotExist sets `value` to the map if the `key` does not exist, and then returns true.
-// It returns false if `key` exists, and `value` would be ignored.
-func (tree *AVLTree) SetIfNotExist(key interface{}, value interface{}) bool {
+// It returns false if `key` exists, and such setting key-value pair operation would be ignored.
+func (tree *AVLTree) SetIfNotExist(key any, value any) bool {
tree.mu.Lock()
defer tree.mu.Unlock()
if _, ok := tree.doGet(key); !ok {
@@ -90,8 +91,8 @@ func (tree *AVLTree) SetIfNotExist(key interface{}, value interface{}) bool {
}
// SetIfNotExistFunc sets value with return value of callback function `f`, and then returns true.
-// It returns false if `key` exists, and `value` would be ignored.
-func (tree *AVLTree) SetIfNotExistFunc(key interface{}, f func() interface{}) bool {
+// It returns false if `key` exists, and such setting key-value pair operation would be ignored.
+func (tree *AVLTree) SetIfNotExistFunc(key any, f func() any) bool {
tree.mu.Lock()
defer tree.mu.Unlock()
if _, ok := tree.doGet(key); !ok {
@@ -102,11 +103,11 @@ func (tree *AVLTree) SetIfNotExistFunc(key interface{}, f func() interface{}) bo
}
// SetIfNotExistFuncLock sets value with return value of callback function `f`, and then returns true.
-// It returns false if `key` exists, and `value` would be ignored.
+// It returns false if `key` exists, and such setting key-value pair operation would be ignored.
//
// SetIfNotExistFuncLock differs with SetIfNotExistFunc function is that
-// it executes function `f` with mutex.Lock of the hash map.
-func (tree *AVLTree) SetIfNotExistFuncLock(key interface{}, f func() interface{}) bool {
+// it executes function `f` within mutex lock.
+func (tree *AVLTree) SetIfNotExistFuncLock(key any, f func() any) bool {
tree.mu.Lock()
defer tree.mu.Unlock()
if _, ok := tree.doGet(key); !ok {
@@ -116,15 +117,18 @@ func (tree *AVLTree) SetIfNotExistFuncLock(key interface{}, f func() interface{}
return false
}
-// Get searches the node in the tree by `key` and returns its value or nil if key is not found in tree.
-func (tree *AVLTree) Get(key interface{}) (value interface{}) {
+// Get searches the `key` in the tree and returns its associated `value` or nil if key is not found in tree.
+//
+// Note that, the `nil` value from Get function cannot be used to determine key existence, please use Contains function
+// to do so.
+func (tree *AVLTree) Get(key any) (value any) {
value, _ = tree.Search(key)
return
}
-// GetOrSet returns the value by key,
-// or sets value with given `value` if it does not exist and then returns this value.
-func (tree *AVLTree) GetOrSet(key interface{}, value interface{}) interface{} {
+// GetOrSet returns its `value` of `key`, or sets value with given `value` if it does not exist and then returns
+// this value.
+func (tree *AVLTree) GetOrSet(key any, value any) any {
tree.mu.Lock()
defer tree.mu.Unlock()
if v, ok := tree.doGet(key); !ok {
@@ -134,10 +138,9 @@ func (tree *AVLTree) GetOrSet(key interface{}, value interface{}) interface{} {
}
}
-// GetOrSetFunc returns the value by key,
-// or sets value with returned value of callback function `f` if it does not exist
-// and then returns this value.
-func (tree *AVLTree) GetOrSetFunc(key interface{}, f func() interface{}) interface{} {
+// GetOrSetFunc returns its `value` of `key`, or sets value with returned value of callback function `f` if it does not
+// exist and then returns this value.
+func (tree *AVLTree) GetOrSetFunc(key any, f func() any) any {
tree.mu.Lock()
defer tree.mu.Unlock()
if v, ok := tree.doGet(key); !ok {
@@ -147,13 +150,11 @@ func (tree *AVLTree) GetOrSetFunc(key interface{}, f func() interface{}) interfa
}
}
-// GetOrSetFuncLock returns the value by key,
-// or sets value with returned value of callback function `f` if it does not exist
-// and then returns this value.
+// GetOrSetFuncLock returns its `value` of `key`, or sets value with returned value of callback function `f` if it does
+// not exist and then returns this value.
//
-// GetOrSetFuncLock differs with GetOrSetFunc function is that it executes function `f`
-// with mutex.Lock of the hash map.
-func (tree *AVLTree) GetOrSetFuncLock(key interface{}, f func() interface{}) interface{} {
+// GetOrSetFuncLock differs with GetOrSetFunc function is that it executes function `f` within mutex lock.
+func (tree *AVLTree) GetOrSetFuncLock(key any, f func() any) any {
tree.mu.Lock()
defer tree.mu.Unlock()
if v, ok := tree.doGet(key); !ok {
@@ -164,32 +165,40 @@ func (tree *AVLTree) GetOrSetFuncLock(key interface{}, f func() interface{}) int
}
// GetVar returns a gvar.Var with the value by given `key`.
-// The returned gvar.Var is un-concurrent safe.
-func (tree *AVLTree) GetVar(key interface{}) *gvar.Var {
+// Note that, the returned gvar.Var is un-concurrent safe.
+//
+// Also see function Get.
+func (tree *AVLTree) GetVar(key any) *gvar.Var {
return gvar.New(tree.Get(key))
}
// GetVarOrSet returns a gvar.Var with result from GetVarOrSet.
-// The returned gvar.Var is un-concurrent safe.
-func (tree *AVLTree) GetVarOrSet(key interface{}, value interface{}) *gvar.Var {
+// Note that, the returned gvar.Var is un-concurrent safe.
+//
+// Also see function GetOrSet.
+func (tree *AVLTree) GetVarOrSet(key any, value any) *gvar.Var {
return gvar.New(tree.GetOrSet(key, value))
}
// GetVarOrSetFunc returns a gvar.Var with result from GetOrSetFunc.
-// The returned gvar.Var is un-concurrent safe.
-func (tree *AVLTree) GetVarOrSetFunc(key interface{}, f func() interface{}) *gvar.Var {
+// Note that, the returned gvar.Var is un-concurrent safe.
+//
+// Also see function GetOrSetFunc.
+func (tree *AVLTree) GetVarOrSetFunc(key any, f func() any) *gvar.Var {
return gvar.New(tree.GetOrSetFunc(key, f))
}
// GetVarOrSetFuncLock returns a gvar.Var with result from GetOrSetFuncLock.
-// The returned gvar.Var is un-concurrent safe.
-func (tree *AVLTree) GetVarOrSetFuncLock(key interface{}, f func() interface{}) *gvar.Var {
+// Note that, the returned gvar.Var is un-concurrent safe.
+//
+// Also see function GetOrSetFuncLock.
+func (tree *AVLTree) GetVarOrSetFuncLock(key any, f func() any) *gvar.Var {
return gvar.New(tree.GetOrSetFuncLock(key, f))
}
// Search searches the tree with given `key`.
// Second return parameter `found` is true if key was found, otherwise false.
-func (tree *AVLTree) Search(key interface{}) (value interface{}, found bool) {
+func (tree *AVLTree) Search(key any) (value any, found bool) {
tree.mu.RLock()
defer tree.mu.RUnlock()
if node, found := tree.doGet(key); found {
@@ -198,8 +207,8 @@ func (tree *AVLTree) Search(key interface{}) (value interface{}, found bool) {
return nil, false
}
-// Contains checks whether `key` exists in the tree.
-func (tree *AVLTree) Contains(key interface{}) bool {
+// Contains checks and returns whether given `key` exists in the tree.
+func (tree *AVLTree) Contains(key any) bool {
tree.mu.RLock()
defer tree.mu.RUnlock()
_, ok := tree.doGet(key)
@@ -213,23 +222,23 @@ func (tree *AVLTree) Size() int {
return tree.tree.Size()
}
-// IsEmpty returns true if tree does not contain any nodes.
+// IsEmpty returns true if the tree does not contain any nodes.
func (tree *AVLTree) IsEmpty() bool {
tree.mu.RLock()
defer tree.mu.RUnlock()
return tree.tree.Size() == 0
}
-// Remove removes the node from the tree by key.
-// Key should adhere to the comparator's type assertion, otherwise method panics.
-func (tree *AVLTree) Remove(key interface{}) (value interface{}) {
+// Remove removes the node from the tree by `key`, and returns its associated value of `key`.
+// The given `key` should adhere to the comparator's type assertion, otherwise method panics.
+func (tree *AVLTree) Remove(key any) (value any) {
tree.mu.Lock()
defer tree.mu.Unlock()
return tree.doRemove(key)
}
-// Removes batch deletes values of the tree by `keys`.
-func (tree *AVLTree) Removes(keys []interface{}) {
+// Removes batch deletes key-value pairs from the tree by `keys`.
+func (tree *AVLTree) Removes(keys []any) {
tree.mu.Lock()
defer tree.mu.Unlock()
for _, key := range keys {
@@ -244,22 +253,22 @@ func (tree *AVLTree) Clear() {
tree.tree.Clear()
}
-// Keys returns all keys in asc order.
-func (tree *AVLTree) Keys() []interface{} {
+// Keys returns all keys from the tree in order by its comparator.
+func (tree *AVLTree) Keys() []any {
tree.mu.RLock()
defer tree.mu.RUnlock()
return tree.tree.Keys()
}
-// Values returns all values in asc order based on the key.
-func (tree *AVLTree) Values() []interface{} {
+// Values returns all values from the true in order by its comparator based on the key.
+func (tree *AVLTree) Values() []any {
tree.mu.RLock()
defer tree.mu.RUnlock()
return tree.tree.Values()
}
-// Replace the data of the tree with given `data`.
-func (tree *AVLTree) Replace(data map[interface{}]interface{}) {
+// Replace clears the data of the tree and sets the nodes by given `data`.
+func (tree *AVLTree) Replace(data map[any]any) {
tree.mu.Lock()
defer tree.mu.Unlock()
tree.tree.Clear()
@@ -273,7 +282,7 @@ func (tree *AVLTree) Print() {
fmt.Println(tree.String())
}
-// String returns a string representation of container
+// String returns a string representation of container.
func (tree *AVLTree) String() string {
tree.mu.RLock()
defer tree.mu.RUnlock()
@@ -287,24 +296,20 @@ func (tree *AVLTree) MarshalJSON() (jsonBytes []byte, err error) {
return tree.tree.MarshalJSON()
}
-// Map returns all key-value items as map.
-func (tree *AVLTree) Map() map[interface{}]interface{} {
- tree.mu.RLock()
- defer tree.mu.RUnlock()
- m := make(map[interface{}]interface{}, tree.Size())
- tree.IteratorAsc(func(key, value interface{}) bool {
+// Map returns all key-value pairs as map.
+func (tree *AVLTree) Map() map[any]any {
+ m := make(map[any]any, tree.Size())
+ tree.IteratorAsc(func(key, value any) bool {
m[key] = value
return true
})
return m
}
-// MapStrAny returns all key-value items as map[string]interface{}.
-func (tree *AVLTree) MapStrAny() map[string]interface{} {
- tree.mu.RLock()
- defer tree.mu.RUnlock()
- m := make(map[string]interface{}, tree.Size())
- tree.IteratorAsc(func(key, value interface{}) bool {
+// MapStrAny returns all key-value items as map[string]any.
+func (tree *AVLTree) MapStrAny() map[string]any {
+ m := make(map[string]any, tree.Size())
+ tree.IteratorAsc(func(key, value any) bool {
m[gconv.String(key)] = value
return true
})
@@ -312,39 +317,48 @@ func (tree *AVLTree) MapStrAny() map[string]interface{} {
}
// Iterator is alias of IteratorAsc.
-func (tree *AVLTree) Iterator(f func(key, value interface{}) bool) {
+//
+// Also see IteratorAsc.
+func (tree *AVLTree) Iterator(f func(key, value any) bool) {
tree.IteratorAsc(f)
}
// IteratorFrom is alias of IteratorAscFrom.
-func (tree *AVLTree) IteratorFrom(key interface{}, match bool, f func(key, value interface{}) bool) {
+//
+// Also see IteratorAscFrom.
+func (tree *AVLTree) IteratorFrom(key any, match bool, f func(key, value any) bool) {
tree.IteratorAscFrom(key, match, f)
}
// IteratorAsc iterates the tree readonly in ascending order with given callback function `f`.
-// If `f` returns true, then it continues iterating; or false to stop.
-func (tree *AVLTree) IteratorAsc(f func(key, value interface{}) bool) {
+// If callback function `f` returns true, then it continues iterating; or false to stop.
+func (tree *AVLTree) IteratorAsc(f func(key, value any) bool) {
tree.mu.RLock()
defer tree.mu.RUnlock()
- it := tree.tree.Iterator()
+ var (
+ ok bool
+ it = tree.tree.Iterator()
+ )
for it.Begin(); it.Next(); {
index, value := it.Key(), it.Value()
- if ok := f(index, value); !ok {
+ if ok = f(index, value); !ok {
break
}
}
}
// IteratorAscFrom iterates the tree readonly in ascending order with given callback function `f`.
-// The parameter `key` specifies the start entry for iterating. The `match` specifies whether
-// starting iterating if the `key` is fully matched, or else using index searching iterating.
-// If `f` returns true, then it continues iterating; or false to stop.
-func (tree *AVLTree) IteratorAscFrom(key interface{}, match bool, f func(key, value interface{}) bool) {
+//
+// The parameter `key` specifies the start entry for iterating.
+// The parameter `match` specifies whether starting iterating only if the `key` is fully matched, or else using index
+// searching iterating.
+// If callback function `f` returns true, then it continues iterating; or false to stop.
+func (tree *AVLTree) IteratorAscFrom(key any, match bool, f func(key, value any) bool) {
tree.mu.RLock()
defer tree.mu.RUnlock()
var keys = tree.tree.Keys()
- index, isIterator := tree.iteratorFromGetIndex(key, keys, match)
- if !isIterator {
+ index, canIterator := iteratorFromGetIndex(key, keys, match)
+ if !canIterator {
return
}
for ; index < len(keys); index++ {
@@ -353,29 +367,35 @@ func (tree *AVLTree) IteratorAscFrom(key interface{}, match bool, f func(key, va
}
// IteratorDesc iterates the tree readonly in descending order with given callback function `f`.
-// If `f` returns true, then it continues iterating; or false to stop.
-func (tree *AVLTree) IteratorDesc(f func(key, value interface{}) bool) {
+//
+// If callback function `f` returns true, then it continues iterating; or false to stop.
+func (tree *AVLTree) IteratorDesc(f func(key, value any) bool) {
tree.mu.RLock()
defer tree.mu.RUnlock()
- it := tree.tree.Iterator()
+ var (
+ ok bool
+ it = tree.tree.Iterator()
+ )
for it.End(); it.Prev(); {
index, value := it.Key(), it.Value()
- if ok := f(index, value); !ok {
+ if ok = f(index, value); !ok {
break
}
}
}
// IteratorDescFrom iterates the tree readonly in descending order with given callback function `f`.
-// The parameter `key` specifies the start entry for iterating. The `match` specifies whether
-// starting iterating if the `key` is fully matched, or else using index searching iterating.
-// If `f` returns true, then it continues iterating; or false to stop.
-func (tree *AVLTree) IteratorDescFrom(key interface{}, match bool, f func(key, value interface{}) bool) {
+//
+// The parameter `key` specifies the start entry for iterating.
+// The parameter `match` specifies whether starting iterating only if the `key` is fully matched, or else using index
+// searching iterating.
+// If callback function `f` returns true, then it continues iterating; or false to stop.
+func (tree *AVLTree) IteratorDescFrom(key any, match bool, f func(key, value any) bool) {
tree.mu.RLock()
defer tree.mu.RUnlock()
var keys = tree.tree.Keys()
- index, isIterator := tree.iteratorFromGetIndex(key, keys, match)
- if !isIterator {
+ index, canIterator := iteratorFromGetIndex(key, keys, match)
+ if !canIterator {
return
}
for ; index >= 0; index-- {
@@ -383,8 +403,7 @@ func (tree *AVLTree) IteratorDescFrom(key interface{}, match bool, f func(key, v
}
}
-// Left returns the minimum element of the AVL tree
-// or nil if the tree is empty.
+// Left returns the minimum element corresponding to the comparator of the tree or nil if the tree is empty.
func (tree *AVLTree) Left() *AVLTreeNode {
tree.mu.RLock()
defer tree.mu.RUnlock()
@@ -398,8 +417,7 @@ func (tree *AVLTree) Left() *AVLTreeNode {
}
}
-// Right returns the maximum element of the AVL tree
-// or nil if the tree is empty.
+// Right returns the maximum element corresponding to the comparator of the tree or nil if the tree is empty.
func (tree *AVLTree) Right() *AVLTreeNode {
tree.mu.RLock()
defer tree.mu.RUnlock()
@@ -413,19 +431,19 @@ func (tree *AVLTree) Right() *AVLTreeNode {
}
}
-// Floor Finds floor node of the input key, return the floor node or nil if no floor node is found.
-// Second return parameter is true if floor was found, otherwise false.
+// Floor Finds floor node of the input key, returns the floor node or nil if no floor node is found.
+// The second returned parameter `found` is true if floor was found, otherwise false.
//
// Floor node is defined as the largest node that is smaller than or equal to the given node.
// A floor node may not be found, either because the tree is empty, or because
// all nodes in the tree is larger than the given node.
//
// Key should adhere to the comparator's type assertion, otherwise method panics.
-func (tree *AVLTree) Floor(key interface{}) (floor *AVLTreeNode, found bool) {
+func (tree *AVLTree) Floor(key any) (floor *AVLTreeNode, found bool) {
tree.mu.RLock()
defer tree.mu.RUnlock()
- node, found := tree.tree.Floor(key)
- if !found {
+ node, ok := tree.tree.Floor(key)
+ if !ok {
return nil, false
}
return &AVLTreeNode{
@@ -434,19 +452,19 @@ func (tree *AVLTree) Floor(key interface{}) (floor *AVLTreeNode, found bool) {
}, true
}
-// Ceiling finds ceiling node of the input key, return the ceiling node or nil if no ceiling node is found.
-// Second return parameter is true if ceiling was found, otherwise false.
+// Ceiling finds ceiling node of the input key, returns the ceiling node or nil if no ceiling node is found.
+// The second return parameter `found` is true if ceiling was found, otherwise false.
//
// Ceiling node is defined as the smallest node that is larger than or equal to the given node.
// A ceiling node may not be found, either because the tree is empty, or because
// all nodes in the tree is smaller than the given node.
//
// Key should adhere to the comparator's type assertion, otherwise method panics.
-func (tree *AVLTree) Ceiling(key interface{}) (ceiling *AVLTreeNode, found bool) {
+func (tree *AVLTree) Ceiling(key any) (ceiling *AVLTreeNode, found bool) {
tree.mu.RLock()
defer tree.mu.RUnlock()
- node, found := tree.tree.Ceiling(key)
- if !found {
+ node, ok := tree.tree.Ceiling(key)
+ if !ok {
return nil, false
}
return &AVLTreeNode{
@@ -460,14 +478,14 @@ func (tree *AVLTree) Ceiling(key interface{}) (ceiling *AVLTreeNode, found bool)
// or else the comparator would panic.
//
// If the type of value is different with key, you pass the new `comparator`.
-func (tree *AVLTree) Flip(comparator ...func(v1, v2 interface{}) int) {
+func (tree *AVLTree) Flip(comparator ...func(v1, v2 any) int) {
var t = new(AVLTree)
if len(comparator) > 0 {
t = NewAVLTree(comparator[0], tree.mu.IsSafe())
} else {
t = NewAVLTree(tree.comparator, tree.mu.IsSafe())
}
- tree.IteratorAsc(func(key, value interface{}) bool {
+ tree.IteratorAsc(func(key, value any) bool {
t.doSet(value, key)
return true
})
@@ -475,9 +493,13 @@ func (tree *AVLTree) Flip(comparator ...func(v1, v2 interface{}) int) {
tree.Sets(t.Map())
}
-// doSet sets key-value pair to the tree.
-func (tree *AVLTree) doSet(key, value interface{}) interface{} {
- if f, ok := value.(func() interface{}); ok {
+// doSet inserts key-value pair node into the tree without lock.
+// If `key` already exists, then its value is updated with the new value.
+// If `value` is type of , it will be executed and its return value will be set to the map with `key`.
+//
+// It returns value with given `key`.
+func (tree *AVLTree) doSet(key, value any) any {
+ if f, ok := value.(func() any); ok {
value = f()
}
if value == nil {
@@ -487,35 +509,15 @@ func (tree *AVLTree) doSet(key, value interface{}) interface{} {
return value
}
-// doGet retrieves and returns the value of given key from tree.
-func (tree *AVLTree) doGet(key interface{}) (value interface{}, found bool) {
+// doGet retrieves and returns the value of given key from tree without lock.
+func (tree *AVLTree) doGet(key any) (value any, found bool) {
return tree.tree.Get(key)
}
-// doRemove removes key from tree.
-func (tree *AVLTree) doRemove(key interface{}) (value interface{}) {
+// doRemove removes key from tree and returns its associated value without lock.
+// Note that, the given `key` should adhere to the comparator's type assertion, otherwise method panics.
+func (tree *AVLTree) doRemove(key any) (value any) {
value, _ = tree.tree.Get(key)
tree.tree.Remove(key)
return
}
-
-// iteratorFromGetIndex returns the index of the key in the keys slice.
-// The parameter `match` specifies whether starting iterating if the `key` is fully matched,
-// or else using index searching iterating.
-// If `isIterator` is true, iterator is available; or else not.
-func (tree *AVLTree) iteratorFromGetIndex(key interface{}, keys []interface{}, match bool) (index int, isIterator bool) {
- if match {
- for i, k := range keys {
- if k == key {
- isIterator = true
- index = i
- }
- }
- } else {
- if i, ok := key.(int); ok {
- isIterator = true
- index = i
- }
- }
- return
-}
diff --git a/container/gtree/gtree_btree.go b/container/gtree/gtree_btree.go
index a7b56c538..59f450533 100644
--- a/container/gtree/gtree_btree.go
+++ b/container/gtree/gtree_btree.go
@@ -21,22 +21,22 @@ var _ iTree = (*BTree)(nil)
// BTree holds elements of the B-tree.
type BTree struct {
mu rwmutex.RWMutex
- comparator func(v1, v2 interface{}) int
+ comparator func(v1, v2 any) int
m int // order (maximum number of children)
tree *btree.Tree
}
// BTreeEntry represents the key-value pair contained within nodes.
type BTreeEntry struct {
- Key interface{}
- Value interface{}
+ Key any
+ Value any
}
// NewBTree instantiates a B-tree with `m` (maximum number of children) and a custom key comparator.
// The parameter `safe` is used to specify whether using tree in concurrent-safety,
// which is false in default.
// Note that the `m` must be greater or equal than 3, or else it panics.
-func NewBTree(m int, comparator func(v1, v2 interface{}) int, safe ...bool) *BTree {
+func NewBTree(m int, comparator func(v1, v2 any) int, safe ...bool) *BTree {
return &BTree{
mu: rwmutex.Create(safe...),
m: m,
@@ -48,7 +48,7 @@ func NewBTree(m int, comparator func(v1, v2 interface{}) int, safe ...bool) *BTr
// NewBTreeFrom instantiates a B-tree with `m` (maximum number of children), a custom key comparator and data map.
// The parameter `safe` is used to specify whether using tree in concurrent-safety,
// which is false in default.
-func NewBTreeFrom(m int, comparator func(v1, v2 interface{}) int, data map[interface{}]interface{}, safe ...bool) *BTree {
+func NewBTreeFrom(m int, comparator func(v1, v2 any) int, data map[any]any, safe ...bool) *BTree {
tree := NewBTree(m, comparator, safe...)
for k, v := range data {
tree.doSet(k, v)
@@ -56,22 +56,22 @@ func NewBTreeFrom(m int, comparator func(v1, v2 interface{}) int, data map[inter
return tree
}
-// Clone returns a new tree with a copy of current tree.
+// Clone clones and returns a new tree from current tree.
func (tree *BTree) Clone() *BTree {
newTree := NewBTree(tree.m, tree.comparator, tree.mu.IsSafe())
newTree.Sets(tree.Map())
return newTree
}
-// Set inserts key-value item into the tree.
-func (tree *BTree) Set(key interface{}, value interface{}) {
+// Set sets key-value pair into the tree.
+func (tree *BTree) Set(key any, value any) {
tree.mu.Lock()
defer tree.mu.Unlock()
tree.doSet(key, value)
}
// Sets batch sets key-values to the tree.
-func (tree *BTree) Sets(data map[interface{}]interface{}) {
+func (tree *BTree) Sets(data map[any]any) {
tree.mu.Lock()
defer tree.mu.Unlock()
for k, v := range data {
@@ -80,8 +80,8 @@ func (tree *BTree) Sets(data map[interface{}]interface{}) {
}
// SetIfNotExist sets `value` to the map if the `key` does not exist, and then returns true.
-// It returns false if `key` exists, and `value` would be ignored.
-func (tree *BTree) SetIfNotExist(key interface{}, value interface{}) bool {
+// It returns false if `key` exists, and such setting key-value pair operation would be ignored.
+func (tree *BTree) SetIfNotExist(key any, value any) bool {
tree.mu.Lock()
defer tree.mu.Unlock()
if _, ok := tree.doGet(key); !ok {
@@ -92,8 +92,8 @@ func (tree *BTree) SetIfNotExist(key interface{}, value interface{}) bool {
}
// SetIfNotExistFunc sets value with return value of callback function `f`, and then returns true.
-// It returns false if `key` exists, and `value` would be ignored.
-func (tree *BTree) SetIfNotExistFunc(key interface{}, f func() interface{}) bool {
+// It returns false if `key` exists, and such setting key-value pair operation would be ignored.
+func (tree *BTree) SetIfNotExistFunc(key any, f func() any) bool {
tree.mu.Lock()
defer tree.mu.Unlock()
if _, ok := tree.doGet(key); !ok {
@@ -104,11 +104,11 @@ func (tree *BTree) SetIfNotExistFunc(key interface{}, f func() interface{}) bool
}
// SetIfNotExistFuncLock sets value with return value of callback function `f`, and then returns true.
-// It returns false if `key` exists, and `value` would be ignored.
+// It returns false if `key` exists, and such setting key-value pair operation would be ignored.
//
// SetIfNotExistFuncLock differs with SetIfNotExistFunc function is that
-// it executes function `f` with mutex.Lock of the hash map.
-func (tree *BTree) SetIfNotExistFuncLock(key interface{}, f func() interface{}) bool {
+// it executes function `f` within mutex lock.
+func (tree *BTree) SetIfNotExistFuncLock(key any, f func() any) bool {
tree.mu.Lock()
defer tree.mu.Unlock()
if _, ok := tree.doGet(key); !ok {
@@ -118,17 +118,20 @@ func (tree *BTree) SetIfNotExistFuncLock(key interface{}, f func() interface{})
return false
}
-// Get searches the node in the tree by `key` and returns its value or nil if key is not found in tree.
-func (tree *BTree) Get(key interface{}) (value interface{}) {
+// Get searches the `key` in the tree and returns its associated `value` or nil if key is not found in tree.
+//
+// Note that, the `nil` value from Get function cannot be used to determine key existence, please use Contains function
+// to do so.
+func (tree *BTree) Get(key any) (value any) {
tree.mu.Lock()
defer tree.mu.Unlock()
value, _ = tree.doGet(key)
return
}
-// GetOrSet returns the value by key,
-// or sets value with given `value` if it does not exist and then returns this value.
-func (tree *BTree) GetOrSet(key interface{}, value interface{}) interface{} {
+// GetOrSet returns its `value` of `key`, or sets value with given `value` if it does not exist and then returns
+// this value.
+func (tree *BTree) GetOrSet(key any, value any) any {
tree.mu.Lock()
defer tree.mu.Unlock()
if v, ok := tree.doGet(key); !ok {
@@ -138,10 +141,9 @@ func (tree *BTree) GetOrSet(key interface{}, value interface{}) interface{} {
}
}
-// GetOrSetFunc returns the value by key,
-// or sets value with returned value of callback function `f` if it does not exist
-// and then returns this value.
-func (tree *BTree) GetOrSetFunc(key interface{}, f func() interface{}) interface{} {
+// GetOrSetFunc returns its `value` of `key`, or sets value with returned value of callback function `f` if it does not
+// exist and then returns this value.
+func (tree *BTree) GetOrSetFunc(key any, f func() any) any {
tree.mu.Lock()
defer tree.mu.Unlock()
if v, ok := tree.doGet(key); !ok {
@@ -151,13 +153,11 @@ func (tree *BTree) GetOrSetFunc(key interface{}, f func() interface{}) interface
}
}
-// GetOrSetFuncLock returns the value by key,
-// or sets value with returned value of callback function `f` if it does not exist
-// and then returns this value.
+// GetOrSetFuncLock returns its `value` of `key`, or sets value with returned value of callback function `f` if it does
+// not exist and then returns this value.
//
-// GetOrSetFuncLock differs with GetOrSetFunc function is that it executes function `f`
-// with mutex.Lock of the hash map.
-func (tree *BTree) GetOrSetFuncLock(key interface{}, f func() interface{}) interface{} {
+// GetOrSetFuncLock differs with GetOrSetFunc function is that it executes function `f` within mutex lock.
+func (tree *BTree) GetOrSetFuncLock(key any, f func() any) any {
tree.mu.Lock()
defer tree.mu.Unlock()
if v, ok := tree.doGet(key); !ok {
@@ -168,39 +168,47 @@ func (tree *BTree) GetOrSetFuncLock(key interface{}, f func() interface{}) inter
}
// GetVar returns a gvar.Var with the value by given `key`.
-// The returned gvar.Var is un-concurrent safe.
-func (tree *BTree) GetVar(key interface{}) *gvar.Var {
+// Note that, the returned gvar.Var is un-concurrent safe.
+//
+// Also see function Get.
+func (tree *BTree) GetVar(key any) *gvar.Var {
return gvar.New(tree.Get(key))
}
// GetVarOrSet returns a gvar.Var with result from GetVarOrSet.
-// The returned gvar.Var is un-concurrent safe.
-func (tree *BTree) GetVarOrSet(key interface{}, value interface{}) *gvar.Var {
+// Note that, the returned gvar.Var is un-concurrent safe.
+//
+// Also see function GetOrSet.
+func (tree *BTree) GetVarOrSet(key any, value any) *gvar.Var {
return gvar.New(tree.GetOrSet(key, value))
}
// GetVarOrSetFunc returns a gvar.Var with result from GetOrSetFunc.
-// The returned gvar.Var is un-concurrent safe.
-func (tree *BTree) GetVarOrSetFunc(key interface{}, f func() interface{}) *gvar.Var {
+// Note that, the returned gvar.Var is un-concurrent safe.
+//
+// Also see function GetOrSetFunc.
+func (tree *BTree) GetVarOrSetFunc(key any, f func() any) *gvar.Var {
return gvar.New(tree.GetOrSetFunc(key, f))
}
// GetVarOrSetFuncLock returns a gvar.Var with result from GetOrSetFuncLock.
-// The returned gvar.Var is un-concurrent safe.
-func (tree *BTree) GetVarOrSetFuncLock(key interface{}, f func() interface{}) *gvar.Var {
+// Note that, the returned gvar.Var is un-concurrent safe.
+//
+// Also see function GetOrSetFuncLock.
+func (tree *BTree) GetVarOrSetFuncLock(key any, f func() any) *gvar.Var {
return gvar.New(tree.GetOrSetFuncLock(key, f))
}
// Search searches the tree with given `key`.
// Second return parameter `found` is true if key was found, otherwise false.
-func (tree *BTree) Search(key interface{}) (value interface{}, found bool) {
+func (tree *BTree) Search(key any) (value any, found bool) {
tree.mu.RLock()
defer tree.mu.RUnlock()
return tree.tree.Get(key)
}
-// Contains checks whether `key` exists in the tree.
-func (tree *BTree) Contains(key interface{}) bool {
+// Contains checks and returns whether given `key` exists in the tree.
+func (tree *BTree) Contains(key any) bool {
tree.mu.RLock()
defer tree.mu.RUnlock()
_, ok := tree.doGet(key)
@@ -221,15 +229,16 @@ func (tree *BTree) IsEmpty() bool {
return tree.tree.Size() == 0
}
-// Remove removes the node from the tree by `key`.
-func (tree *BTree) Remove(key interface{}) (value interface{}) {
+// Remove removes the node from the tree by `key`, and returns its associated value of `key`.
+// The given `key` should adhere to the comparator's type assertion, otherwise method panics.
+func (tree *BTree) Remove(key any) (value any) {
tree.mu.Lock()
defer tree.mu.Unlock()
return tree.doRemove(key)
}
-// Removes batch deletes values of the tree by `keys`.
-func (tree *BTree) Removes(keys []interface{}) {
+// Removes batch deletes key-value pairs from the tree by `keys`.
+func (tree *BTree) Removes(keys []any) {
tree.mu.Lock()
defer tree.mu.Unlock()
for _, key := range keys {
@@ -244,22 +253,22 @@ func (tree *BTree) Clear() {
tree.tree.Clear()
}
-// Keys returns all keys in asc order.
-func (tree *BTree) Keys() []interface{} {
+// Keys returns all keys from the tree in order by its comparator.
+func (tree *BTree) Keys() []any {
tree.mu.RLock()
defer tree.mu.RUnlock()
return tree.tree.Keys()
}
-// Values returns all values in asc order based on the key.
-func (tree *BTree) Values() []interface{} {
+// Values returns all values from the true in order by its comparator based on the key.
+func (tree *BTree) Values() []any {
tree.mu.RLock()
defer tree.mu.RUnlock()
return tree.tree.Values()
}
-// Replace the data of the tree with given `data`.
-func (tree *BTree) Replace(data map[interface{}]interface{}) {
+// Replace clears the data of the tree and sets the nodes by given `data`.
+func (tree *BTree) Replace(data map[any]any) {
tree.mu.Lock()
defer tree.mu.Unlock()
tree.tree.Clear()
@@ -268,24 +277,20 @@ func (tree *BTree) Replace(data map[interface{}]interface{}) {
}
}
-// Map returns all key-value items as map.
-func (tree *BTree) Map() map[interface{}]interface{} {
- tree.mu.RLock()
- defer tree.mu.RUnlock()
- m := make(map[interface{}]interface{}, tree.Size())
- tree.IteratorAsc(func(key, value interface{}) bool {
+// Map returns all key-value pairs as map.
+func (tree *BTree) Map() map[any]any {
+ m := make(map[any]any, tree.Size())
+ tree.IteratorAsc(func(key, value any) bool {
m[key] = value
return true
})
return m
}
-// MapStrAny returns all key-value items as map[string]interface{}.
-func (tree *BTree) MapStrAny() map[string]interface{} {
- tree.mu.RLock()
- defer tree.mu.RUnlock()
- m := make(map[string]interface{}, tree.Size())
- tree.IteratorAsc(func(key, value interface{}) bool {
+// MapStrAny returns all key-value items as map[string]any.
+func (tree *BTree) MapStrAny() map[string]any {
+ m := make(map[string]any, tree.Size())
+ tree.IteratorAsc(func(key, value any) bool {
m[gconv.String(key)] = value
return true
})
@@ -312,39 +317,48 @@ func (tree *BTree) MarshalJSON() (jsonBytes []byte, err error) {
}
// Iterator is alias of IteratorAsc.
-func (tree *BTree) Iterator(f func(key, value interface{}) bool) {
+//
+// Also see IteratorAsc.
+func (tree *BTree) Iterator(f func(key, value any) bool) {
tree.IteratorAsc(f)
}
// IteratorFrom is alias of IteratorAscFrom.
-func (tree *BTree) IteratorFrom(key interface{}, match bool, f func(key, value interface{}) bool) {
+//
+// Also see IteratorAscFrom.
+func (tree *BTree) IteratorFrom(key any, match bool, f func(key, value any) bool) {
tree.IteratorAscFrom(key, match, f)
}
// IteratorAsc iterates the tree readonly in ascending order with given callback function `f`.
-// If `f` returns true, then it continues iterating; or false to stop.
-func (tree *BTree) IteratorAsc(f func(key, value interface{}) bool) {
+// If callback function `f` returns true, then it continues iterating; or false to stop.
+func (tree *BTree) IteratorAsc(f func(key, value any) bool) {
tree.mu.RLock()
defer tree.mu.RUnlock()
- it := tree.tree.Iterator()
+ var (
+ ok bool
+ it = tree.tree.Iterator()
+ )
for it.Begin(); it.Next(); {
index, value := it.Key(), it.Value()
- if ok := f(index, value); !ok {
+ if ok = f(index, value); !ok {
break
}
}
}
// IteratorAscFrom iterates the tree readonly in ascending order with given callback function `f`.
-// The parameter `key` specifies the start entry for iterating. The `match` specifies whether
-// starting iterating if the `key` is fully matched, or else using index searching iterating.
-// If `f` returns true, then it continues iterating; or false to stop.
-func (tree *BTree) IteratorAscFrom(key interface{}, match bool, f func(key, value interface{}) bool) {
+//
+// The parameter `key` specifies the start entry for iterating.
+// The parameter `match` specifies whether starting iterating only if the `key` is fully matched, or else using index
+// searching iterating.
+// If callback function `f` returns true, then it continues iterating; or false to stop.
+func (tree *BTree) IteratorAscFrom(key any, match bool, f func(key, value any) bool) {
tree.mu.RLock()
defer tree.mu.RUnlock()
var keys = tree.tree.Keys()
- index, isIterator := tree.iteratorFromGetIndex(key, keys, match)
- if !isIterator {
+ index, canIterator := iteratorFromGetIndex(key, keys, match)
+ if !canIterator {
return
}
for ; index < len(keys); index++ {
@@ -353,29 +367,35 @@ func (tree *BTree) IteratorAscFrom(key interface{}, match bool, f func(key, valu
}
// IteratorDesc iterates the tree readonly in descending order with given callback function `f`.
-// If `f` returns true, then it continues iterating; or false to stop.
-func (tree *BTree) IteratorDesc(f func(key, value interface{}) bool) {
+//
+// If callback function `f` returns true, then it continues iterating; or false to stop.
+func (tree *BTree) IteratorDesc(f func(key, value any) bool) {
tree.mu.RLock()
defer tree.mu.RUnlock()
- it := tree.tree.Iterator()
+ var (
+ ok bool
+ it = tree.tree.Iterator()
+ )
for it.End(); it.Prev(); {
index, value := it.Key(), it.Value()
- if ok := f(index, value); !ok {
+ if ok = f(index, value); !ok {
break
}
}
}
// IteratorDescFrom iterates the tree readonly in descending order with given callback function `f`.
-// The parameter `key` specifies the start entry for iterating. The `match` specifies whether
-// starting iterating if the `key` is fully matched, or else using index searching iterating.
-// If `f` returns true, then it continues iterating; or false to stop.
-func (tree *BTree) IteratorDescFrom(key interface{}, match bool, f func(key, value interface{}) bool) {
+//
+// The parameter `key` specifies the start entry for iterating.
+// The parameter `match` specifies whether starting iterating only if the `key` is fully matched, or else using index
+// searching iterating.
+// If callback function `f` returns true, then it continues iterating; or false to stop.
+func (tree *BTree) IteratorDescFrom(key any, match bool, f func(key, value any) bool) {
tree.mu.RLock()
defer tree.mu.RUnlock()
var keys = tree.tree.Keys()
- index, isIterator := tree.iteratorFromGetIndex(key, keys, match)
- if !isIterator {
+ index, canIterator := iteratorFromGetIndex(key, keys, match)
+ if !canIterator {
return
}
for ; index >= 0; index-- {
@@ -390,7 +410,7 @@ func (tree *BTree) Height() int {
return tree.tree.Height()
}
-// Left returns the left-most (min) entry or nil if tree is empty.
+// Left returns the minimum element corresponding to the comparator of the tree or nil if the tree is empty.
func (tree *BTree) Left() *BTreeEntry {
tree.mu.RLock()
defer tree.mu.RUnlock()
@@ -404,7 +424,7 @@ func (tree *BTree) Left() *BTreeEntry {
}
}
-// Right returns the right-most (max) entry or nil if tree is empty.
+// Right returns the maximum element corresponding to the comparator of the tree or nil if the tree is empty.
func (tree *BTree) Right() *BTreeEntry {
tree.mu.RLock()
defer tree.mu.RUnlock()
@@ -418,14 +438,13 @@ func (tree *BTree) Right() *BTreeEntry {
}
}
-// doSet inserts key-value pair node into the tree.
-// If key already exists, then its value is updated with the new value.
-// If `value` is type of ,
-// it will be executed and its return value will be set to the map with `key`.
+// doSet inserts key-value pair node into the tree without lock.
+// If `key` already exists, then its value is updated with the new value.
+// If `value` is type of , it will be executed and its return value will be set to the map with `key`.
//
// It returns value with given `key`.
-func (tree *BTree) doSet(key interface{}, value interface{}) interface{} {
- if f, ok := value.(func() interface{}); ok {
+func (tree *BTree) doSet(key any, value any) any {
+ if f, ok := value.(func() any); ok {
value = f()
}
if value == nil {
@@ -435,36 +454,15 @@ func (tree *BTree) doSet(key interface{}, value interface{}) interface{} {
return value
}
-// doGet get the value from the tree by key.
-func (tree *BTree) doGet(key interface{}) (value interface{}, ok bool) {
+// doGet get the value from the tree by key without lock.
+func (tree *BTree) doGet(key any) (value any, ok bool) {
return tree.tree.Get(key)
}
-// doRemove removes the node from the tree by key.
-// Key should adhere to the comparator's type assertion, otherwise method panics.
-func (tree *BTree) doRemove(key interface{}) (value interface{}) {
+// doRemove removes key from tree and returns its associated value without lock.
+// Note that, the given `key` should adhere to the comparator's type assertion, otherwise method panics.
+func (tree *BTree) doRemove(key any) (value any) {
value, _ = tree.tree.Get(key)
tree.tree.Remove(key)
return
}
-
-// iteratorFromGetIndex returns the index of the key in the keys slice.
-// The parameter `match` specifies whether starting iterating if the `key` is fully matched,
-// or else using index searching iterating.
-// If `isIterator` is true, iterator is available; or else not.
-func (tree *BTree) iteratorFromGetIndex(key interface{}, keys []interface{}, match bool) (index int, isIterator bool) {
- if match {
- for i, k := range keys {
- if k == key {
- isIterator = true
- index = i
- }
- }
- } else {
- if i, ok := key.(int); ok {
- isIterator = true
- index = i
- }
- }
- return
-}
diff --git a/container/gtree/gtree_redblacktree.go b/container/gtree/gtree_redblacktree.go
index 429be2fb6..c5a6bddf8 100644
--- a/container/gtree/gtree_redblacktree.go
+++ b/container/gtree/gtree_redblacktree.go
@@ -23,20 +23,20 @@ var _ iTree = (*RedBlackTree)(nil)
// RedBlackTree holds elements of the red-black tree.
type RedBlackTree struct {
mu rwmutex.RWMutex
- comparator func(v1, v2 interface{}) int
+ comparator func(v1, v2 any) int
tree *redblacktree.Tree
}
// RedBlackTreeNode is a single element within the tree.
type RedBlackTreeNode struct {
- Key interface{}
- Value interface{}
+ Key any
+ Value any
}
// NewRedBlackTree instantiates a red-black tree with the custom key comparator.
// The parameter `safe` is used to specify whether using tree in concurrent-safety,
// which is false in default.
-func NewRedBlackTree(comparator func(v1, v2 interface{}) int, safe ...bool) *RedBlackTree {
+func NewRedBlackTree(comparator func(v1, v2 any) int, safe ...bool) *RedBlackTree {
return &RedBlackTree{
mu: rwmutex.Create(safe...),
comparator: comparator,
@@ -47,7 +47,7 @@ func NewRedBlackTree(comparator func(v1, v2 interface{}) int, safe ...bool) *Red
// NewRedBlackTreeFrom instantiates a red-black tree with the custom key comparator and `data` map.
// The parameter `safe` is used to specify whether using tree in concurrent-safety,
// which is false in default.
-func NewRedBlackTreeFrom(comparator func(v1, v2 interface{}) int, data map[interface{}]interface{}, safe ...bool) *RedBlackTree {
+func NewRedBlackTreeFrom(comparator func(v1, v2 any) int, data map[any]any, safe ...bool) *RedBlackTree {
tree := NewRedBlackTree(comparator, safe...)
for k, v := range data {
tree.doSet(k, v)
@@ -56,7 +56,7 @@ func NewRedBlackTreeFrom(comparator func(v1, v2 interface{}) int, data map[inter
}
// SetComparator sets/changes the comparator for sorting.
-func (tree *RedBlackTree) SetComparator(comparator func(a, b interface{}) int) {
+func (tree *RedBlackTree) SetComparator(comparator func(a, b any) int) {
tree.comparator = comparator
if tree.tree == nil {
tree.tree = redblacktree.NewWith(comparator)
@@ -68,22 +68,22 @@ func (tree *RedBlackTree) SetComparator(comparator func(a, b interface{}) int) {
}
}
-// Clone returns a new tree with a copy of current tree.
+// Clone clones and returns a new tree from current tree.
func (tree *RedBlackTree) Clone() *RedBlackTree {
newTree := NewRedBlackTree(tree.comparator, tree.mu.IsSafe())
newTree.Sets(tree.Map())
return newTree
}
-// Set inserts node into the tree.
-func (tree *RedBlackTree) Set(key interface{}, value interface{}) {
+// Set sets key-value pair into the tree.
+func (tree *RedBlackTree) Set(key any, value any) {
tree.mu.Lock()
defer tree.mu.Unlock()
tree.doSet(key, value)
}
// Sets batch sets key-values to the tree.
-func (tree *RedBlackTree) Sets(data map[interface{}]interface{}) {
+func (tree *RedBlackTree) Sets(data map[any]any) {
tree.mu.Lock()
defer tree.mu.Unlock()
for key, value := range data {
@@ -92,8 +92,8 @@ func (tree *RedBlackTree) Sets(data map[interface{}]interface{}) {
}
// SetIfNotExist sets `value` to the map if the `key` does not exist, and then returns true.
-// It returns false if `key` exists, and `value` would be ignored.
-func (tree *RedBlackTree) SetIfNotExist(key interface{}, value interface{}) bool {
+// It returns false if `key` exists, and such setting key-value pair operation would be ignored.
+func (tree *RedBlackTree) SetIfNotExist(key any, value any) bool {
tree.mu.Lock()
defer tree.mu.Unlock()
if _, ok := tree.doGet(key); !ok {
@@ -104,8 +104,8 @@ func (tree *RedBlackTree) SetIfNotExist(key interface{}, value interface{}) bool
}
// SetIfNotExistFunc sets value with return value of callback function `f`, and then returns true.
-// It returns false if `key` exists, and `value` would be ignored.
-func (tree *RedBlackTree) SetIfNotExistFunc(key interface{}, f func() interface{}) bool {
+// It returns false if `key` exists, and such setting key-value pair operation would be ignored.
+func (tree *RedBlackTree) SetIfNotExistFunc(key any, f func() any) bool {
tree.mu.Lock()
defer tree.mu.Unlock()
if _, ok := tree.doGet(key); !ok {
@@ -116,11 +116,11 @@ func (tree *RedBlackTree) SetIfNotExistFunc(key interface{}, f func() interface{
}
// SetIfNotExistFuncLock sets value with return value of callback function `f`, and then returns true.
-// It returns false if `key` exists, and `value` would be ignored.
+// It returns false if `key` exists, and such setting key-value pair operation would be ignored.
//
// SetIfNotExistFuncLock differs with SetIfNotExistFunc function is that
-// it executes function `f` with mutex.Lock of the hash map.
-func (tree *RedBlackTree) SetIfNotExistFuncLock(key interface{}, f func() interface{}) bool {
+// it executes function `f` within mutex lock.
+func (tree *RedBlackTree) SetIfNotExistFuncLock(key any, f func() any) bool {
tree.mu.Lock()
defer tree.mu.Unlock()
if _, ok := tree.doGet(key); !ok {
@@ -130,15 +130,18 @@ func (tree *RedBlackTree) SetIfNotExistFuncLock(key interface{}, f func() interf
return false
}
-// Get searches the node in the tree by `key` and returns its value or nil if key is not found in tree.
-func (tree *RedBlackTree) Get(key interface{}) (value interface{}) {
+// Get searches the `key` in the tree and returns its associated `value` or nil if key is not found in tree.
+//
+// Note that, the `nil` value from Get function cannot be used to determine key existence, please use Contains function
+// to do so.
+func (tree *RedBlackTree) Get(key any) (value any) {
value, _ = tree.Search(key)
return
}
-// GetOrSet returns the value by key,
-// or sets value with given `value` if it does not exist and then returns this value.
-func (tree *RedBlackTree) GetOrSet(key interface{}, value interface{}) interface{} {
+// GetOrSet returns its `value` of `key`, or sets value with given `value` if it does not exist and then returns
+// this value.
+func (tree *RedBlackTree) GetOrSet(key any, value any) any {
tree.mu.Lock()
defer tree.mu.Unlock()
if v, ok := tree.doGet(key); !ok {
@@ -148,10 +151,9 @@ func (tree *RedBlackTree) GetOrSet(key interface{}, value interface{}) interface
}
}
-// GetOrSetFunc returns the value by key,
-// or sets value with returned value of callback function `f` if it does not exist
-// and then returns this value.
-func (tree *RedBlackTree) GetOrSetFunc(key interface{}, f func() interface{}) interface{} {
+// GetOrSetFunc returns its `value` of `key`, or sets value with returned value of callback function `f` if it does not
+// exist and then returns this value.
+func (tree *RedBlackTree) GetOrSetFunc(key any, f func() any) any {
tree.mu.Lock()
defer tree.mu.Unlock()
if v, ok := tree.doGet(key); !ok {
@@ -161,13 +163,11 @@ func (tree *RedBlackTree) GetOrSetFunc(key interface{}, f func() interface{}) in
}
}
-// GetOrSetFuncLock returns the value by key,
-// or sets value with returned value of callback function `f` if it does not exist
-// and then returns this value.
+// GetOrSetFuncLock returns its `value` of `key`, or sets value with returned value of callback function `f` if it does
+// not exist and then returns this value.
//
-// GetOrSetFuncLock differs with GetOrSetFunc function is that it executes function `f`
-// with mutex.Lock of the hash map.
-func (tree *RedBlackTree) GetOrSetFuncLock(key interface{}, f func() interface{}) interface{} {
+// GetOrSetFuncLock differs with GetOrSetFunc function is that it executes function `f`within mutex lock.
+func (tree *RedBlackTree) GetOrSetFuncLock(key any, f func() any) any {
tree.mu.Lock()
defer tree.mu.Unlock()
if v, ok := tree.doGet(key); !ok {
@@ -178,32 +178,40 @@ func (tree *RedBlackTree) GetOrSetFuncLock(key interface{}, f func() interface{}
}
// GetVar returns a gvar.Var with the value by given `key`.
-// The returned gvar.Var is un-concurrent safe.
-func (tree *RedBlackTree) GetVar(key interface{}) *gvar.Var {
+// Note that, the returned gvar.Var is un-concurrent safe.
+//
+// Also see function Get.
+func (tree *RedBlackTree) GetVar(key any) *gvar.Var {
return gvar.New(tree.Get(key))
}
// GetVarOrSet returns a gvar.Var with result from GetVarOrSet.
-// The returned gvar.Var is un-concurrent safe.
-func (tree *RedBlackTree) GetVarOrSet(key interface{}, value interface{}) *gvar.Var {
+// Note that, the returned gvar.Var is un-concurrent safe.
+//
+// Also see function GetOrSet.
+func (tree *RedBlackTree) GetVarOrSet(key any, value any) *gvar.Var {
return gvar.New(tree.GetOrSet(key, value))
}
// GetVarOrSetFunc returns a gvar.Var with result from GetOrSetFunc.
-// The returned gvar.Var is un-concurrent safe.
-func (tree *RedBlackTree) GetVarOrSetFunc(key interface{}, f func() interface{}) *gvar.Var {
+// Note that, the returned gvar.Var is un-concurrent safe.
+//
+// Also see function GetOrSetFunc.
+func (tree *RedBlackTree) GetVarOrSetFunc(key any, f func() any) *gvar.Var {
return gvar.New(tree.GetOrSetFunc(key, f))
}
// GetVarOrSetFuncLock returns a gvar.Var with result from GetOrSetFuncLock.
-// The returned gvar.Var is un-concurrent safe.
-func (tree *RedBlackTree) GetVarOrSetFuncLock(key interface{}, f func() interface{}) *gvar.Var {
+// Note that, the returned gvar.Var is un-concurrent safe.
+//
+// Also see function GetOrSetFuncLock.
+func (tree *RedBlackTree) GetVarOrSetFuncLock(key any, f func() any) *gvar.Var {
return gvar.New(tree.GetOrSetFuncLock(key, f))
}
// Search searches the tree with given `key`.
// Second return parameter `found` is true if key was found, otherwise false.
-func (tree *RedBlackTree) Search(key interface{}) (value interface{}, found bool) {
+func (tree *RedBlackTree) Search(key any) (value any, found bool) {
tree.mu.RLock()
defer tree.mu.RUnlock()
if node, found := tree.doGet(key); found {
@@ -212,8 +220,8 @@ func (tree *RedBlackTree) Search(key interface{}) (value interface{}, found bool
return nil, false
}
-// Contains checks whether `key` exists in the tree.
-func (tree *RedBlackTree) Contains(key interface{}) bool {
+// Contains checks and returns whether given `key` exists in the tree.
+func (tree *RedBlackTree) Contains(key any) bool {
tree.mu.RLock()
defer tree.mu.RUnlock()
_, ok := tree.doGet(key)
@@ -234,16 +242,16 @@ func (tree *RedBlackTree) IsEmpty() bool {
return tree.tree.Size() == 0
}
-// Remove removes the node from the tree by key.
-// Key should adhere to the comparator's type assertion, otherwise method panics.
-func (tree *RedBlackTree) Remove(key interface{}) (value interface{}) {
+// Remove removes the node from the tree by `key`, and returns its associated value of `key`.
+// The given `key` should adhere to the comparator's type assertion, otherwise method panics.
+func (tree *RedBlackTree) Remove(key any) (value any) {
tree.mu.Lock()
defer tree.mu.Unlock()
return tree.doRemove(key)
}
-// Removes batch deletes values of the tree by `keys`.
-func (tree *RedBlackTree) Removes(keys []interface{}) {
+// Removes batch deletes key-value pairs from the tree by `keys`.
+func (tree *RedBlackTree) Removes(keys []any) {
tree.mu.Lock()
defer tree.mu.Unlock()
for _, key := range keys {
@@ -258,22 +266,22 @@ func (tree *RedBlackTree) Clear() {
tree.tree.Clear()
}
-// Keys returns all keys in asc order.
-func (tree *RedBlackTree) Keys() []interface{} {
+// Keys returns all keys from the tree in order by its comparator.
+func (tree *RedBlackTree) Keys() []any {
tree.mu.RLock()
defer tree.mu.RUnlock()
return tree.tree.Keys()
}
-// Values returns all values in asc order based on the key.
-func (tree *RedBlackTree) Values() []interface{} {
+// Values returns all values from the true in order by its comparator based on the key.
+func (tree *RedBlackTree) Values() []any {
tree.mu.RLock()
defer tree.mu.RUnlock()
return tree.tree.Values()
}
-// Replace the data of the tree with given `data`.
-func (tree *RedBlackTree) Replace(data map[interface{}]interface{}) {
+// Replace clears the data of the tree and sets the nodes by given `data`.
+func (tree *RedBlackTree) Replace(data map[any]any) {
tree.mu.Lock()
defer tree.mu.Unlock()
tree.tree.Clear()
@@ -301,24 +309,20 @@ func (tree *RedBlackTree) MarshalJSON() (jsonBytes []byte, err error) {
return tree.tree.MarshalJSON()
}
-// Map returns all key-value items as map.
-func (tree *RedBlackTree) Map() map[interface{}]interface{} {
- tree.mu.RLock()
- defer tree.mu.RUnlock()
- m := make(map[interface{}]interface{}, tree.Size())
- tree.IteratorAsc(func(key, value interface{}) bool {
+// Map returns all key-value pairs as map.
+func (tree *RedBlackTree) Map() map[any]any {
+ m := make(map[any]any, tree.Size())
+ tree.IteratorAsc(func(key, value any) bool {
m[key] = value
return true
})
return m
}
-// MapStrAny returns all key-value items as map[string]interface{}.
-func (tree *RedBlackTree) MapStrAny() map[string]interface{} {
- tree.mu.RLock()
- defer tree.mu.RUnlock()
- m := make(map[string]interface{}, tree.Size())
- tree.IteratorAsc(func(key, value interface{}) bool {
+// MapStrAny returns all key-value items as map[string]any.
+func (tree *RedBlackTree) MapStrAny() map[string]any {
+ m := make(map[string]any, tree.Size())
+ tree.IteratorAsc(func(key, value any) bool {
m[gconv.String(key)] = value
return true
})
@@ -326,39 +330,48 @@ func (tree *RedBlackTree) MapStrAny() map[string]interface{} {
}
// Iterator is alias of IteratorAsc.
-func (tree *RedBlackTree) Iterator(f func(key, value interface{}) bool) {
+//
+// Also see IteratorAsc.
+func (tree *RedBlackTree) Iterator(f func(key, value any) bool) {
tree.IteratorAsc(f)
}
// IteratorFrom is alias of IteratorAscFrom.
-func (tree *RedBlackTree) IteratorFrom(key interface{}, match bool, f func(key, value interface{}) bool) {
+//
+// Also see IteratorAscFrom.
+func (tree *RedBlackTree) IteratorFrom(key any, match bool, f func(key, value any) bool) {
tree.IteratorAscFrom(key, match, f)
}
// IteratorAsc iterates the tree readonly in ascending order with given callback function `f`.
-// If `f` returns true, then it continues iterating; or false to stop.
-func (tree *RedBlackTree) IteratorAsc(f func(key, value interface{}) bool) {
+// If callback function `f` returns true, then it continues iterating; or false to stop.
+func (tree *RedBlackTree) IteratorAsc(f func(key, value any) bool) {
tree.mu.RLock()
defer tree.mu.RUnlock()
- it := tree.tree.Iterator()
+ var (
+ ok bool
+ it = tree.tree.Iterator()
+ )
for it.Begin(); it.Next(); {
index, value := it.Key(), it.Value()
- if ok := f(index, value); !ok {
+ if ok = f(index, value); !ok {
break
}
}
}
// IteratorAscFrom iterates the tree readonly in ascending order with given callback function `f`.
-// The parameter `key` specifies the start entry for iterating. The `match` specifies whether
-// starting iterating if the `key` is fully matched, or else using index searching iterating.
-// If `f` returns true, then it continues iterating; or false to stop.
-func (tree *RedBlackTree) IteratorAscFrom(key interface{}, match bool, f func(key, value interface{}) bool) {
+//
+// The parameter `key` specifies the start entry for iterating.
+// The parameter `match` specifies whether starting iterating only if the `key` is fully matched, or else using index
+// searching iterating.
+// If callback function `f` returns true, then it continues iterating; or false to stop.
+func (tree *RedBlackTree) IteratorAscFrom(key any, match bool, f func(key, value any) bool) {
tree.mu.RLock()
defer tree.mu.RUnlock()
var keys = tree.tree.Keys()
- index, isIterator := tree.iteratorFromGetIndex(key, keys, match)
- if !isIterator {
+ index, canIterator := iteratorFromGetIndex(key, keys, match)
+ if !canIterator {
return
}
for ; index < len(keys); index++ {
@@ -367,29 +380,35 @@ func (tree *RedBlackTree) IteratorAscFrom(key interface{}, match bool, f func(ke
}
// IteratorDesc iterates the tree readonly in descending order with given callback function `f`.
-// If `f` returns true, then it continues iterating; or false to stop.
-func (tree *RedBlackTree) IteratorDesc(f func(key, value interface{}) bool) {
+//
+// If callback function `f` returns true, then it continues iterating; or false to stop.
+func (tree *RedBlackTree) IteratorDesc(f func(key, value any) bool) {
tree.mu.RLock()
defer tree.mu.RUnlock()
- it := tree.tree.Iterator()
+ var (
+ ok bool
+ it = tree.tree.Iterator()
+ )
for it.End(); it.Prev(); {
index, value := it.Key(), it.Value()
- if ok := f(index, value); !ok {
+ if ok = f(index, value); !ok {
break
}
}
}
// IteratorDescFrom iterates the tree readonly in descending order with given callback function `f`.
-// The parameter `key` specifies the start entry for iterating. The `match` specifies whether
-// starting iterating if the `key` is fully matched, or else using index searching iterating.
-// If `f` returns true, then it continues iterating; or false to stop.
-func (tree *RedBlackTree) IteratorDescFrom(key interface{}, match bool, f func(key, value interface{}) bool) {
+//
+// The parameter `key` specifies the start entry for iterating.
+// The parameter `match` specifies whether starting iterating only if the `key` is fully matched, or else using index
+// searching iterating.
+// If callback function `f` returns true, then it continues iterating; or false to stop.
+func (tree *RedBlackTree) IteratorDescFrom(key any, match bool, f func(key, value any) bool) {
tree.mu.RLock()
defer tree.mu.RUnlock()
var keys = tree.tree.Keys()
- index, isIterator := tree.iteratorFromGetIndex(key, keys, match)
- if !isIterator {
+ index, canIterator := iteratorFromGetIndex(key, keys, match)
+ if !canIterator {
return
}
for ; index >= 0; index-- {
@@ -397,8 +416,7 @@ func (tree *RedBlackTree) IteratorDescFrom(key interface{}, match bool, f func(k
}
}
-// Left returns the minimum element of the AVL tree
-// or nil if the tree is empty.
+// Left returns the minimum element corresponding to the comparator of the tree or nil if the tree is empty.
func (tree *RedBlackTree) Left() *RedBlackTreeNode {
tree.mu.RLock()
defer tree.mu.RUnlock()
@@ -412,8 +430,7 @@ func (tree *RedBlackTree) Left() *RedBlackTreeNode {
}
}
-// Right returns the maximum element of the AVL tree
-// or nil if the tree is empty.
+// Right returns the maximum element corresponding to the comparator of the tree or nil if the tree is empty.
func (tree *RedBlackTree) Right() *RedBlackTreeNode {
tree.mu.RLock()
defer tree.mu.RUnlock()
@@ -427,15 +444,15 @@ func (tree *RedBlackTree) Right() *RedBlackTreeNode {
}
}
-// Floor Finds floor node of the input key, return the floor node or nil if no floor node is found.
-// Second return parameter is true if floor was found, otherwise false.
+// Floor Finds floor node of the input key, returns the floor node or nil if no floor node is found.
+// The second returned parameter `found` is true if floor was found, otherwise false.
//
// Floor node is defined as the largest node that is smaller than or equal to the given node.
// A floor node may not be found, either because the tree is empty, or because
// all nodes in the tree is larger than the given node.
//
// Key should adhere to the comparator's type assertion, otherwise method panics.
-func (tree *RedBlackTree) Floor(key interface{}) (floor *RedBlackTreeNode, found bool) {
+func (tree *RedBlackTree) Floor(key any) (floor *RedBlackTreeNode, found bool) {
tree.mu.RLock()
defer tree.mu.RUnlock()
node, found := tree.tree.Floor(key)
@@ -448,15 +465,15 @@ func (tree *RedBlackTree) Floor(key interface{}) (floor *RedBlackTreeNode, found
}, true
}
-// Ceiling finds ceiling node of the input key, return the ceiling node or nil if no ceiling node is found.
-// Second return parameter is true if ceiling was found, otherwise false.
+// Ceiling finds ceiling node of the input key, returns the ceiling node or nil if no ceiling node is found.
+// The second return parameter `found` is true if ceiling was found, otherwise false.
//
// Ceiling node is defined as the smallest node that is larger than or equal to the given node.
// A ceiling node may not be found, either because the tree is empty, or because
// all nodes in the tree is smaller than the given node.
//
// Key should adhere to the comparator's type assertion, otherwise method panics.
-func (tree *RedBlackTree) Ceiling(key interface{}) (ceiling *RedBlackTreeNode, found bool) {
+func (tree *RedBlackTree) Ceiling(key any) (ceiling *RedBlackTreeNode, found bool) {
tree.mu.RLock()
defer tree.mu.RUnlock()
node, found := tree.tree.Ceiling(key)
@@ -474,14 +491,14 @@ func (tree *RedBlackTree) Ceiling(key interface{}) (ceiling *RedBlackTreeNode, f
// or else the comparator would panic.
//
// If the type of value is different with key, you pass the new `comparator`.
-func (tree *RedBlackTree) Flip(comparator ...func(v1, v2 interface{}) int) {
+func (tree *RedBlackTree) Flip(comparator ...func(v1, v2 any) int) {
var t = new(RedBlackTree)
if len(comparator) > 0 {
t = NewRedBlackTree(comparator[0], tree.mu.IsSafe())
} else {
t = NewRedBlackTree(tree.comparator, tree.mu.IsSafe())
}
- tree.IteratorAsc(func(key, value interface{}) bool {
+ tree.IteratorAsc(func(key, value any) bool {
t.doSet(value, key)
return true
})
@@ -497,7 +514,7 @@ func (tree *RedBlackTree) UnmarshalJSON(b []byte) error {
tree.comparator = gutil.ComparatorString
tree.tree = redblacktree.NewWith(tree.comparator)
}
- var data map[string]interface{}
+ var data map[string]any
if err := json.UnmarshalUseNumber(b, &data); err != nil {
return err
}
@@ -508,7 +525,7 @@ func (tree *RedBlackTree) UnmarshalJSON(b []byte) error {
}
// UnmarshalValue is an interface implement which sets any type of value for map.
-func (tree *RedBlackTree) UnmarshalValue(value interface{}) (err error) {
+func (tree *RedBlackTree) UnmarshalValue(value any) (err error) {
tree.mu.Lock()
defer tree.mu.Unlock()
if tree.comparator == nil {
@@ -521,9 +538,13 @@ func (tree *RedBlackTree) UnmarshalValue(value interface{}) (err error) {
return
}
-// doSet sets key-value pair to the tree.
-func (tree *RedBlackTree) doSet(key, value interface{}) interface{} {
- if f, ok := value.(func() interface{}); ok {
+// doSet inserts key-value pair node into the tree without lock.
+// If `key` already exists, then its value is updated with the new value.
+// If `value` is type of , it will be executed and its return value will be set to the map with `key`.
+//
+// It returns value with given `key`.
+func (tree *RedBlackTree) doSet(key, value any) any {
+ if f, ok := value.(func() any); ok {
value = f()
}
if value == nil {
@@ -533,35 +554,15 @@ func (tree *RedBlackTree) doSet(key, value interface{}) interface{} {
return value
}
-// doGet retrieves and returns the value of given key from tree.
-func (tree *RedBlackTree) doGet(key interface{}) (value interface{}, found bool) {
+// doGet retrieves and returns the value of given key from tree without lock.
+func (tree *RedBlackTree) doGet(key any) (value any, found bool) {
return tree.tree.Get(key)
}
-// doRemove removes key from tree.
-func (tree *RedBlackTree) doRemove(key interface{}) (value interface{}) {
+// doRemove removes key from tree and returns its associated value without lock.
+// Note that, the given `key` should adhere to the comparator's type assertion, otherwise method panics.
+func (tree *RedBlackTree) doRemove(key any) (value any) {
value, _ = tree.tree.Get(key)
tree.tree.Remove(key)
return
}
-
-// iteratorFromGetIndex returns the index of the key in the keys slice.
-// The parameter `match` specifies whether starting iterating if the `key` is fully matched,
-// or else using index searching iterating.
-// If `isIterator` is true, iterator is available; or else not.
-func (tree *RedBlackTree) iteratorFromGetIndex(key interface{}, keys []interface{}, match bool) (index int, isIterator bool) {
- if match {
- for i, k := range keys {
- if k == key {
- isIterator = true
- index = i
- }
- }
- } else {
- if i, ok := key.(int); ok {
- isIterator = true
- index = i
- }
- }
- return
-}
diff --git a/contrib/config/apollo/apollo.go b/contrib/config/apollo/apollo.go
index 21b8cb800..3c967c775 100644
--- a/contrib/config/apollo/apollo.go
+++ b/contrib/config/apollo/apollo.go
@@ -13,6 +13,7 @@ import (
"github.com/apolloconfig/agollo/v4"
apolloConfig "github.com/apolloconfig/agollo/v4/env/config"
"github.com/apolloconfig/agollo/v4/storage"
+
"github.com/gogf/gf/v2/encoding/gjson"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/frame/g"
diff --git a/contrib/config/apollo/go.mod b/contrib/config/apollo/go.mod
index e99fbdefe..5f46be8af 100644
--- a/contrib/config/apollo/go.mod
+++ b/contrib/config/apollo/go.mod
@@ -1,21 +1,21 @@
module github.com/gogf/gf/contrib/config/apollo/v2
-go 1.18
+go 1.20
require (
github.com/apolloconfig/agollo/v4 v4.3.1
- github.com/gogf/gf/v2 v2.7.2
+ github.com/gogf/gf/v2 v2.8.1
)
require (
- github.com/BurntSushi/toml v1.3.2 // indirect
+ github.com/BurntSushi/toml v1.4.0 // indirect
github.com/clbanning/mxj/v2 v2.7.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
- github.com/fatih/color v1.16.0 // indirect
+ github.com/fatih/color v1.17.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
- github.com/go-logr/logr v1.2.4 // indirect
+ github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
- github.com/gorilla/websocket v1.5.1 // indirect
+ github.com/gorilla/websocket v1.5.3 // indirect
github.com/grokify/html-strip-tags-go v0.1.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
@@ -25,19 +25,20 @@ require (
github.com/mitchellh/mapstructure v1.4.1 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/pelletier/go-toml v1.9.3 // indirect
- github.com/rivo/uniseg v0.4.4 // indirect
+ github.com/rivo/uniseg v0.4.7 // indirect
github.com/spf13/afero v1.6.0 // indirect
github.com/spf13/cast v1.3.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.8.1 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
- go.opentelemetry.io/otel v1.14.0 // indirect
- go.opentelemetry.io/otel/sdk v1.14.0 // indirect
- go.opentelemetry.io/otel/trace v1.14.0 // indirect
- golang.org/x/net v0.24.0 // indirect
- golang.org/x/sys v0.19.0 // indirect
- golang.org/x/text v0.14.0 // indirect
+ go.opentelemetry.io/otel v1.24.0 // indirect
+ go.opentelemetry.io/otel/metric v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.24.0 // indirect
+ go.opentelemetry.io/otel/trace v1.24.0 // indirect
+ golang.org/x/net v0.27.0 // indirect
+ golang.org/x/sys v0.22.0 // indirect
+ golang.org/x/text v0.16.0 // indirect
gopkg.in/ini.v1 v1.62.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
diff --git a/contrib/config/apollo/go.sum b/contrib/config/apollo/go.sum
index fc0b24bd1..8b79d4e4c 100644
--- a/contrib/config/apollo/go.sum
+++ b/contrib/config/apollo/go.sum
@@ -38,8 +38,8 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
-github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
-github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
+github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
+github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/apolloconfig/agollo/v4 v4.3.1 h1:NHjd7KqOPmTvYwJidISc9MPBRO8m9UNrH3tijcEVNAY=
@@ -74,8 +74,8 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.m
github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
-github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
-github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
+github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
+github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
@@ -84,8 +84,8 @@ github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
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/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
+github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
@@ -132,7 +132,7 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
+github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/gofuzz v1.0.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=
@@ -154,8 +154,8 @@ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
-github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
-github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
+github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
+github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grokify/html-strip-tags-go v0.1.0 h1:03UrQLjAny8xci+R+qjCce/MYnpNXCtgzltlQbOBae4=
github.com/grokify/html-strip-tags-go v0.1.0/go.mod h1:ZdzgfHEzAfz9X6Xe5eBLVblWIxXfYSQ40S/VKrAOGpc=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
@@ -233,8 +233,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
-github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
-github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
+github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
+github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
@@ -260,7 +260,7 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
-github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
+github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/tevid/gohamcrest v1.1.1 h1:ou+xSqlIw1xfGTg1uq1nif/htZ2S3EzRqLm2BP+tYU0=
@@ -280,12 +280,14 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
-go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM=
-go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU=
-go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY=
-go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM=
-go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M=
-go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo=
@@ -367,8 +369,8 @@ golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v
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=
-golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
-golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
+golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
+golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -435,8 +437,8 @@ golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
-golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
+golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -445,8 +447,8 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
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.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
-golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
+golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
+golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
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=
diff --git a/contrib/config/consul/go.mod b/contrib/config/consul/go.mod
index 7a0bfa298..e87661382 100644
--- a/contrib/config/consul/go.mod
+++ b/contrib/config/consul/go.mod
@@ -1,23 +1,23 @@
module github.com/gogf/gf/contrib/config/consul/v2
-go 1.18
+go 1.20
require (
- github.com/gogf/gf/v2 v2.7.2
+ github.com/gogf/gf/v2 v2.8.1
github.com/hashicorp/consul/api v1.24.0
github.com/hashicorp/go-cleanhttp v0.5.2
)
require (
- github.com/BurntSushi/toml v1.3.2 // indirect
+ github.com/BurntSushi/toml v1.4.0 // indirect
github.com/armon/go-metrics v0.4.1 // indirect
github.com/clbanning/mxj/v2 v2.7.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
- github.com/fatih/color v1.16.0 // indirect
+ github.com/fatih/color v1.17.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
- github.com/go-logr/logr v1.2.4 // indirect
+ github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
- github.com/gorilla/websocket v1.5.1 // indirect
+ github.com/gorilla/websocket v1.5.3 // indirect
github.com/grokify/html-strip-tags-go v0.1.0 // indirect
github.com/hashicorp/go-hclog v1.5.0 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
@@ -31,14 +31,15 @@ require (
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
- github.com/rivo/uniseg v0.4.4 // indirect
- go.opentelemetry.io/otel v1.14.0 // indirect
- go.opentelemetry.io/otel/sdk v1.14.0 // indirect
- go.opentelemetry.io/otel/trace v1.14.0 // indirect
+ github.com/rivo/uniseg v0.4.7 // indirect
+ go.opentelemetry.io/otel v1.24.0 // indirect
+ go.opentelemetry.io/otel/metric v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.24.0 // indirect
+ go.opentelemetry.io/otel/trace v1.24.0 // indirect
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 // indirect
- golang.org/x/net v0.24.0 // indirect
- golang.org/x/sys v0.19.0 // indirect
- golang.org/x/text v0.14.0 // indirect
+ golang.org/x/net v0.27.0 // indirect
+ golang.org/x/sys v0.22.0 // indirect
+ golang.org/x/text v0.16.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/contrib/config/consul/go.sum b/contrib/config/consul/go.sum
index e454b60ac..c3ca809b5 100644
--- a/contrib/config/consul/go.sum
+++ b/contrib/config/consul/go.sum
@@ -1,5 +1,5 @@
-github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
-github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
+github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
+github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
@@ -28,8 +28,8 @@ github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FM
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
-github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
-github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
+github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
+github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
@@ -37,8 +37,8 @@ github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
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/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
+github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
@@ -50,10 +50,10 @@ github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Z
github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
+github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
-github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
-github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
+github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
+github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grokify/html-strip-tags-go v0.1.0 h1:03UrQLjAny8xci+R+qjCce/MYnpNXCtgzltlQbOBae4=
github.com/grokify/html-strip-tags-go v0.1.0/go.mod h1:ZdzgfHEzAfz9X6Xe5eBLVblWIxXfYSQ40S/VKrAOGpc=
github.com/hashicorp/consul/api v1.24.0 h1:u2XyStA2j0jnCiVUU7Qyrt8idjRn4ORhK6DlvZ3bWhA=
@@ -162,8 +162,8 @@ github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
-github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
-github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
+github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
+github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
@@ -176,14 +176,16 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals=
-github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY=
+github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM=
-go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM=
-go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU=
-go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY=
-go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM=
-go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M=
-go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY=
@@ -196,8 +198,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8=
-golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
-golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
+golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
+golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -224,15 +226,15 @@ golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
-golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
+golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
-golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
-golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
+golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
+golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
diff --git a/contrib/config/kubecm/go.mod b/contrib/config/kubecm/go.mod
index ae176aa28..e6874aff1 100644
--- a/contrib/config/kubecm/go.mod
+++ b/contrib/config/kubecm/go.mod
@@ -1,23 +1,23 @@
module github.com/gogf/gf/contrib/config/kubecm/v2
-go 1.18
+go 1.20
require (
- github.com/gogf/gf/v2 v2.7.2
+ github.com/gogf/gf/v2 v2.8.1
k8s.io/api v0.27.4
k8s.io/apimachinery v0.27.4
k8s.io/client-go v0.27.4
)
require (
- github.com/BurntSushi/toml v1.3.2 // indirect
+ github.com/BurntSushi/toml v1.4.0 // indirect
github.com/clbanning/mxj/v2 v2.7.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
- github.com/fatih/color v1.16.0 // indirect
+ github.com/fatih/color v1.17.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
- github.com/go-logr/logr v1.2.4 // indirect
+ github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.1 // indirect
@@ -25,10 +25,10 @@ require (
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
- github.com/google/go-cmp v0.5.9 // indirect
+ github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/uuid v1.3.0 // indirect
- github.com/gorilla/websocket v1.5.1 // indirect
+ github.com/gorilla/websocket v1.5.3 // indirect
github.com/grokify/html-strip-tags-go v0.1.0 // indirect
github.com/imdario/mergo v0.3.6 // indirect
github.com/josharian/intern v1.0.0 // indirect
@@ -42,19 +42,20 @@ require (
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
- github.com/rivo/uniseg v0.4.4 // indirect
+ github.com/rivo/uniseg v0.4.7 // indirect
github.com/spf13/pflag v1.0.5 // indirect
- go.opentelemetry.io/otel v1.14.0 // indirect
- go.opentelemetry.io/otel/sdk v1.14.0 // indirect
- go.opentelemetry.io/otel/trace v1.14.0 // indirect
- golang.org/x/net v0.24.0 // indirect
+ go.opentelemetry.io/otel v1.24.0 // indirect
+ go.opentelemetry.io/otel/metric v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.24.0 // indirect
+ go.opentelemetry.io/otel/trace v1.24.0 // indirect
+ golang.org/x/net v0.27.0 // indirect
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect
- golang.org/x/sys v0.19.0 // indirect
- golang.org/x/term v0.19.0 // indirect
- golang.org/x/text v0.14.0 // indirect
+ golang.org/x/sys v0.22.0 // indirect
+ golang.org/x/term v0.22.0 // indirect
+ golang.org/x/text v0.16.0 // indirect
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
google.golang.org/appengine v1.6.7 // indirect
- google.golang.org/protobuf v1.28.1 // indirect
+ google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
diff --git a/contrib/config/kubecm/go.sum b/contrib/config/kubecm/go.sum
index 29d454b17..ab817bc23 100644
--- a/contrib/config/kubecm/go.sum
+++ b/contrib/config/kubecm/go.sum
@@ -32,8 +32,8 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
-github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
-github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
+github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
+github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
@@ -56,8 +56,8 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
-github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
-github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
+github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
+github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
@@ -65,8 +65,8 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-logr/logr v1.2.0/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/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
+github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE=
@@ -118,8 +118,8 @@ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5/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-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
+github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g=
github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
@@ -138,8 +138,8 @@ github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
-github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
-github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
+github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
+github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grokify/html-strip-tags-go v0.1.0 h1:03UrQLjAny8xci+R+qjCce/MYnpNXCtgzltlQbOBae4=
github.com/grokify/html-strip-tags-go v0.1.0/go.mod h1:ZdzgfHEzAfz9X6Xe5eBLVblWIxXfYSQ40S/VKrAOGpc=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
@@ -190,8 +190,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
-github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
-github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
+github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
+github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
@@ -206,7 +206,7 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5
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/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
-github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
+github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
@@ -216,12 +216,14 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
-go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM=
-go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU=
-go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY=
-go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM=
-go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M=
-go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
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=
@@ -285,8 +287,8 @@ golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81R
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
-golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
-golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
+golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
+golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -333,19 +335,19 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
-golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
+golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
-golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q=
-golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk=
+golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk=
+golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
-golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
-golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
+golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
+golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
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=
@@ -393,7 +395,7 @@ golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc
golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
-golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4=
+golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
@@ -476,8 +478,8 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
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.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w=
-google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
+google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
+google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
diff --git a/contrib/config/kubecm/kubecm.go b/contrib/config/kubecm/kubecm.go
index a110193cf..2be721d61 100644
--- a/contrib/config/kubecm/kubecm.go
+++ b/contrib/config/kubecm/kubecm.go
@@ -138,7 +138,7 @@ func (c *Client) doUpdate(ctx context.Context, namespace string) (err error) {
)
}
var j *gjson.Json
- if j, err = gjson.LoadContent(cm.Data[c.config.DataItem]); err != nil {
+ if j, err = gjson.LoadContent([]byte(cm.Data[c.config.DataItem])); err != nil {
return gerror.Wrapf(
err,
`parse config map item from %s[%s] failed`, c.config.ConfigMap, c.config.DataItem,
diff --git a/contrib/config/nacos/go.mod b/contrib/config/nacos/go.mod
index 44d66f071..02ab8739d 100644
--- a/contrib/config/nacos/go.mod
+++ b/contrib/config/nacos/go.mod
@@ -1,14 +1,14 @@
module github.com/gogf/gf/contrib/config/nacos/v2
-go 1.18
+go 1.20
require (
- github.com/gogf/gf/v2 v2.7.2
+ github.com/gogf/gf/v2 v2.8.1
github.com/nacos-group/nacos-sdk-go/v2 v2.2.5
)
require (
- github.com/BurntSushi/toml v1.3.2 // indirect
+ github.com/BurntSushi/toml v1.4.0 // indirect
github.com/alibabacloud-go/debug v0.0.0-20190504072949-9472017b5c68 // indirect
github.com/alibabacloud-go/tea v1.1.17 // indirect
github.com/alibabacloud-go/tea-utils v1.4.4 // indirect
@@ -20,13 +20,13 @@ require (
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/clbanning/mxj/v2 v2.7.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
- github.com/fatih/color v1.16.0 // indirect
+ github.com/fatih/color v1.17.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
- github.com/go-logr/logr v1.2.4 // indirect
+ github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
- github.com/gorilla/websocket v1.5.1 // indirect
+ github.com/gorilla/websocket v1.5.3 // indirect
github.com/grokify/html-strip-tags-go v0.1.0 // indirect
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af // indirect
github.com/json-iterator/go v1.1.12 // indirect
@@ -44,22 +44,23 @@ require (
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.32.1 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
- github.com/rivo/uniseg v0.4.4 // indirect
- go.opentelemetry.io/otel v1.14.0 // indirect
- go.opentelemetry.io/otel/sdk v1.14.0 // indirect
- go.opentelemetry.io/otel/trace v1.14.0 // indirect
+ github.com/rivo/uniseg v0.4.7 // indirect
+ go.opentelemetry.io/otel v1.24.0 // indirect
+ go.opentelemetry.io/otel/metric v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.24.0 // indirect
+ go.opentelemetry.io/otel/trace v1.24.0 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.21.0 // indirect
- golang.org/x/crypto v0.22.0 // indirect
- golang.org/x/net v0.24.0 // indirect
- golang.org/x/sync v0.4.0 // indirect
- golang.org/x/sys v0.19.0 // indirect
- golang.org/x/text v0.14.0 // indirect
+ golang.org/x/crypto v0.25.0 // indirect
+ golang.org/x/net v0.27.0 // indirect
+ golang.org/x/sync v0.7.0 // indirect
+ golang.org/x/sys v0.22.0 // indirect
+ golang.org/x/text v0.16.0 // indirect
golang.org/x/time v0.1.0 // indirect
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
google.golang.org/grpc v1.56.3 // indirect
- google.golang.org/protobuf v1.30.0 // indirect
+ google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
diff --git a/contrib/config/nacos/go.sum b/contrib/config/nacos/go.sum
index 48205cb2c..ccb081682 100644
--- a/contrib/config/nacos/go.sum
+++ b/contrib/config/nacos/go.sum
@@ -32,8 +32,8 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
-github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
-github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
+github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
+github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo=
github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw=
@@ -86,8 +86,8 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
-github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
-github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
+github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
+github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
@@ -101,8 +101,8 @@ github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
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/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
+github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
@@ -151,7 +151,7 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
+github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/gofuzz v1.0.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=
@@ -165,8 +165,8 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
-github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
-github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
+github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
+github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grokify/html-strip-tags-go v0.1.0 h1:03UrQLjAny8xci+R+qjCce/MYnpNXCtgzltlQbOBae4=
github.com/grokify/html-strip-tags-go v0.1.0/go.mod h1:ZdzgfHEzAfz9X6Xe5eBLVblWIxXfYSQ40S/VKrAOGpc=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
@@ -253,8 +253,8 @@ github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1
github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU=
github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
-github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
-github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
+github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
+github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
@@ -266,7 +266,7 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
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.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
+github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/uber/jaeger-client-go v2.30.0+incompatible h1:D6wyKGCecFaSRUpo8lCVbaOOb6ThwMmTEbhRwtKR97o=
github.com/uber/jaeger-client-go v2.30.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk=
github.com/uber/jaeger-lib v2.4.1+incompatible h1:td4jdvLcExb4cBISKIpHuGoVXh+dVKhn2Um6rjCsSsg=
@@ -280,12 +280,14 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
-go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM=
-go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU=
-go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY=
-go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM=
-go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M=
-go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ=
@@ -303,8 +305,8 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
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.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30=
-golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M=
+golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30=
+golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M=
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=
@@ -370,8 +372,8 @@ golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81R
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
-golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
-golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
+golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
+golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -388,8 +390,8 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/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.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ=
-golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
+golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
+golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -430,8 +432,8 @@ golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
-golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
+golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -439,8 +441,8 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
-golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
-golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
+golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
+golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
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=
@@ -577,8 +579,8 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
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.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
-google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
+google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
+google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
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=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
diff --git a/contrib/config/nacos/nacos.go b/contrib/config/nacos/nacos.go
index 0314b3665..5327b9d6e 100644
--- a/contrib/config/nacos/nacos.go
+++ b/contrib/config/nacos/nacos.go
@@ -114,7 +114,7 @@ func (c *Client) updateLocalValue() (err error) {
func (c *Client) doUpdate(content string) (err error) {
var j *gjson.Json
- if j, err = gjson.LoadContent(content); err != nil {
+ if j, err = gjson.LoadContent([]byte(content)); err != nil {
return gerror.Wrap(err, `parse config map item from nacos failed`)
}
c.value.Set(j)
diff --git a/contrib/config/polaris/go.mod b/contrib/config/polaris/go.mod
index 78f92eb39..82d374c0e 100644
--- a/contrib/config/polaris/go.mod
+++ b/contrib/config/polaris/go.mod
@@ -1,26 +1,26 @@
module github.com/gogf/gf/contrib/config/polaris/v2
-go 1.18
+go 1.20
require (
- github.com/gogf/gf/v2 v2.7.2
- github.com/polarismesh/polaris-go v1.5.5
+ github.com/gogf/gf/v2 v2.8.1
+ github.com/polarismesh/polaris-go v1.5.8
)
require (
- github.com/BurntSushi/toml v1.3.2 // indirect
+ github.com/BurntSushi/toml v1.4.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/clbanning/mxj/v2 v2.7.0 // indirect
github.com/dlclark/regexp2 v1.7.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
- github.com/fatih/color v1.16.0 // indirect
+ github.com/fatih/color v1.17.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
- github.com/go-logr/logr v1.2.4 // indirect
+ github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
- github.com/golang/protobuf v1.5.3 // indirect
+ github.com/golang/protobuf v1.5.4 // indirect
github.com/google/uuid v1.3.1 // indirect
- github.com/gorilla/websocket v1.5.1 // indirect
+ github.com/gorilla/websocket v1.5.3 // indirect
github.com/grokify/html-strip-tags-go v0.1.0 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
@@ -39,20 +39,21 @@ require (
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.32.1 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
- github.com/rivo/uniseg v0.4.4 // indirect
+ github.com/rivo/uniseg v0.4.7 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
- go.opentelemetry.io/otel v1.14.0 // indirect
- go.opentelemetry.io/otel/sdk v1.14.0 // indirect
- go.opentelemetry.io/otel/trace v1.14.0 // indirect
+ go.opentelemetry.io/otel v1.24.0 // indirect
+ go.opentelemetry.io/otel/metric v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.24.0 // indirect
+ go.opentelemetry.io/otel/trace v1.24.0 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.21.0 // indirect
- golang.org/x/net v0.24.0 // indirect
- golang.org/x/sys v0.19.0 // indirect
- golang.org/x/text v0.14.0 // indirect
+ golang.org/x/net v0.27.0 // indirect
+ golang.org/x/sys v0.22.0 // indirect
+ golang.org/x/text v0.16.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
- google.golang.org/grpc v1.59.0 // indirect
- google.golang.org/protobuf v1.31.0 // indirect
+ google.golang.org/grpc v1.56.3 // indirect
+ google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/contrib/config/polaris/go.sum b/contrib/config/polaris/go.sum
index f520733dd..6a99e16ad 100644
--- a/contrib/config/polaris/go.sum
+++ b/contrib/config/polaris/go.sum
@@ -168,8 +168,8 @@ cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1V
cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
-github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
-github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
+github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
+github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/agiledragon/gomonkey v2.0.2+incompatible h1:eXKi9/piiC3cjJD1658mEE2o3NjkJ5vDLgYjCQu0Xlw=
@@ -224,8 +224,8 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.m
github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0=
github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
-github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
-github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
+github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
+github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
@@ -239,8 +239,8 @@ github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
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/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
+github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
@@ -275,8 +275,8 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw
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/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/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
+github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/gonum/blas v0.0.0-20181208220705-f22b278b28ac/go.mod h1:P32wAyui1PQ58Oce/KYkOqQv8cVw1zAapXOl+dRFGbc=
github.com/gonum/floats v0.0.0-20181209220543-c233463c7e82/go.mod h1:PxC8OnwL11+aosOB5+iEPoV3picfs8tUpkVd0pDo+Kg=
@@ -301,7 +301,7 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
-github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
+github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/gofuzz v1.0.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=
@@ -339,8 +339,8 @@ github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqE
github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
-github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
-github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
+github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
+github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grokify/html-strip-tags-go v0.1.0 h1:03UrQLjAny8xci+R+qjCce/MYnpNXCtgzltlQbOBae4=
github.com/grokify/html-strip-tags-go v0.1.0/go.mod h1:ZdzgfHEzAfz9X6Xe5eBLVblWIxXfYSQ40S/VKrAOGpc=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
@@ -405,8 +405,8 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
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/polarismesh/polaris-go v1.5.5 h1:TUxgla21J9Zb3zSynoAA9og0+sYJZ7TpZ2aFwzH7woI=
-github.com/polarismesh/polaris-go v1.5.5/go.mod h1:CuXO9bhHGjSoOIMWr4NXf3bJAkRBp5YoM7ibBzENC+c=
+github.com/polarismesh/polaris-go v1.5.8 h1:zBZkZBa4wVxsG5Y/6U4PmY9dY/mddXdfNI65edVu6U8=
+github.com/polarismesh/polaris-go v1.5.8/go.mod h1:CuXO9bhHGjSoOIMWr4NXf3bJAkRBp5YoM7ibBzENC+c=
github.com/polarismesh/specification v1.4.1 h1:lTZqeyUhhWuKyr6NDKBwmUrNfcUDvKLxWT/uOq71T5A=
github.com/polarismesh/specification v1.4.1/go.mod h1:rDvMMtl5qebPmqiBLNa5Ps0XtwkP31ZLirbH4kXA0YU=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
@@ -432,8 +432,8 @@ github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1
github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU=
github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
-github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
-github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
+github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
+github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
@@ -458,8 +458,8 @@ 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.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
+github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
@@ -473,12 +473,14 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
-go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM=
-go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU=
-go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY=
-go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM=
-go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M=
-go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
@@ -580,8 +582,8 @@ golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
-golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
-golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
+golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
+golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -692,8 +694,8 @@ golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
-golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
+golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
@@ -707,8 +709,8 @@ 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/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
-golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
-golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
+golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
+golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
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=
@@ -960,8 +962,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu
google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI=
google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI=
google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww=
-google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk=
-google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98=
+google.golang.org/grpc v1.56.3 h1:8I4C0Yq1EjstUzUJzpcRVbuYA2mODtEmpWiQoN/b2nc=
+google.golang.org/grpc v1.56.3/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s=
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=
@@ -978,8 +980,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.28.1/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=
+google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
+google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
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=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
diff --git a/contrib/config/polaris/polaris.go b/contrib/config/polaris/polaris.go
index c14a8ff85..04765d659 100644
--- a/contrib/config/polaris/polaris.go
+++ b/contrib/config/polaris/polaris.go
@@ -147,7 +147,7 @@ func (c *Client) doUpdate(ctx context.Context) (err error) {
return gerror.New("config file is empty")
}
var j *gjson.Json
- if j, err = gjson.LoadContent(c.client.GetContent()); err != nil {
+ if j, err = gjson.DecodeToJson([]byte(c.client.GetContent())); err != nil {
return gerror.Wrap(err, `parse config map item from polaris failed`)
}
c.value.Set(j)
diff --git a/contrib/drivers/clickhouse/clickhouse_z_unit_model_test.go b/contrib/drivers/clickhouse/clickhouse_z_unit_model_test.go
index 1d6bbdab4..31600e676 100644
--- a/contrib/drivers/clickhouse/clickhouse_z_unit_model_test.go
+++ b/contrib/drivers/clickhouse/clickhouse_z_unit_model_test.go
@@ -258,6 +258,19 @@ func Test_Model_Count(t *testing.T) {
})
}
+func Test_Model_Exist(t *testing.T) {
+ table := createInitTable()
+ defer dropTable(table)
+ gtest.C(t, func(t *gtest.T) {
+ exist, err := db.Model(table).Exist()
+ t.AssertNil(err)
+ t.Assert(exist, TableSize > 0)
+ exist, err = db.Model(table).Where("id", -1).Exist()
+ t.AssertNil(err)
+ t.Assert(exist, false)
+ })
+}
+
func Test_Model_Where(t *testing.T) {
table := createInitTable()
defer dropTable(table)
diff --git a/contrib/drivers/clickhouse/go.mod b/contrib/drivers/clickhouse/go.mod
index 09d663314..d52ad6820 100644
--- a/contrib/drivers/clickhouse/go.mod
+++ b/contrib/drivers/clickhouse/go.mod
@@ -1,23 +1,23 @@
module github.com/gogf/gf/contrib/drivers/clickhouse/v2
-go 1.18
+go 1.20
require (
github.com/ClickHouse/clickhouse-go/v2 v2.0.15
- github.com/gogf/gf/v2 v2.7.2
+ github.com/gogf/gf/v2 v2.8.1
github.com/google/uuid v1.3.0
github.com/shopspring/decimal v1.3.1
)
require (
- github.com/BurntSushi/toml v1.3.2 // indirect
+ github.com/BurntSushi/toml v1.4.0 // indirect
github.com/clbanning/mxj/v2 v2.7.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
- github.com/fatih/color v1.16.0 // indirect
+ github.com/fatih/color v1.17.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
- github.com/go-logr/logr v1.2.4 // indirect
+ github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
- github.com/gorilla/websocket v1.5.1 // indirect
+ github.com/gorilla/websocket v1.5.3 // indirect
github.com/grokify/html-strip-tags-go v0.1.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
@@ -26,13 +26,14 @@ require (
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/paulmach/orb v0.7.1 // indirect
github.com/pierrec/lz4/v4 v4.1.14 // indirect
- github.com/rivo/uniseg v0.4.4 // indirect
- go.opentelemetry.io/otel v1.14.0 // indirect
- go.opentelemetry.io/otel/sdk v1.14.0 // indirect
- go.opentelemetry.io/otel/trace v1.14.0 // indirect
- golang.org/x/net v0.24.0 // indirect
- golang.org/x/sys v0.19.0 // indirect
- golang.org/x/text v0.14.0 // indirect
+ github.com/rivo/uniseg v0.4.7 // indirect
+ go.opentelemetry.io/otel v1.24.0 // indirect
+ go.opentelemetry.io/otel/metric v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.24.0 // indirect
+ go.opentelemetry.io/otel/trace v1.24.0 // indirect
+ golang.org/x/net v0.27.0 // indirect
+ golang.org/x/sys v0.22.0 // indirect
+ golang.org/x/text v0.16.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/contrib/drivers/clickhouse/go.sum b/contrib/drivers/clickhouse/go.sum
index 1150b98b6..f3ff16e02 100644
--- a/contrib/drivers/clickhouse/go.sum
+++ b/contrib/drivers/clickhouse/go.sum
@@ -1,5 +1,5 @@
-github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
-github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
+github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
+github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/ClickHouse/clickhouse-go v1.5.4/go.mod h1:EaI/sW7Azgz9UATzd5ZdZHRUhHgv5+JMS9NSr2smCJI=
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
github.com/bkaradzic/go-lz4 v1.0.0/go.mod h1:0YdlkowM3VswSROI7qDxhRvJ3sLhlFrRRwjwegp5jy4=
@@ -10,14 +10,14 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
-github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
-github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
+github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
+github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.2.3/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/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
+github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM=
@@ -29,13 +29,13 @@ github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
-github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
+github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ=
github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
-github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
-github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
+github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
+github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grokify/html-strip-tags-go v0.1.0 h1:03UrQLjAny8xci+R+qjCce/MYnpNXCtgzltlQbOBae4=
github.com/grokify/html-strip-tags-go v0.1.0/go.mod h1:ZdzgfHEzAfz9X6Xe5eBLVblWIxXfYSQ40S/VKrAOGpc=
github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks=
@@ -65,8 +65,8 @@ github.com/pierrec/lz4/v4 v4.1.14/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFu
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/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
-github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
-github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
+github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
+github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/shirou/gopsutil v2.19.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc=
@@ -77,20 +77,22 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals=
-github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
+github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk=
github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
go.opentelemetry.io/otel v1.7.0/go.mod h1:5BdUoMIz5WEs0vt0CUEMtSSaTSHBBVwrhnz7+nrD5xk=
-go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM=
-go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU=
-go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY=
-go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
go.opentelemetry.io/otel/trace v1.7.0/go.mod h1:fzLSB9nqR2eXzxPXb2JW9IKE+ScyXA48yyE4TNvoHqU=
-go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M=
-go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
@@ -100,8 +102,8 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
-golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
-golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
+golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
+golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -114,12 +116,12 @@ golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220429233432-b5fbb4746d32/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
-golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
+golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
-golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
-golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
+golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
+golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
diff --git a/contrib/drivers/dm/go.mod b/contrib/drivers/dm/go.mod
index d5fbd55ee..93a472dab 100644
--- a/contrib/drivers/dm/go.mod
+++ b/contrib/drivers/dm/go.mod
@@ -1,36 +1,37 @@
module github.com/gogf/gf/contrib/drivers/dm/v2
-go 1.18
+go 1.20
replace github.com/gogf/gf/v2 => ../../../
require (
gitee.com/chunanyong/dm v1.8.12
- github.com/gogf/gf/v2 v2.7.2
+ github.com/gogf/gf/v2 v2.8.1
)
require (
- github.com/BurntSushi/toml v1.3.2 // indirect
+ github.com/BurntSushi/toml v1.4.0 // indirect
github.com/clbanning/mxj/v2 v2.7.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
- github.com/fatih/color v1.16.0 // indirect
+ github.com/fatih/color v1.17.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
- github.com/go-logr/logr v1.2.4 // indirect
+ github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/golang/snappy v0.0.1 // indirect
- github.com/gorilla/websocket v1.5.1 // indirect
+ github.com/gorilla/websocket v1.5.3 // indirect
github.com/grokify/html-strip-tags-go v0.1.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
- github.com/rivo/uniseg v0.4.4 // indirect
- go.opentelemetry.io/otel v1.14.0 // indirect
- go.opentelemetry.io/otel/sdk v1.14.0 // indirect
- go.opentelemetry.io/otel/trace v1.14.0 // indirect
- golang.org/x/net v0.24.0 // indirect
- golang.org/x/sys v0.19.0 // indirect
- golang.org/x/text v0.14.0 // indirect
+ github.com/rivo/uniseg v0.4.7 // indirect
+ go.opentelemetry.io/otel v1.24.0 // indirect
+ go.opentelemetry.io/otel/metric v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.24.0 // indirect
+ go.opentelemetry.io/otel/trace v1.24.0 // indirect
+ golang.org/x/net v0.27.0 // indirect
+ golang.org/x/sys v0.22.0 // indirect
+ golang.org/x/text v0.16.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/contrib/drivers/dm/go.sum b/contrib/drivers/dm/go.sum
index ac140f02b..08a0ddf30 100644
--- a/contrib/drivers/dm/go.sum
+++ b/contrib/drivers/dm/go.sum
@@ -1,26 +1,26 @@
gitee.com/chunanyong/dm v1.8.12 h1:WupbFZL0MRNIIiCPaLDHgFi5jkdkjzjPReuWPaInGwk=
gitee.com/chunanyong/dm v1.8.12/go.mod h1:EPRJnuPFgbyOFgJ0TRYCTGzhq+ZT4wdyaj/GW/LLcNg=
-github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
-github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
+github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
+github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/clbanning/mxj/v2 v2.7.0 h1:WA/La7UGCanFe5NpHF0Q3DNtnCsVoxbPKuyBNHWRyME=
github.com/clbanning/mxj/v2 v2.7.0/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
-github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
-github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
+github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
+github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
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/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
+github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4=
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
-github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
-github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
-github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
+github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
+github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
+github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grokify/html-strip-tags-go v0.1.0 h1:03UrQLjAny8xci+R+qjCce/MYnpNXCtgzltlQbOBae4=
github.com/grokify/html-strip-tags-go v0.1.0/go.mod h1:ZdzgfHEzAfz9X6Xe5eBLVblWIxXfYSQ40S/VKrAOGpc=
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
@@ -37,24 +37,26 @@ github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
-github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
-github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
-github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
-go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM=
-go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU=
-go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY=
-go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM=
-go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M=
-go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8=
-golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
-golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
+github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
+github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
+github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
+golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
+golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
-golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
+golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
-golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
-golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
+golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
+golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
diff --git a/contrib/drivers/mssql/go.mod b/contrib/drivers/mssql/go.mod
index 8b9e89598..604a87105 100644
--- a/contrib/drivers/mssql/go.mod
+++ b/contrib/drivers/mssql/go.mod
@@ -1,37 +1,38 @@
module github.com/gogf/gf/contrib/drivers/mssql/v2
-go 1.18
+go 1.20
require (
- github.com/gogf/gf/v2 v2.7.2
+ github.com/gogf/gf/v2 v2.8.1
github.com/microsoft/go-mssqldb v1.7.1
)
require (
- github.com/BurntSushi/toml v1.3.2 // indirect
+ github.com/BurntSushi/toml v1.4.0 // indirect
github.com/clbanning/mxj/v2 v2.7.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
- github.com/fatih/color v1.16.0 // indirect
+ github.com/fatih/color v1.17.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
- github.com/go-logr/logr v1.2.4 // indirect
+ github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect
github.com/golang-sql/sqlexp v0.1.0 // indirect
- github.com/gorilla/websocket v1.5.1 // indirect
+ github.com/gorilla/websocket v1.5.3 // indirect
github.com/grokify/html-strip-tags-go v0.1.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
- github.com/rivo/uniseg v0.4.4 // indirect
- go.opentelemetry.io/otel v1.14.0 // indirect
- go.opentelemetry.io/otel/sdk v1.14.0 // indirect
- go.opentelemetry.io/otel/trace v1.14.0 // indirect
- golang.org/x/crypto v0.22.0 // indirect
- golang.org/x/net v0.24.0 // indirect
- golang.org/x/sys v0.19.0 // indirect
- golang.org/x/text v0.14.0 // indirect
+ github.com/rivo/uniseg v0.4.7 // indirect
+ go.opentelemetry.io/otel v1.24.0 // indirect
+ go.opentelemetry.io/otel/metric v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.24.0 // indirect
+ go.opentelemetry.io/otel/trace v1.24.0 // indirect
+ golang.org/x/crypto v0.25.0 // indirect
+ golang.org/x/net v0.27.0 // indirect
+ golang.org/x/sys v0.22.0 // indirect
+ golang.org/x/text v0.16.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/contrib/drivers/mssql/go.sum b/contrib/drivers/mssql/go.sum
index 09b52c837..b20340e26 100644
--- a/contrib/drivers/mssql/go.sum
+++ b/contrib/drivers/mssql/go.sum
@@ -4,20 +4,20 @@ github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.1 h1:6oNBlSdi1QqM1PNW7FPA6xO
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.0.1 h1:MyVTgWR8qd/Jw1Le0NZebGBUCLbtak3bJ3z1OlqZBpw=
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.0.0 h1:D3occbWoio4EBLkbkevetNMAVX197GkzbUMtqjGWn80=
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1 h1:DzHpqpoJVaCgOUdVHxE8QB52S6NiVdDQvGlny1qvPqA=
-github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
-github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
+github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
+github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/clbanning/mxj/v2 v2.7.0 h1:WA/La7UGCanFe5NpHF0Q3DNtnCsVoxbPKuyBNHWRyME=
github.com/clbanning/mxj/v2 v2.7.0/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
-github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
-github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
+github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
+github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
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/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
+github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/golang-jwt/jwt/v5 v5.2.0 h1:d/ix8ftRUorsN+5eMIlF4T6J8CAt9rch3My2winC1Jw=
@@ -25,10 +25,10 @@ github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 h1:au07oEsX2xN0kt
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
github.com/golang-sql/sqlexp v0.1.0 h1:ZCD6MBpcuOVfGVqsEmY5/4FtYiKz6tSyUv9LPEDei6A=
github.com/golang-sql/sqlexp v0.1.0/go.mod h1:J4ad9Vo8ZCWQ2GMrC4UCQy1JpCbwU9m3EOqtpKwwwHI=
-github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
+github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
-github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
-github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
+github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
+github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grokify/html-strip-tags-go v0.1.0 h1:03UrQLjAny8xci+R+qjCce/MYnpNXCtgzltlQbOBae4=
github.com/grokify/html-strip-tags-go v0.1.0/go.mod h1:ZdzgfHEzAfz9X6Xe5eBLVblWIxXfYSQ40S/VKrAOGpc=
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
@@ -49,25 +49,27 @@ github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
-github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
-github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
+github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
+github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
-go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM=
-go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU=
-go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY=
-go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM=
-go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M=
-go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8=
-golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30=
-golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M=
-golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
-golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
+golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30=
+golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M=
+golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
+golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
-golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
-golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
+golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
+golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
+golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
diff --git a/contrib/drivers/mssql/mssql.go b/contrib/drivers/mssql/mssql.go
index 470c16126..5be217ce0 100644
--- a/contrib/drivers/mssql/mssql.go
+++ b/contrib/drivers/mssql/mssql.go
@@ -23,7 +23,8 @@ type Driver struct {
}
const (
- quoteChar = `"`
+ rowNumberAliasForSelect = `ROW_NUMBER__`
+ quoteChar = `"`
)
func init() {
diff --git a/contrib/drivers/mssql/mssql_do_commit.go b/contrib/drivers/mssql/mssql_do_commit.go
new file mode 100644
index 000000000..1dc57c950
--- /dev/null
+++ b/contrib/drivers/mssql/mssql_do_commit.go
@@ -0,0 +1,29 @@
+// Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
+//
+// This Source Code Form is subject to the terms of the MIT License.
+// If a copy of the MIT was not distributed with this file,
+// You can obtain one at https://github.com/gogf/gf.
+
+package mssql
+
+import (
+ "context"
+
+ "github.com/gogf/gf/v2/database/gdb"
+)
+
+// DoCommit commits current sql and arguments to underlying sql driver.
+func (d *Driver) DoCommit(ctx context.Context, in gdb.DoCommitInput) (out gdb.DoCommitOutput, err error) {
+ out, err = d.Core.DoCommit(ctx, in)
+ if err != nil {
+ return
+ }
+ if len(out.Records) > 0 {
+ // remove auto added field.
+ for i, record := range out.Records {
+ delete(record, rowNumberAliasForSelect)
+ out.Records[i] = record
+ }
+ }
+ return
+}
diff --git a/contrib/drivers/mssql/mssql_do_filter.go b/contrib/drivers/mssql/mssql_do_filter.go
index 8cf790e4f..f6e4538bd 100644
--- a/contrib/drivers/mssql/mssql_do_filter.go
+++ b/contrib/drivers/mssql/mssql_do_filter.go
@@ -18,10 +18,11 @@ import (
)
var (
- selectSqlTmp = `SELECT * FROM (SELECT TOP %d * FROM (SELECT TOP %d %s) as TMP1_ ) as TMP2_ `
+ orderBySqlTmp = `SELECT %s %s OFFSET %d ROWS FETCH NEXT %d ROWS ONLY`
+ withoutOrderBySqlTmp = `SELECT %s OFFSET %d ROWS FETCH NEXT %d ROWS ONLY`
selectWithOrderSqlTmp = `
-SELECT * FROM (SELECT ROW_NUMBER() OVER (ORDER BY %s) as ROWNUMBER_, %s ) as TMP_
-WHERE TMP_.ROWNUMBER_ > %d AND TMP_.ROWNUMBER_ <= %d
+SELECT * FROM (SELECT ROW_NUMBER() OVER (ORDER BY %s) as ROW_NUMBER__, %s ) as TMP_
+WHERE TMP_.ROW_NUMBER__ > %d AND TMP_.ROW_NUMBER__ <= %d
`
)
@@ -78,89 +79,55 @@ func (d *Driver) parseSql(toBeCommittedSql string) (string, error) {
func (d *Driver) handleSelectSqlReplacement(toBeCommittedSql string) (newSql string, err error) {
// SELECT * FROM USER WHERE ID=1 LIMIT 1
- match, err := gregex.MatchString(`^SELECT(.+)LIMIT 1$`, toBeCommittedSql)
+ match, err := gregex.MatchString(`^SELECT(.+?)LIMIT\s+1$`, toBeCommittedSql)
if err != nil {
return "", err
}
if len(match) > 1 {
- return fmt.Sprintf(`SELECT TOP 1 %s`, match[1]), nil
+ return fmt.Sprintf(`SELECT TOP 1 %s`, strings.TrimSpace(match[1])), nil
}
// SELECT * FROM USER WHERE AGE>18 ORDER BY ID DESC LIMIT 100, 200
- patten := `^\s*(?i)(SELECT)|(LIMIT\s*(\d+)\s*,\s*(\d+))`
- if gregex.IsMatchString(patten, toBeCommittedSql) == false {
- return toBeCommittedSql, nil
- }
- allMatch, err := gregex.MatchAllString(patten, toBeCommittedSql)
- if err != nil {
- return "", err
- }
- var index = 1
- // LIMIT statement checks.
- if len(allMatch) < 2 ||
- (strings.HasPrefix(allMatch[index][0], "LIMIT") == false &&
- strings.HasPrefix(allMatch[index][0], "limit") == false) {
- return toBeCommittedSql, nil
- }
- if gregex.IsMatchString("((?i)SELECT)(.+)((?i)LIMIT)", toBeCommittedSql) == false {
- return toBeCommittedSql, nil
- }
- // ORDER BY statement checks.
- var (
- selectStr = ""
- orderStr = ""
- haveOrder = gregex.IsMatchString("((?i)SELECT)(.+)((?i)ORDER BY)", toBeCommittedSql)
- )
- if haveOrder {
- queryExpr, _ := gregex.MatchString("((?i)SELECT)(.+)((?i)ORDER BY)", toBeCommittedSql)
- if len(queryExpr) != 4 ||
- strings.EqualFold(queryExpr[1], "SELECT") == false ||
- strings.EqualFold(queryExpr[3], "ORDER BY") == false {
- return toBeCommittedSql, nil
- }
- selectStr = queryExpr[2]
- orderExpr, _ := gregex.MatchString("((?i)ORDER BY)(.+)((?i)LIMIT)", toBeCommittedSql)
- if len(orderExpr) != 4 ||
- strings.EqualFold(orderExpr[1], "ORDER BY") == false ||
- strings.EqualFold(orderExpr[3], "LIMIT") == false {
- return toBeCommittedSql, nil
- }
- orderStr = orderExpr[2]
- } else {
- queryExpr, _ := gregex.MatchString("((?i)SELECT)(.+)((?i)LIMIT)", toBeCommittedSql)
- if len(queryExpr) != 4 ||
- strings.EqualFold(queryExpr[1], "SELECT") == false ||
- strings.EqualFold(queryExpr[3], "LIMIT") == false {
- return toBeCommittedSql, nil
- }
- selectStr = queryExpr[2]
- }
- first, limit := 0, 0
- for i := 1; i < len(allMatch[index]); i++ {
- if len(strings.TrimSpace(allMatch[index][i])) == 0 {
- continue
- }
- if strings.HasPrefix(allMatch[index][i], "LIMIT") ||
- strings.HasPrefix(allMatch[index][i], "limit") {
- first, _ = strconv.Atoi(allMatch[index][i+1])
- limit, _ = strconv.Atoi(allMatch[index][i+2])
- break
- }
- }
- if haveOrder {
- toBeCommittedSql = fmt.Sprintf(
- selectWithOrderSqlTmp,
- orderStr, selectStr, first, first+limit,
- )
+ pattern := `(?i)SELECT(.+?)(ORDER BY.+?)?\s*LIMIT\s*(\d+)(?:\s*,\s*(\d+))?`
+ if !gregex.IsMatchString(pattern, toBeCommittedSql) {
return toBeCommittedSql, nil
}
- if first == 0 {
- first = limit
+ allMatch, err := gregex.MatchString(pattern, toBeCommittedSql)
+ if err != nil {
+ return "", err
}
- toBeCommittedSql = fmt.Sprintf(
- selectSqlTmp,
- limit, first+limit, selectStr,
- )
- return toBeCommittedSql, nil
+
+ // SELECT and ORDER BY
+ selectStr := strings.TrimSpace(allMatch[1])
+ orderStr := ""
+ if len(allMatch[2]) > 0 {
+ orderStr = strings.TrimSpace(allMatch[2])
+ }
+
+ // LIMIT and OFFSET value
+ first, _ := strconv.Atoi(allMatch[3]) // LIMIT first parameter
+ limit := 0
+ if len(allMatch) > 4 && allMatch[4] != "" {
+ limit, _ = strconv.Atoi(allMatch[4]) // LIMIT second parameter
+ } else {
+ limit = first
+ first = 0
+ }
+
+ if orderStr != "" {
+ // have ORDER BY clause
+ newSql = fmt.Sprintf(
+ orderBySqlTmp,
+ selectStr, orderStr, first, limit,
+ )
+ } else {
+ // without ORDER BY clause
+ newSql = fmt.Sprintf(
+ withoutOrderBySqlTmp,
+ selectStr, first, limit,
+ )
+ }
+
+ return newSql, nil
}
diff --git a/contrib/drivers/mssql/mssql_do_filter_test.go b/contrib/drivers/mssql/mssql_do_filter_test.go
new file mode 100644
index 000000000..91ded5723
--- /dev/null
+++ b/contrib/drivers/mssql/mssql_do_filter_test.go
@@ -0,0 +1,132 @@
+// Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
+//
+// This Source Code Form is subject to the terms of the MIT License.
+// If a copy of the MIT was not distributed with this file,
+// You can obtain one at https://github.com/gogf/gf.
+
+package mssql
+
+import (
+ "context"
+ "reflect"
+ "testing"
+
+ "github.com/gogf/gf/v2/database/gdb"
+ "github.com/gogf/gf/v2/test/gtest"
+)
+
+func TestDriver_DoFilter(t *testing.T) {
+ type fields struct {
+ Core *gdb.Core
+ }
+ type args struct {
+ ctx context.Context
+ link gdb.Link
+ sql string
+ args []interface{}
+ }
+ var tests []struct {
+ name string
+ fields fields
+ args args
+ wantNewSql string
+ wantNewArgs []interface{}
+ wantErr bool
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ d := &Driver{
+ Core: tt.fields.Core,
+ }
+ gotNewSql, gotNewArgs, err := d.DoFilter(tt.args.ctx, tt.args.link, tt.args.sql, tt.args.args)
+ if (err != nil) != tt.wantErr {
+ t.Errorf("DoFilter() error = %v, wantErr %v", err, tt.wantErr)
+ return
+ }
+ if gotNewSql != tt.wantNewSql {
+ t.Errorf("DoFilter() gotNewSql = %v, want %v", gotNewSql, tt.wantNewSql)
+ }
+ if !reflect.DeepEqual(gotNewArgs, tt.wantNewArgs) {
+ t.Errorf("DoFilter() gotNewArgs = %v, want %v", gotNewArgs, tt.wantNewArgs)
+ }
+ })
+ }
+}
+
+func TestDriver_handleSelectSqlReplacement(t *testing.T) {
+
+ gtest.C(t, func(t *gtest.T) {
+ d := &Driver{}
+
+ // LIMIT 1
+ inputSql := "SELECT * FROM User WHERE ID = 1 LIMIT 1"
+ expectedSql := "SELECT TOP 1 * FROM User WHERE ID = 1"
+ resultSql, err := d.handleSelectSqlReplacement(inputSql)
+ t.AssertNil(err)
+ t.Assert(resultSql, expectedSql)
+
+ // LIMIT query with offset and number of rows
+ inputSql = "SELECT * FROM User ORDER BY ID DESC LIMIT 100, 200"
+ expectedSql = "SELECT * FROM User ORDER BY ID DESC OFFSET 100 ROWS FETCH NEXT 200 ROWS ONLY"
+ resultSql, err = d.handleSelectSqlReplacement(inputSql)
+ t.AssertNil(err)
+ t.Assert(resultSql, expectedSql)
+
+ // Simple query with no LIMIT
+ inputSql = "SELECT * FROM User WHERE age > 18"
+ expectedSql = "SELECT * FROM User WHERE age > 18"
+ resultSql, err = d.handleSelectSqlReplacement(inputSql)
+ t.AssertNil(err)
+ t.Assert(resultSql, expectedSql)
+
+ // without LIMIT
+ inputSql = "SELECT * FROM User ORDER BY ID DESC"
+ expectedSql = "SELECT * FROM User ORDER BY ID DESC"
+ resultSql, err = d.handleSelectSqlReplacement(inputSql)
+ t.AssertNil(err)
+ t.Assert(resultSql, expectedSql)
+
+ // LIMIT query with only rows
+ inputSql = "SELECT * FROM User LIMIT 50"
+ expectedSql = "SELECT * FROM User OFFSET 0 ROWS FETCH NEXT 50 ROWS ONLY"
+ resultSql, err = d.handleSelectSqlReplacement(inputSql)
+ t.AssertNil(err)
+ t.Assert(resultSql, expectedSql)
+
+ // LIMIT query without ORDER BY
+ inputSql = "SELECT * FROM User LIMIT 30"
+ expectedSql = "SELECT * FROM User OFFSET 0 ROWS FETCH NEXT 30 ROWS ONLY"
+ resultSql, err = d.handleSelectSqlReplacement(inputSql)
+ t.AssertNil(err)
+ t.Assert(resultSql, expectedSql)
+
+ // Complex query with ORDER BY and LIMIT
+ inputSql = "SELECT name, age FROM User WHERE age > 18 ORDER BY age ASC LIMIT 10, 5"
+ expectedSql = "SELECT name, age FROM User WHERE age > 18 ORDER BY age ASC OFFSET 10 ROWS FETCH NEXT 5 ROWS ONLY"
+ resultSql, err = d.handleSelectSqlReplacement(inputSql)
+ t.AssertNil(err)
+ t.Assert(resultSql, expectedSql)
+
+ // Complex conditional queries have limits
+ inputSql = "SELECT * FROM User WHERE age > 18 AND status = 'active' LIMIT 100, 50"
+ expectedSql = "SELECT * FROM User WHERE age > 18 AND status = 'active' OFFSET 100 ROWS FETCH NEXT 50 ROWS ONLY"
+ resultSql, err = d.handleSelectSqlReplacement(inputSql)
+ t.AssertNil(err)
+ t.Assert(resultSql, expectedSql)
+
+ // A LIMIT query that contains subquery
+ inputSql = "SELECT * FROM (SELECT * FROM User WHERE age > 18) AS subquery LIMIT 10"
+ expectedSql = "SELECT * FROM (SELECT * FROM User WHERE age > 18) AS subquery OFFSET 0 ROWS FETCH NEXT 10 ROWS ONLY"
+ resultSql, err = d.handleSelectSqlReplacement(inputSql)
+ t.AssertNil(err)
+ t.Assert(resultSql, expectedSql)
+
+ // Queries with complex ORDER BY and LIMIT
+ inputSql = "SELECT name, age FROM User WHERE age > 18 ORDER BY age DESC, name ASC LIMIT 20, 10"
+ expectedSql = "SELECT name, age FROM User WHERE age > 18 ORDER BY age DESC, name ASC OFFSET 20 ROWS FETCH NEXT 10 ROWS ONLY"
+ resultSql, err = d.handleSelectSqlReplacement(inputSql)
+ t.AssertNil(err)
+ t.Assert(resultSql, expectedSql)
+
+ })
+}
diff --git a/contrib/drivers/mssql/mssql_z_unit_basic_test.go b/contrib/drivers/mssql/mssql_z_unit_basic_test.go
index 40d39f988..b283f3047 100644
--- a/contrib/drivers/mssql/mssql_z_unit_basic_test.go
+++ b/contrib/drivers/mssql/mssql_z_unit_basic_test.go
@@ -794,7 +794,7 @@ func Test_DB_ToJson(t *testing.T) {
}
// ToJson
- resultJson, err := gjson.LoadContent(result.Json())
+ resultJson, err := gjson.LoadContent([]byte(result.Json()))
if err != nil {
gtest.Fatal(err)
}
diff --git a/contrib/drivers/mssql/mssql_z_unit_model_test.go b/contrib/drivers/mssql/mssql_z_unit_model_test.go
index a31ff478d..7435e84cc 100644
--- a/contrib/drivers/mssql/mssql_z_unit_model_test.go
+++ b/contrib/drivers/mssql/mssql_z_unit_model_test.go
@@ -519,7 +519,19 @@ func Test_Model_Count(t *testing.T) {
t.AssertNil(err)
t.Assert(count, int64(TableSize))
})
+}
+func Test_Model_Exist(t *testing.T) {
+ table := createInitTable()
+ defer dropTable(table)
+ gtest.C(t, func(t *gtest.T) {
+ exist, err := db.Model(table).Exist()
+ t.AssertNil(err)
+ t.Assert(exist, TableSize > 0)
+ exist, err = db.Model(table).Where("id", -1).Exist()
+ t.AssertNil(err)
+ t.Assert(exist, false)
+ })
}
func Test_Model_Select(t *testing.T) {
diff --git a/contrib/drivers/mysql/go.mod b/contrib/drivers/mysql/go.mod
index 9d92f7393..2b05cf394 100644
--- a/contrib/drivers/mysql/go.mod
+++ b/contrib/drivers/mysql/go.mod
@@ -1,34 +1,35 @@
module github.com/gogf/gf/contrib/drivers/mysql/v2
-go 1.18
+go 1.20
require (
github.com/go-sql-driver/mysql v1.7.1
- github.com/gogf/gf/v2 v2.7.2
+ github.com/gogf/gf/v2 v2.8.1
)
require (
- github.com/BurntSushi/toml v1.3.2 // indirect
+ github.com/BurntSushi/toml v1.4.0 // indirect
github.com/clbanning/mxj/v2 v2.7.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
- github.com/fatih/color v1.16.0 // indirect
+ github.com/fatih/color v1.17.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
- github.com/go-logr/logr v1.2.4 // indirect
+ github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
- github.com/gorilla/websocket v1.5.1 // indirect
+ github.com/gorilla/websocket v1.5.3 // indirect
github.com/grokify/html-strip-tags-go v0.1.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
- github.com/rivo/uniseg v0.4.4 // indirect
- go.opentelemetry.io/otel v1.14.0 // indirect
- go.opentelemetry.io/otel/sdk v1.14.0 // indirect
- go.opentelemetry.io/otel/trace v1.14.0 // indirect
- golang.org/x/net v0.24.0 // indirect
- golang.org/x/sys v0.19.0 // indirect
- golang.org/x/text v0.14.0 // indirect
+ github.com/rivo/uniseg v0.4.7 // indirect
+ go.opentelemetry.io/otel v1.24.0 // indirect
+ go.opentelemetry.io/otel/metric v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.24.0 // indirect
+ go.opentelemetry.io/otel/trace v1.24.0 // indirect
+ golang.org/x/net v0.27.0 // indirect
+ golang.org/x/sys v0.22.0 // indirect
+ golang.org/x/text v0.16.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/contrib/drivers/mysql/go.sum b/contrib/drivers/mysql/go.sum
index fc917ad11..4e03c25c6 100644
--- a/contrib/drivers/mysql/go.sum
+++ b/contrib/drivers/mysql/go.sum
@@ -1,24 +1,24 @@
-github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
-github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
+github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
+github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/clbanning/mxj/v2 v2.7.0 h1:WA/La7UGCanFe5NpHF0Q3DNtnCsVoxbPKuyBNHWRyME=
github.com/clbanning/mxj/v2 v2.7.0/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
-github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
-github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
+github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
+github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
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/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
+github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI=
github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
-github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
-github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
-github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
+github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
+github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
+github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grokify/html-strip-tags-go v0.1.0 h1:03UrQLjAny8xci+R+qjCce/MYnpNXCtgzltlQbOBae4=
github.com/grokify/html-strip-tags-go v0.1.0/go.mod h1:ZdzgfHEzAfz9X6Xe5eBLVblWIxXfYSQ40S/VKrAOGpc=
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
@@ -35,23 +35,25 @@ github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
-github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
-github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
-github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
-go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM=
-go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU=
-go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY=
-go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM=
-go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M=
-go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8=
-golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
-golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
+github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
+github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
+github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
+golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
+golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
-golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
-golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
+golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
+golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
+golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
diff --git a/contrib/drivers/mysql/mysql_do_filter.go b/contrib/drivers/mysql/mysql_do_filter.go
index 96bc7224c..aff546ab9 100644
--- a/contrib/drivers/mysql/mysql_do_filter.go
+++ b/contrib/drivers/mysql/mysql_do_filter.go
@@ -13,6 +13,8 @@ import (
)
// DoFilter handles the sql before posts it to database.
-func (d *Driver) DoFilter(ctx context.Context, link gdb.Link, sql string, args []interface{}) (newSql string, newArgs []interface{}, err error) {
+func (d *Driver) DoFilter(
+ ctx context.Context, link gdb.Link, sql string, args []interface{},
+) (newSql string, newArgs []interface{}, err error) {
return d.Core.DoFilter(ctx, link, sql, args)
}
diff --git a/contrib/drivers/mysql/mysql_open.go b/contrib/drivers/mysql/mysql_open.go
index 4c53fcf39..cd5f74b11 100644
--- a/contrib/drivers/mysql/mysql_open.go
+++ b/contrib/drivers/mysql/mysql_open.go
@@ -9,7 +9,6 @@ package mysql
import (
"database/sql"
"fmt"
-
"net/url"
"strings"
@@ -23,9 +22,21 @@ import (
// Note that it converts time.Time argument to local timezone in default.
func (d *Driver) Open(config *gdb.ConfigNode) (db *sql.DB, err error) {
var (
- source string
+ source = configNodeToSource(config)
underlyingDriverName = "mysql"
)
+ if db, err = sql.Open(underlyingDriverName, source); err != nil {
+ err = gerror.WrapCodef(
+ gcode.CodeDbOperationError, err,
+ `sql.Open failed for driver "%s" by source "%s"`, underlyingDriverName, source,
+ )
+ return nil, err
+ }
+ return
+}
+
+func configNodeToSource(config *gdb.ConfigNode) string {
+ var source string
// [username[:password]@][protocol[(address)]]/dbname[?param1=value1&...¶mN=valueN]
if config.Link != "" {
// ============================================================================
@@ -37,10 +48,13 @@ func (d *Driver) Open(config *gdb.ConfigNode) (db *sql.DB, err error) {
source, _ = gregex.ReplaceString(`/([\w\.\-]+)+`, "/"+config.Name, source)
}
} else {
- // TODO: Do not set charset when charset is not specified (in v2.5.0)
+ var portStr string
+ if config.Port != "" {
+ portStr = ":" + config.Port
+ }
source = fmt.Sprintf(
- "%s:%s@%s(%s:%s)/%s?charset=%s",
- config.User, config.Pass, config.Protocol, config.Host, config.Port, config.Name, config.Charset,
+ "%s:%s@%s(%s%s)/%s?charset=%s",
+ config.User, config.Pass, config.Protocol, config.Host, portStr, config.Name, config.Charset,
)
if config.Timezone != "" {
if strings.Contains(config.Timezone, "/") {
@@ -52,12 +66,5 @@ func (d *Driver) Open(config *gdb.ConfigNode) (db *sql.DB, err error) {
source = fmt.Sprintf("%s&%s", source, config.Extra)
}
}
- if db, err = sql.Open(underlyingDriverName, source); err != nil {
- err = gerror.WrapCodef(
- gcode.CodeDbOperationError, err,
- `sql.Open failed for driver "%s" by source "%s"`, underlyingDriverName, source,
- )
- return nil, err
- }
- return
+ return source
}
diff --git a/contrib/drivers/mysql/mysql_z_unit_core_test.go b/contrib/drivers/mysql/mysql_z_unit_core_test.go
index 41fcf475c..5dce861e1 100644
--- a/contrib/drivers/mysql/mysql_z_unit_core_test.go
+++ b/contrib/drivers/mysql/mysql_z_unit_core_test.go
@@ -104,6 +104,7 @@ func Test_DB_Insert(t *testing.T) {
"password": "25d55ad283aa400af464c76d713c07ad",
"nickname": "T1",
"create_time": gtime.Now().String(),
+ "create_date": gtime.Date(),
})
t.AssertNil(err)
@@ -114,6 +115,7 @@ func Test_DB_Insert(t *testing.T) {
"password": "25d55ad283aa400af464c76d713c07ad",
"nickname": "name_2",
"create_time": gtime.Now().String(),
+ "create_date": gtime.Date(),
})
t.AssertNil(err)
n, _ := result.RowsAffected()
@@ -121,19 +123,22 @@ func Test_DB_Insert(t *testing.T) {
// struct
type User struct {
- Id int `gconv:"id"`
- Passport string `json:"passport"`
- Password string `gconv:"password"`
- Nickname string `gconv:"nickname"`
- CreateTime string `json:"create_time"`
+ Id int `gconv:"id"`
+ Passport string `json:"passport"`
+ Password string `gconv:"password"`
+ Nickname string `gconv:"nickname"`
+ CreateTime string `json:"create_time"`
+ CreateDate *gtime.Time `json:"create_date"`
}
- timeStr := gtime.New("2024-10-01 12:01:01").String()
+ gTime := gtime.New("2024-10-01 12:01:01")
+ timeStr, dateStr := gTime.String(), "2024-10-01 00:00:00"
result, err = db.Insert(ctx, table, User{
Id: 3,
Passport: "user_3",
Password: "25d55ad283aa400af464c76d713c07ad",
Nickname: "name_3",
CreateTime: timeStr,
+ CreateDate: gTime,
})
t.AssertNil(err)
n, _ = result.RowsAffected()
@@ -147,15 +152,18 @@ func Test_DB_Insert(t *testing.T) {
t.Assert(one["password"].String(), "25d55ad283aa400af464c76d713c07ad")
t.Assert(one["nickname"].String(), "name_3")
t.Assert(one["create_time"].GTime().String(), timeStr)
+ t.Assert(one["create_date"].GTime().String(), dateStr)
// *struct
- timeStr = gtime.New("2024-10-01 12:01:01").String()
+ gTime = gtime.New("2024-10-01 12:01:01")
+ timeStr, dateStr = gTime.String(), "2024-10-01 00:00:00"
result, err = db.Insert(ctx, table, &User{
Id: 4,
Passport: "t4",
Password: "25d55ad283aa400af464c76d713c07ad",
Nickname: "name_4",
CreateTime: timeStr,
+ CreateDate: gTime,
})
t.AssertNil(err)
n, _ = result.RowsAffected()
@@ -168,9 +176,11 @@ func Test_DB_Insert(t *testing.T) {
t.Assert(one["password"].String(), "25d55ad283aa400af464c76d713c07ad")
t.Assert(one["nickname"].String(), "name_4")
t.Assert(one["create_time"].GTime().String(), timeStr)
+ t.Assert(one["create_date"].GTime().String(), dateStr)
// batch with Insert
- timeStr = gtime.New("2024-10-01 12:01:01").String()
+ gTime = gtime.New("2024-10-01 12:01:01")
+ timeStr, dateStr = gTime.String(), "2024-10-01 00:00:00"
r, err := db.Insert(ctx, table, g.Slice{
g.Map{
"id": 200,
@@ -178,6 +188,7 @@ func Test_DB_Insert(t *testing.T) {
"password": "25d55ad283aa400af464c76d71qw07ad",
"nickname": "T200",
"create_time": timeStr,
+ "create_date": gTime,
},
g.Map{
"id": 300,
@@ -185,6 +196,7 @@ func Test_DB_Insert(t *testing.T) {
"password": "25d55ad283aa400af464c76d713c07ad",
"nickname": "T300",
"create_time": timeStr,
+ "create_date": gTime,
},
})
t.AssertNil(err)
@@ -198,6 +210,7 @@ func Test_DB_Insert(t *testing.T) {
t.Assert(one["password"].String(), "25d55ad283aa400af464c76d71qw07ad")
t.Assert(one["nickname"].String(), "T200")
t.Assert(one["create_time"].GTime().String(), timeStr)
+ t.Assert(one["create_date"].GTime().String(), dateStr)
})
}
@@ -881,7 +894,7 @@ func Test_DB_ToJson(t *testing.T) {
}
// ToJson
- resultJson, err := gjson.LoadContent(result.Json())
+ resultJson, err := gjson.LoadContent([]byte(result.Json()))
if err != nil {
gtest.Fatal(err)
}
@@ -1644,7 +1657,7 @@ func Test_Core_ClearTableFields(t *testing.T) {
gtest.C(t, func(t *gtest.T) {
fields, err := db.TableFields(ctx, table)
t.AssertNil(err)
- t.Assert(len(fields), 5)
+ t.Assert(len(fields), 6)
})
gtest.C(t, func(t *gtest.T) {
err := db.GetCore().ClearTableFields(ctx, table)
diff --git a/contrib/drivers/mysql/mysql_z_unit_feature_raw_type_test.go b/contrib/drivers/mysql/mysql_z_unit_feature_raw_type_test.go
index eb8256785..5bc008e30 100644
--- a/contrib/drivers/mysql/mysql_z_unit_feature_raw_type_test.go
+++ b/contrib/drivers/mysql/mysql_z_unit_feature_raw_type_test.go
@@ -7,6 +7,7 @@
package mysql_test
import (
+ "context"
"testing"
"github.com/gogf/gf/v2/database/gdb"
@@ -14,7 +15,7 @@ import (
"github.com/gogf/gf/v2/test/gtest"
)
-func Test_Insert_Raw(t *testing.T) {
+func Test_Raw_Insert(t *testing.T) {
table := createTable()
defer dropTable(table)
@@ -33,7 +34,7 @@ func Test_Insert_Raw(t *testing.T) {
})
}
-func Test_BatchInsert_Raw(t *testing.T) {
+func Test_Raw_BatchInsert(t *testing.T) {
table := createTable()
defer dropTable(table)
@@ -63,7 +64,7 @@ func Test_BatchInsert_Raw(t *testing.T) {
})
}
-func Test_Update_Raw(t *testing.T) {
+func Test_Raw_Update(t *testing.T) {
table := createInitTable()
defer dropTable(table)
@@ -84,3 +85,45 @@ func Test_Update_Raw(t *testing.T) {
t.Assert(n, 1)
})
}
+
+func Test_Raw_Where(t *testing.T) {
+ table1 := createTable("Test_Raw_Where_Table1")
+ table2 := createTable("Test_Raw_Where_Table2")
+ defer dropTable(table1)
+ defer dropTable(table2)
+
+ // https://github.com/gogf/gf/issues/3922
+ gtest.C(t, func(t *gtest.T) {
+ expectSql := "SELECT * FROM `Test_Raw_Where_Table1` AS A WHERE NOT EXISTS (SELECT B.id FROM `Test_Raw_Where_Table2` AS B WHERE `B`.`id`=A.id) LIMIT 1"
+ sql, err := gdb.ToSQL(ctx, func(ctx context.Context) error {
+ s := db.Model(table2).As("B").Ctx(ctx).Fields("B.id").Where("B.id", gdb.Raw("A.id"))
+ m := db.Model(table1).As("A").Ctx(ctx).Where("NOT EXISTS ?", s).Limit(1)
+ _, err := m.All()
+ return err
+ })
+ t.AssertNil(err)
+ t.Assert(expectSql, sql)
+ })
+ gtest.C(t, func(t *gtest.T) {
+ expectSql := "SELECT * FROM `Test_Raw_Where_Table1` AS A WHERE NOT EXISTS (SELECT B.id FROM `Test_Raw_Where_Table2` AS B WHERE B.id=A.id) LIMIT 1"
+ sql, err := gdb.ToSQL(ctx, func(ctx context.Context) error {
+ s := db.Model(table2).As("B").Ctx(ctx).Fields("B.id").Where(gdb.Raw("B.id=A.id"))
+ m := db.Model(table1).As("A").Ctx(ctx).Where("NOT EXISTS ?", s).Limit(1)
+ _, err := m.All()
+ return err
+ })
+ t.AssertNil(err)
+ t.Assert(expectSql, sql)
+ })
+ // https://github.com/gogf/gf/issues/3915
+ gtest.C(t, func(t *gtest.T) {
+ expectSql := "SELECT * FROM `Test_Raw_Where_Table1` WHERE `passport` < `nickname`"
+ sql, err := gdb.ToSQL(ctx, func(ctx context.Context) error {
+ m := db.Model(table1).Ctx(ctx).WhereLT("passport", gdb.Raw("`nickname`"))
+ _, err := m.All()
+ return err
+ })
+ t.AssertNil(err)
+ t.Assert(expectSql, sql)
+ })
+}
diff --git a/contrib/drivers/mysql/mysql_z_unit_feature_with_test.go b/contrib/drivers/mysql/mysql_z_unit_feature_with_test.go
index b32af2fb1..f71a3d378 100644
--- a/contrib/drivers/mysql/mysql_z_unit_feature_with_test.go
+++ b/contrib/drivers/mysql/mysql_z_unit_feature_with_test.go
@@ -93,36 +93,17 @@ func Test_Table_Relation_With_Scan(t *testing.T) {
tableUserDetail = "user_detail"
tableUserScores = "user_score"
)
- if _, err := db.Exec(ctx, fmt.Sprintf(`
-CREATE TABLE IF NOT EXISTS %s (
-id int(10) unsigned NOT NULL AUTO_INCREMENT,
-name varchar(45) NOT NULL,
-PRIMARY KEY (id)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
- `, tableUser)); err != nil {
+ if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user.sql"), tableUser)); err != nil {
gtest.Error(err)
}
defer dropTable(tableUser)
- if _, err := db.Exec(ctx, fmt.Sprintf(`
-CREATE TABLE IF NOT EXISTS %s (
-uid int(10) unsigned NOT NULL AUTO_INCREMENT,
-address varchar(45) NOT NULL,
-PRIMARY KEY (uid)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
- `, tableUserDetail)); err != nil {
+ if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_detail.sql"), tableUserDetail)); err != nil {
gtest.Error(err)
}
defer dropTable(tableUserDetail)
- if _, err := db.Exec(ctx, fmt.Sprintf(`
-CREATE TABLE IF NOT EXISTS %s (
-id int(10) unsigned NOT NULL AUTO_INCREMENT,
-uid int(10) unsigned NOT NULL,
-score int(10) unsigned NOT NULL,
-PRIMARY KEY (id)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
- `, tableUserScores)); err != nil {
+ if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_scores.sql"), tableUserScores)); err != nil {
gtest.Error(err)
}
defer dropTable(tableUserScores)
@@ -291,36 +272,17 @@ func Test_Table_Relation_With(t *testing.T) {
tableUserDetail = "user_detail"
tableUserScores = "user_scores"
)
- if _, err := db.Exec(ctx, fmt.Sprintf(`
-CREATE TABLE IF NOT EXISTS %s (
-id int(10) unsigned NOT NULL AUTO_INCREMENT,
-name varchar(45) NOT NULL,
-PRIMARY KEY (id)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
- `, tableUser)); err != nil {
+ if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user.sql"), tableUser)); err != nil {
gtest.Error(err)
}
defer dropTable(tableUser)
- if _, err := db.Exec(ctx, fmt.Sprintf(`
-CREATE TABLE IF NOT EXISTS %s (
-uid int(10) unsigned NOT NULL AUTO_INCREMENT,
-address varchar(45) NOT NULL,
-PRIMARY KEY (uid)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
- `, tableUserDetail)); err != nil {
+ if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_detail.sql"), tableUserDetail)); err != nil {
gtest.Error(err)
}
defer dropTable(tableUserDetail)
- if _, err := db.Exec(ctx, fmt.Sprintf(`
-CREATE TABLE IF NOT EXISTS %s (
-id int(10) unsigned NOT NULL AUTO_INCREMENT,
-uid int(10) unsigned NOT NULL,
-score int(10) unsigned NOT NULL,
-PRIMARY KEY (id)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
- `, tableUserScores)); err != nil {
+ if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_scores.sql"), tableUserScores)); err != nil {
gtest.Error(err)
}
defer dropTable(tableUserScores)
@@ -491,36 +453,17 @@ func Test_Table_Relation_WithAll(t *testing.T) {
tableUserDetail = "user_detail"
tableUserScores = "user_scores"
)
- if _, err := db.Exec(ctx, fmt.Sprintf(`
-CREATE TABLE IF NOT EXISTS %s (
-id int(10) unsigned NOT NULL AUTO_INCREMENT,
-name varchar(45) NOT NULL,
-PRIMARY KEY (id)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
- `, tableUser)); err != nil {
+ if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user.sql"), tableUser)); err != nil {
gtest.Error(err)
}
defer dropTable(tableUser)
- if _, err := db.Exec(ctx, fmt.Sprintf(`
-CREATE TABLE IF NOT EXISTS %s (
-uid int(10) unsigned NOT NULL AUTO_INCREMENT,
-address varchar(45) NOT NULL,
-PRIMARY KEY (uid)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
- `, tableUserDetail)); err != nil {
+ if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_detail.sql"), tableUserDetail)); err != nil {
gtest.Error(err)
}
defer dropTable(tableUserDetail)
- if _, err := db.Exec(ctx, fmt.Sprintf(`
-CREATE TABLE IF NOT EXISTS %s (
-id int(10) unsigned NOT NULL AUTO_INCREMENT,
-uid int(10) unsigned NOT NULL,
-score int(10) unsigned NOT NULL,
-PRIMARY KEY (id)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
- `, tableUserScores)); err != nil {
+ if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_scores.sql"), tableUserScores)); err != nil {
gtest.Error(err)
}
defer dropTable(tableUserScores)
@@ -606,36 +549,17 @@ func Test_Table_Relation_WithAll_List(t *testing.T) {
tableUserDetail = "user_detail"
tableUserScores = "user_scores"
)
- if _, err := db.Exec(ctx, fmt.Sprintf(`
-CREATE TABLE IF NOT EXISTS %s (
-id int(10) unsigned NOT NULL AUTO_INCREMENT,
-name varchar(45) NOT NULL,
-PRIMARY KEY (id)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
- `, tableUser)); err != nil {
+ if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user.sql"), tableUser)); err != nil {
gtest.Error(err)
}
defer dropTable(tableUser)
- if _, err := db.Exec(ctx, fmt.Sprintf(`
-CREATE TABLE IF NOT EXISTS %s (
-uid int(10) unsigned NOT NULL AUTO_INCREMENT,
-address varchar(45) NOT NULL,
-PRIMARY KEY (uid)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
- `, tableUserDetail)); err != nil {
+ if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_detail.sql"), tableUserDetail)); err != nil {
gtest.Error(err)
}
defer dropTable(tableUserDetail)
- if _, err := db.Exec(ctx, fmt.Sprintf(`
-CREATE TABLE IF NOT EXISTS %s (
-id int(10) unsigned NOT NULL AUTO_INCREMENT,
-uid int(10) unsigned NOT NULL,
-score int(10) unsigned NOT NULL,
-PRIMARY KEY (id)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
- `, tableUserScores)); err != nil {
+ if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_scores.sql"), tableUserScores)); err != nil {
gtest.Error(err)
}
defer dropTable(tableUserScores)
@@ -747,36 +671,17 @@ func Test_Table_Relation_WithAllCondition_List(t *testing.T) {
tableUserDetail = "user_detail"
tableUserScores = "user_scores"
)
- if _, err := db.Exec(ctx, fmt.Sprintf(`
-CREATE TABLE IF NOT EXISTS %s (
-id int(10) unsigned NOT NULL AUTO_INCREMENT,
-name varchar(45) NOT NULL,
-PRIMARY KEY (id)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-`, tableUser)); err != nil {
+ if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user.sql"), tableUser)); err != nil {
gtest.Error(err)
}
defer dropTable(tableUser)
- if _, err := db.Exec(ctx, fmt.Sprintf(`
-CREATE TABLE IF NOT EXISTS %s (
-uid int(10) unsigned NOT NULL AUTO_INCREMENT,
-address varchar(45) NOT NULL,
-PRIMARY KEY (uid)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-`, tableUserDetail)); err != nil {
+ if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_detail.sql"), tableUserDetail)); err != nil {
gtest.Error(err)
}
defer dropTable(tableUserDetail)
- if _, err := db.Exec(ctx, fmt.Sprintf(`
-CREATE TABLE IF NOT EXISTS %s (
-id int(10) unsigned NOT NULL AUTO_INCREMENT,
-uid int(10) unsigned NOT NULL,
-score int(10) unsigned NOT NULL,
-PRIMARY KEY (id)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-`, tableUserScores)); err != nil {
+ if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_scores.sql"), tableUserScores)); err != nil {
gtest.Error(err)
}
defer dropTable(tableUserScores)
@@ -883,36 +788,17 @@ func Test_Table_Relation_WithAll_Embedded_With_SelfMaintained_Attributes(t *test
tableUserDetail = "user_detail"
tableUserScores = "user_scores"
)
- if _, err := db.Exec(ctx, fmt.Sprintf(`
-CREATE TABLE IF NOT EXISTS %s (
-id int(10) unsigned NOT NULL AUTO_INCREMENT,
-name varchar(45) NOT NULL,
-PRIMARY KEY (id)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
- `, tableUser)); err != nil {
+ if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user.sql"), tableUser)); err != nil {
gtest.Error(err)
}
defer dropTable(tableUser)
- if _, err := db.Exec(ctx, fmt.Sprintf(`
-CREATE TABLE IF NOT EXISTS %s (
-uid int(10) unsigned NOT NULL AUTO_INCREMENT,
-address varchar(45) NOT NULL,
-PRIMARY KEY (uid)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
- `, tableUserDetail)); err != nil {
+ if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_detail.sql"), tableUserDetail)); err != nil {
gtest.Error(err)
}
defer dropTable(tableUserDetail)
- if _, err := db.Exec(ctx, fmt.Sprintf(`
-CREATE TABLE IF NOT EXISTS %s (
-id int(10) unsigned NOT NULL AUTO_INCREMENT,
-uid int(10) unsigned NOT NULL,
-score int(10) unsigned NOT NULL,
-PRIMARY KEY (id)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
- `, tableUserScores)); err != nil {
+ if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_scores.sql"), tableUserScores)); err != nil {
gtest.Error(err)
}
defer dropTable(tableUserScores)
@@ -998,36 +884,17 @@ func Test_Table_Relation_WithAll_Embedded_Without_SelfMaintained_Attributes(t *t
tableUserDetail = "user_detail"
tableUserScores = "user_scores"
)
- if _, err := db.Exec(ctx, fmt.Sprintf(`
-CREATE TABLE IF NOT EXISTS %s (
-id int(10) unsigned NOT NULL AUTO_INCREMENT,
-name varchar(45) NOT NULL,
-PRIMARY KEY (id)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
- `, tableUser)); err != nil {
+ if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user.sql"), tableUser)); err != nil {
gtest.Error(err)
}
defer dropTable(tableUser)
- if _, err := db.Exec(ctx, fmt.Sprintf(`
-CREATE TABLE IF NOT EXISTS %s (
-uid int(10) unsigned NOT NULL AUTO_INCREMENT,
-address varchar(45) NOT NULL,
-PRIMARY KEY (uid)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
- `, tableUserDetail)); err != nil {
+ if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_detail.sql"), tableUserDetail)); err != nil {
gtest.Error(err)
}
defer dropTable(tableUserDetail)
- if _, err := db.Exec(ctx, fmt.Sprintf(`
-CREATE TABLE IF NOT EXISTS %s (
-id int(10) unsigned NOT NULL AUTO_INCREMENT,
-uid int(10) unsigned NOT NULL,
-score int(10) unsigned NOT NULL,
-PRIMARY KEY (id)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
- `, tableUserScores)); err != nil {
+ if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_scores.sql"), tableUserScores)); err != nil {
gtest.Error(err)
}
defer dropTable(tableUserScores)
@@ -1121,36 +988,17 @@ func Test_Table_Relation_WithAll_Embedded_WithoutMeta(t *testing.T) {
tableUserDetail = "user_detail"
tableUserScores = "user_scores"
)
- if _, err := db.Exec(ctx, fmt.Sprintf(`
-CREATE TABLE IF NOT EXISTS %s (
-id int(10) unsigned NOT NULL AUTO_INCREMENT,
-name varchar(45) NOT NULL,
-PRIMARY KEY (id)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
- `, tableUser)); err != nil {
+ if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user.sql"), tableUser)); err != nil {
gtest.Error(err)
}
defer dropTable(tableUser)
- if _, err := db.Exec(ctx, fmt.Sprintf(`
-CREATE TABLE IF NOT EXISTS %s (
-uid int(10) unsigned NOT NULL AUTO_INCREMENT,
-address varchar(45) NOT NULL,
-PRIMARY KEY (uid)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
- `, tableUserDetail)); err != nil {
+ if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_detail.sql"), tableUserDetail)); err != nil {
gtest.Error(err)
}
defer dropTable(tableUserDetail)
- if _, err := db.Exec(ctx, fmt.Sprintf(`
-CREATE TABLE IF NOT EXISTS %s (
-id int(10) unsigned NOT NULL AUTO_INCREMENT,
-uid int(10) unsigned NOT NULL,
-score int(10) unsigned NOT NULL,
-PRIMARY KEY (id)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
- `, tableUserScores)); err != nil {
+ if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_scores.sql"), tableUserScores)); err != nil {
gtest.Error(err)
}
defer dropTable(tableUserScores)
@@ -1237,36 +1085,17 @@ func Test_Table_Relation_WithAll_AttributeStructAlsoHasWithTag(t *testing.T) {
tableUserDetail = "user_detail"
tableUserScores = "user_scores"
)
- if _, err := db.Exec(ctx, fmt.Sprintf(`
-CREATE TABLE IF NOT EXISTS %s (
-id int(10) unsigned NOT NULL AUTO_INCREMENT,
-name varchar(45) NOT NULL,
-PRIMARY KEY (id)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-`, tableUser)); err != nil {
+ if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user.sql"), tableUser)); err != nil {
gtest.Error(err)
}
defer dropTable(tableUser)
- if _, err := db.Exec(ctx, fmt.Sprintf(`
-CREATE TABLE IF NOT EXISTS %s (
-uid int(10) unsigned NOT NULL AUTO_INCREMENT,
-address varchar(45) NOT NULL,
-PRIMARY KEY (uid)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-`, tableUserDetail)); err != nil {
+ if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_detail.sql"), tableUserDetail)); err != nil {
gtest.Error(err)
}
defer dropTable(tableUserDetail)
- if _, err := db.Exec(ctx, fmt.Sprintf(`
-CREATE TABLE IF NOT EXISTS %s (
-id int(10) unsigned NOT NULL AUTO_INCREMENT,
-uid int(10) unsigned NOT NULL,
-score int(10) unsigned NOT NULL,
-PRIMARY KEY (id)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-`, tableUserScores)); err != nil {
+ if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_scores.sql"), tableUserScores)); err != nil {
gtest.Error(err)
}
defer dropTable(tableUserScores)
@@ -1353,36 +1182,17 @@ func Test_Table_Relation_WithAll_AttributeStructAlsoHasWithTag_MoreDeep(t *testi
tableUserDetail = "user_detail"
tableUserScores = "user_scores"
)
- if _, err := db.Exec(ctx, fmt.Sprintf(`
-CREATE TABLE IF NOT EXISTS %s (
-id int(10) unsigned NOT NULL AUTO_INCREMENT,
-name varchar(45) NOT NULL,
-PRIMARY KEY (id)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-`, tableUser)); err != nil {
+ if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user.sql"), tableUser)); err != nil {
gtest.Error(err)
}
defer dropTable(tableUser)
- if _, err := db.Exec(ctx, fmt.Sprintf(`
-CREATE TABLE IF NOT EXISTS %s (
-uid int(10) unsigned NOT NULL AUTO_INCREMENT,
-address varchar(45) NOT NULL,
-PRIMARY KEY (uid)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-`, tableUserDetail)); err != nil {
+ if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_detail.sql"), tableUserDetail)); err != nil {
gtest.Error(err)
}
defer dropTable(tableUserDetail)
- if _, err := db.Exec(ctx, fmt.Sprintf(`
-CREATE TABLE IF NOT EXISTS %s (
-id int(10) unsigned NOT NULL AUTO_INCREMENT,
-uid int(10) unsigned NOT NULL,
-score int(10) unsigned NOT NULL,
-PRIMARY KEY (id)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-`, tableUserScores)); err != nil {
+ if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_scores.sql"), tableUserScores)); err != nil {
gtest.Error(err)
}
defer dropTable(tableUserScores)
@@ -1499,36 +1309,17 @@ func Test_Table_Relation_With_AttributeStructAlsoHasWithTag_MoreDeep(t *testing.
tableUserDetail = "user_detail"
tableUserScores = "user_scores"
)
- if _, err := db.Exec(ctx, fmt.Sprintf(`
-CREATE TABLE IF NOT EXISTS %s (
-id int(10) unsigned NOT NULL AUTO_INCREMENT,
-name varchar(45) NOT NULL,
-PRIMARY KEY (id)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-`, tableUser)); err != nil {
+ if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user.sql"), tableUser)); err != nil {
gtest.Error(err)
}
defer dropTable(tableUser)
- if _, err := db.Exec(ctx, fmt.Sprintf(`
-CREATE TABLE IF NOT EXISTS %s (
-uid int(10) unsigned NOT NULL AUTO_INCREMENT,
-address varchar(45) NOT NULL,
-PRIMARY KEY (uid)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-`, tableUserDetail)); err != nil {
+ if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_detail.sql"), tableUserDetail)); err != nil {
gtest.Error(err)
}
defer dropTable(tableUserDetail)
- if _, err := db.Exec(ctx, fmt.Sprintf(`
-CREATE TABLE IF NOT EXISTS %s (
-id int(10) unsigned NOT NULL AUTO_INCREMENT,
-uid int(10) unsigned NOT NULL,
-score int(10) unsigned NOT NULL,
-PRIMARY KEY (id)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-`, tableUserScores)); err != nil {
+ if _, err := db.Exec(ctx, fmt.Sprintf(gtest.DataContent("with_tpl_user_scores.sql"), tableUserScores)); err != nil {
gtest.Error(err)
}
defer dropTable(tableUserScores)
diff --git a/contrib/drivers/mysql/mysql_z_unit_init_test.go b/contrib/drivers/mysql/mysql_z_unit_init_test.go
index ea4b8694c..1326378c3 100644
--- a/contrib/drivers/mysql/mysql_z_unit_init_test.go
+++ b/contrib/drivers/mysql/mysql_z_unit_init_test.go
@@ -129,6 +129,7 @@ func createTableWithDb(db gdb.DB, table ...string) (name string) {
password char(32) NULL,
nickname varchar(45) NULL,
create_time timestamp(6) NULL,
+ create_date date NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
`, name,
diff --git a/contrib/drivers/mysql/mysql_z_unit_internal_test.go b/contrib/drivers/mysql/mysql_z_unit_internal_test.go
new file mode 100644
index 000000000..b8868f6ca
--- /dev/null
+++ b/contrib/drivers/mysql/mysql_z_unit_internal_test.go
@@ -0,0 +1,30 @@
+// Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
+//
+// This Source Code Form is subject to the terms of the MIT License.
+// If a copy of the MIT was not distributed with this file,
+// You can obtain one at https://github.com/gogf/gf.
+
+package mysql
+
+import (
+ "testing"
+
+ "github.com/gogf/gf/v2/database/gdb"
+ "github.com/gogf/gf/v2/test/gtest"
+)
+
+func Test_configNodeToSource(t *testing.T) {
+ gtest.C(t, func(t *gtest.T) {
+ configNode := &gdb.ConfigNode{
+ Host: "/tmp/mysql.sock",
+ Port: "",
+ User: "username",
+ Pass: "password",
+ Name: "dbname",
+ Type: "mysql",
+ Protocol: "unix",
+ }
+ source := configNodeToSource(configNode)
+ t.Assert(source, "username:password@unix(/tmp/mysql.sock)/dbname?charset=")
+ })
+}
diff --git a/contrib/drivers/mysql/mysql_z_unit_issue_test.go b/contrib/drivers/mysql/mysql_z_unit_issue_test.go
index 072fe1b93..58ceeb0a5 100644
--- a/contrib/drivers/mysql/mysql_z_unit_issue_test.go
+++ b/contrib/drivers/mysql/mysql_z_unit_issue_test.go
@@ -13,6 +13,7 @@ import (
"testing"
"time"
+ "github.com/gogf/gf/v2/container/gvar"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
@@ -431,6 +432,45 @@ func Test_Issue1733(t *testing.T) {
})
}
+// https://github.com/gogf/gf/issues/2012
+func Test_Issue2012(t *testing.T) {
+ table := "time_only_" + guid.S()
+ if _, err := db.Exec(ctx, fmt.Sprintf(`
+ CREATE TABLE %s(
+ id int(8) unsigned zerofill NOT NULL AUTO_INCREMENT,
+ time_only time,
+ PRIMARY KEY (id)
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+ `, table,
+ )); err != nil {
+ gtest.AssertNil(err)
+ }
+ defer dropTable(table)
+
+ type TimeOnly struct {
+ Id int `json:"id"`
+ TimeOnly *gtime.Time `json:"timeOnly"`
+ }
+
+ gtest.C(t, func(t *gtest.T) {
+ timeOnly := gtime.New("15:04:05")
+ m := db.Model(table)
+
+ _, err := m.Insert(TimeOnly{
+ TimeOnly: gtime.New(timeOnly),
+ })
+ t.AssertNil(err)
+
+ _, err = m.Insert(g.Map{
+ "time_only": timeOnly,
+ })
+ t.AssertNil(err)
+
+ _, err = m.Insert("time_only", timeOnly)
+ t.AssertNil(err)
+ })
+}
+
// https://github.com/gogf/gf/issues/2105
func Test_Issue2105(t *testing.T) {
table := "issue2105"
@@ -1024,7 +1064,7 @@ func Test_Issue2552_ClearTableFieldsAll(t *testing.T) {
ctx = context.Background()
sqlArray, err = gdb.CatchSQL(ctx, func(ctx context.Context) error {
one, err := db.Model(table).Ctx(ctx).One()
- t.Assert(len(one), 5)
+ t.Assert(len(one), 6)
return err
})
t.AssertNil(err)
@@ -1039,7 +1079,7 @@ func Test_Issue2552_ClearTableFieldsAll(t *testing.T) {
ctx = context.Background()
sqlArray, err = gdb.CatchSQL(ctx, func(ctx context.Context) error {
one, err := db.Model(table).Ctx(ctx).One()
- t.Assert(len(one), 4)
+ t.Assert(len(one), 5)
return err
})
t.AssertNil(err)
@@ -1070,7 +1110,7 @@ func Test_Issue2552_ClearTableFields(t *testing.T) {
ctx = context.Background()
sqlArray, err = gdb.CatchSQL(ctx, func(ctx context.Context) error {
one, err := db.Model(table).Ctx(ctx).One()
- t.Assert(len(one), 5)
+ t.Assert(len(one), 6)
return err
})
t.AssertNil(err)
@@ -1085,7 +1125,7 @@ func Test_Issue2552_ClearTableFields(t *testing.T) {
ctx = context.Background()
sqlArray, err = gdb.CatchSQL(ctx, func(ctx context.Context) error {
one, err := db.Model(table).Ctx(ctx).One()
- t.Assert(len(one), 4)
+ t.Assert(len(one), 5)
return err
})
t.AssertNil(err)
@@ -1160,3 +1200,212 @@ func Test_Issue3238(t *testing.T) {
}
})
}
+
+// https://github.com/gogf/gf/issues/3649
+func Test_Issue3649(t *testing.T) {
+ table := createInitTable()
+ defer dropTable(table)
+
+ gtest.C(t, func(t *gtest.T) {
+ sql, err := gdb.CatchSQL(context.Background(), func(ctx context.Context) (err error) {
+ user := db.Model(table).Ctx(ctx)
+ _, err = user.Where("create_time = ?", gdb.Raw("now()")).WhereLT("create_time", gdb.Raw("now()")).Count()
+ return
+ })
+ t.AssertNil(err)
+ sqlStr := fmt.Sprintf("SELECT COUNT(1) FROM `%s` WHERE (create_time = now()) AND (`create_time` < now())", table)
+ t.Assert(sql[0], sqlStr)
+ })
+}
+
+// https://github.com/gogf/gf/issues/3754
+func Test_Issue3754(t *testing.T) {
+ table := "issue3754"
+ array := gstr.SplitAndTrim(gtest.DataContent(`issue3754.sql`), ";")
+ for _, v := range array {
+ if _, err := db.Exec(ctx, v); err != nil {
+ gtest.Error(err)
+ }
+ }
+ defer dropTable(table)
+
+ gtest.C(t, func(t *gtest.T) {
+ fieldsEx := []string{"delete_at", "create_at", "update_at"}
+ // Insert.
+ dataInsert := g.Map{
+ "id": 1,
+ "name": "name_1",
+ }
+ r, err := db.Model(table).Data(dataInsert).FieldsEx(fieldsEx).Insert()
+ t.AssertNil(err)
+ n, _ := r.RowsAffected()
+ t.Assert(n, 1)
+
+ oneInsert, err := db.Model(table).WherePri(1).One()
+ t.AssertNil(err)
+ t.Assert(oneInsert["id"].Int(), 1)
+ t.Assert(oneInsert["name"].String(), "name_1")
+ t.Assert(oneInsert["delete_at"].String(), "")
+ t.Assert(oneInsert["create_at"].String(), "")
+ t.Assert(oneInsert["update_at"].String(), "")
+
+ // Update.
+ dataUpdate := g.Map{
+ "name": "name_1000",
+ }
+ r, err = db.Model(table).Data(dataUpdate).FieldsEx(fieldsEx).WherePri(1).Update()
+ t.AssertNil(err)
+ n, _ = r.RowsAffected()
+ t.Assert(n, 1)
+
+ oneUpdate, err := db.Model(table).WherePri(1).One()
+ t.AssertNil(err)
+ t.Assert(oneUpdate["id"].Int(), 1)
+ t.Assert(oneUpdate["name"].String(), "name_1000")
+ t.Assert(oneUpdate["delete_at"].String(), "")
+ t.Assert(oneUpdate["create_at"].String(), "")
+ t.Assert(oneUpdate["update_at"].String(), "")
+
+ // FieldsEx does not affect Delete operation.
+ r, err = db.Model(table).FieldsEx(fieldsEx).WherePri(1).Delete()
+ n, _ = r.RowsAffected()
+ t.Assert(n, 1)
+ oneDeleteUnscoped, err := db.Model(table).Unscoped().WherePri(1).One()
+ t.AssertNil(err)
+ t.Assert(oneDeleteUnscoped["id"].Int(), 1)
+ t.Assert(oneDeleteUnscoped["name"].String(), "name_1000")
+ t.AssertNE(oneDeleteUnscoped["delete_at"].String(), "")
+ t.Assert(oneDeleteUnscoped["create_at"].String(), "")
+ t.Assert(oneDeleteUnscoped["update_at"].String(), "")
+ })
+}
+
+// https://github.com/gogf/gf/issues/3626
+func Test_Issue3626(t *testing.T) {
+ table := "issue3626"
+ array := gstr.SplitAndTrim(gtest.DataContent(`issue3626.sql`), ";")
+ defer dropTable(table)
+ for _, v := range array {
+ if _, err := db.Exec(ctx, v); err != nil {
+ gtest.Error(err)
+ }
+ }
+
+ // Insert.
+ gtest.C(t, func(t *gtest.T) {
+ dataInsert := g.Map{
+ "id": 1,
+ "name": "name_1",
+ }
+ r, err := db.Model(table).Data(dataInsert).Insert()
+ t.AssertNil(err)
+ n, _ := r.RowsAffected()
+ t.Assert(n, 1)
+
+ oneInsert, err := db.Model(table).WherePri(1).One()
+ t.AssertNil(err)
+ t.Assert(oneInsert["id"].Int(), 1)
+ t.Assert(oneInsert["name"].String(), "name_1")
+ })
+
+ var (
+ cacheKey = guid.S()
+ cacheFunc = func(duration time.Duration) gdb.HookHandler {
+ return gdb.HookHandler{
+ Select: func(ctx context.Context, in *gdb.HookSelectInput) (result gdb.Result, err error) {
+ get, err := db.GetCache().Get(ctx, cacheKey)
+ if err == nil && !get.IsEmpty() {
+ err = get.Scan(&result)
+ if err == nil {
+ return result, nil
+ }
+ }
+ result, err = in.Next(ctx)
+ if err != nil {
+ return nil, err
+ }
+ if result == nil || result.Len() < 1 {
+ result = make(gdb.Result, 0)
+ }
+ _ = db.GetCache().Set(ctx, cacheKey, result, duration)
+ return
+ },
+ }
+ }
+ )
+ gtest.C(t, func(t *gtest.T) {
+ defer db.GetCache().Clear(ctx)
+ count, err := db.Model(table).Count()
+ t.AssertNil(err)
+ t.Assert(count, 1)
+ count, err = db.Model(table).Hook(cacheFunc(time.Hour)).Count()
+ t.AssertNil(err)
+ t.Assert(count, 1)
+ count, err = db.Model(table).Hook(cacheFunc(time.Hour)).Count()
+ t.AssertNil(err)
+ t.Assert(count, 1)
+ })
+}
+
+// https://github.com/gogf/gf/issues/3932
+func Test_Issue3932(t *testing.T) {
+ table := createInitTable()
+ defer dropTable(table)
+
+ gtest.C(t, func(t *gtest.T) {
+ one, err := db.Model(table).Order("id", "desc").One()
+ t.AssertNil(err)
+ t.Assert(one["id"], 10)
+ })
+ gtest.C(t, func(t *gtest.T) {
+ one, err := db.Model(table).Order("id desc").One()
+ t.AssertNil(err)
+ t.Assert(one["id"], 10)
+ })
+ gtest.C(t, func(t *gtest.T) {
+ one, err := db.Model(table).Order("id desc, nickname asc").One()
+ t.AssertNil(err)
+ t.Assert(one["id"], 10)
+ })
+ gtest.C(t, func(t *gtest.T) {
+ one, err := db.Model(table).Order("id desc", "nickname asc").One()
+ t.AssertNil(err)
+ t.Assert(one["id"], 10)
+ })
+ gtest.C(t, func(t *gtest.T) {
+ one, err := db.Model(table).Order("id desc").Order("nickname asc").One()
+ t.AssertNil(err)
+ t.Assert(one["id"], 10)
+ })
+}
+
+// https://github.com/gogf/gf/issues/3968
+func Test_Issue3968(t *testing.T) {
+ table := createInitTable()
+ defer dropTable(table)
+
+ gtest.C(t, func(t *gtest.T) {
+ var hook = gdb.HookHandler{
+ Select: func(ctx context.Context, in *gdb.HookSelectInput) (result gdb.Result, err error) {
+ result, err = in.Next(ctx)
+ if err != nil {
+ return nil, err
+ }
+ if result != nil {
+ for i, _ := range result {
+ result[i]["location"] = gvar.New("ny")
+ }
+ }
+ return
+ },
+ }
+ var (
+ count int
+ result gdb.Result
+ )
+ err := db.Model(table).Hook(hook).ScanAndCount(&result, &count, false)
+ t.AssertNil(err)
+ t.Assert(count, 10)
+ t.Assert(len(result), 10)
+ })
+}
diff --git a/contrib/drivers/mysql/mysql_z_unit_model_test.go b/contrib/drivers/mysql/mysql_z_unit_model_test.go
index e6ef9fc9c..5f3033b36 100644
--- a/contrib/drivers/mysql/mysql_z_unit_model_test.go
+++ b/contrib/drivers/mysql/mysql_z_unit_model_test.go
@@ -12,6 +12,7 @@ import (
"database/sql"
"fmt"
"os"
+ "strings"
"testing"
"time"
@@ -733,6 +734,19 @@ func Test_Model_Count(t *testing.T) {
})
}
+func Test_Model_Exist(t *testing.T) {
+ table := createInitTable()
+ defer dropTable(table)
+ gtest.C(t, func(t *gtest.T) {
+ exist, err := db.Model(table).Exist()
+ t.AssertNil(err)
+ t.Assert(exist, TableSize > 0)
+ exist, err = db.Model(table).Where("id", -1).Exist()
+ t.AssertNil(err)
+ t.Assert(exist, false)
+ })
+}
+
func Test_Model_Value_WithCache(t *testing.T) {
table := createTable()
defer dropTable(table)
@@ -760,7 +774,7 @@ func Test_Model_Value_WithCache(t *testing.T) {
value, err := db.Model(table).Where("id", 1).Cache(gdb.CacheOption{
Duration: time.Second * 10,
Force: false,
- }).Value()
+ }).Value("id")
t.AssertNil(err)
t.Assert(value.Int(), 1)
})
@@ -1279,7 +1293,7 @@ func Test_Model_OrderBy(t *testing.T) {
})
gtest.C(t, func(t *gtest.T) {
- result, err := db.Model(table).Order("NULL").All()
+ result, err := db.Model(table).Order(gdb.Raw("NULL")).All()
t.AssertNil(err)
t.Assert(len(result), TableSize)
t.Assert(result[0]["nickname"].String(), "name_1")
@@ -2335,7 +2349,7 @@ func Test_Model_FieldsEx(t *testing.T) {
r, err := db.Model(table).FieldsEx("create_time, id").Where("id in (?)", g.Slice{1, 2}).Order("id asc").All()
t.AssertNil(err)
t.Assert(len(r), 2)
- t.Assert(len(r[0]), 3)
+ t.Assert(len(r[0]), 4)
t.Assert(r[0]["id"], "")
t.Assert(r[0]["passport"], "user_1")
t.Assert(r[0]["password"], "pass_1")
@@ -2964,13 +2978,13 @@ func Test_Model_FieldsEx_AutoMapping(t *testing.T) {
// "create_time": gtime.NewFromStr("2018-10-24 10:00:00").String(),
gtest.C(t, func(t *gtest.T) {
- value, err := db.Model(table).FieldsEx("Passport, Password, NickName, CreateTime").Where("id", 2).Value()
+ value, err := db.Model(table).FieldsEx("create_date, Passport, Password, NickName, CreateTime").Where("id", 2).Value()
t.AssertNil(err)
t.Assert(value.Int(), 2)
})
gtest.C(t, func(t *gtest.T) {
- value, err := db.Model(table).FieldsEx("ID, Passport, Password, CreateTime").Where("id", 2).Value()
+ value, err := db.Model(table).FieldsEx("create_date, ID, Passport, Password, CreateTime").Where("id", 2).Value()
t.AssertNil(err)
t.Assert(value.String(), "name_2")
})
@@ -2982,7 +2996,7 @@ func Test_Model_FieldsEx_AutoMapping(t *testing.T) {
"CreateTime": 1,
}).Where("id", 2).One()
t.AssertNil(err)
- t.Assert(len(one), 2)
+ t.Assert(len(one), 3)
t.Assert(one["id"], 2)
t.Assert(one["nickname"], "name_2")
})
@@ -2999,7 +3013,7 @@ func Test_Model_FieldsEx_AutoMapping(t *testing.T) {
CreateTime: 0,
}).Where("id", 2).One()
t.AssertNil(err)
- t.Assert(len(one), 2)
+ t.Assert(len(one), 3)
t.Assert(one["id"], 2)
t.Assert(one["nickname"], "name_2")
})
@@ -3157,8 +3171,8 @@ func Test_TimeZoneInsert(t *testing.T) {
gtest.AssertNil(err)
CreateTime := "2020-11-22 12:23:45"
- UpdateTime := "2020-11-22 13:23:45"
- DeleteTime := "2020-11-22 14:23:45"
+ UpdateTime := "2020-11-22 13:23:46"
+ DeleteTime := "2020-11-22 14:23:47"
type User struct {
Id int `json:"id"`
CreatedAt *gtime.Time `json:"created_at"`
@@ -3176,13 +3190,14 @@ func Test_TimeZoneInsert(t *testing.T) {
}
gtest.C(t, func(t *gtest.T) {
- _, _ = db.Model(tableName).Unscoped().Insert(u)
+ _, err = db.Model(tableName).Unscoped().Insert(u)
+ t.AssertNil(err)
userEntity := &User{}
- err := db.Model(tableName).Where("id", 1).Unscoped().Scan(&userEntity)
+ err = db.Model(tableName).Where("id", 1).Unscoped().Scan(&userEntity)
t.AssertNil(err)
t.Assert(userEntity.CreatedAt.String(), "2020-11-22 11:23:45")
- t.Assert(userEntity.UpdatedAt.String(), "2020-11-22 12:23:45")
- t.Assert(gtime.NewFromTime(userEntity.DeletedAt).String(), "2020-11-22 13:23:45")
+ t.Assert(userEntity.UpdatedAt.String(), "2020-11-22 12:23:46")
+ t.Assert(gtime.NewFromTime(userEntity.DeletedAt).String(), "2020-11-22 13:23:47")
})
}
@@ -4785,3 +4800,76 @@ func Test_Model_FixGdbJoin(t *testing.T) {
t.Assert(gtest.DataContent(`fix_gdb_join_expect.sql`), sqlSlice[len(sqlSlice)-1])
})
}
+
+func Test_Model_Year_Date_Time_DateTime_Timestamp(t *testing.T) {
+ table := "date_time_example"
+ array := gstr.SplitAndTrim(gtest.DataContent(`date_time_example.sql`), ";")
+ for _, v := range array {
+ if _, err := db.Exec(ctx, v); err != nil {
+ gtest.Error(err)
+ }
+ }
+ defer dropTable(table)
+
+ gtest.C(t, func(t *gtest.T) {
+ // insert.
+ var now = gtime.Now()
+ _, err := db.Model("date_time_example").Insert(g.Map{
+ "year": now,
+ "date": now,
+ "time": now,
+ "datetime": now,
+ "timestamp": now,
+ })
+ t.AssertNil(err)
+ // select.
+ one, err := db.Model("date_time_example").One()
+ t.AssertNil(err)
+ t.Assert(one["year"].String(), now.Format("Y"))
+ t.Assert(one["date"].String(), now.Format("Y-m-d"))
+ t.Assert(one["time"].String(), now.Format("H:i:s"))
+ t.AssertLT(one["datetime"].GTime().Sub(now).Seconds(), 5)
+ t.AssertLT(one["timestamp"].GTime().Sub(now).Seconds(), 5)
+ })
+}
+
+func Test_OrderBy_Statement_Generated(t *testing.T) {
+ gtest.C(t, func(t *gtest.T) {
+ array := gstr.SplitAndTrim(gtest.DataContent(`fix_gdb_order_by.sql`), ";")
+ for _, v := range array {
+ if _, err := db.Exec(ctx, v); err != nil {
+ gtest.Error(err)
+ }
+ }
+ defer dropTable(`employee`)
+ sqlArray, _ := gdb.CatchSQL(ctx, func(ctx context.Context) error {
+ g.DB("default").Ctx(ctx).Model("employee").Order("name asc", "age desc").All()
+ return nil
+ })
+ rawSql := strings.ReplaceAll(sqlArray[len(sqlArray)-1], " ", "")
+ expectSql := strings.ReplaceAll("SELECT * FROM `employee` ORDER BY `name` asc, `age` desc", " ", "")
+ t.Assert(rawSql, expectSql)
+ })
+}
+
+func Test_Fields_Raw(t *testing.T) {
+ gtest.C(t, func(t *gtest.T) {
+ table := createInitTable()
+ defer dropTable(table)
+ one, err := db.Model(table).Fields(gdb.Raw("1")).One()
+ t.AssertNil(err)
+ t.Assert(one["1"], 1)
+
+ one, err = db.Model(table).Fields(gdb.Raw("2")).One()
+ t.AssertNil(err)
+ t.Assert(one["2"], 2)
+
+ one, err = db.Model(table).Fields(gdb.Raw("2")).Where("id", 2).One()
+ t.AssertNil(err)
+ t.Assert(one["2"], 2)
+
+ one, err = db.Model(table).Fields(gdb.Raw("2")).Where("id", 10000000000).One()
+ t.AssertNil(err)
+ t.Assert(len(one), 0)
+ })
+}
diff --git a/contrib/drivers/mysql/mysql_z_unit_transaction_test.go b/contrib/drivers/mysql/mysql_z_unit_transaction_test.go
index f29036092..b0e2a0cc1 100644
--- a/contrib/drivers/mysql/mysql_z_unit_transaction_test.go
+++ b/contrib/drivers/mysql/mysql_z_unit_transaction_test.go
@@ -20,67 +20,71 @@ import (
)
func Test_TX_Query(t *testing.T) {
- tx, err := db.Begin(ctx)
- if err != nil {
- gtest.Error(err)
- }
- if _, err = tx.Query("SELECT ?", 1); err != nil {
- gtest.Error(err)
- }
- if _, err = tx.Query("SELECT ?+?", 1, 2); err != nil {
- gtest.Error(err)
- }
- if _, err = tx.Query("SELECT ?+?", g.Slice{1, 2}); err != nil {
- gtest.Error(err)
- }
- if _, err = tx.Query("ERROR"); err == nil {
- gtest.Error("FAIL")
- }
- if err = tx.Commit(); err != nil {
- gtest.Error(err)
- }
+ gtest.C(t, func(t *gtest.T) {
+ tx, err := db.Begin(ctx)
+ t.AssertNil(err)
+
+ _, err = tx.Query("SELECT ?", 1)
+ t.AssertNil(err)
+
+ _, err = tx.Query("SELECT ?+?", 1, 2)
+ t.AssertNil(err)
+
+ _, err = tx.Query("SELECT ?+?", g.Slice{1, 2})
+ t.AssertNil(err)
+
+ _, err = tx.Query("ERROR")
+ t.AssertNE(err, nil)
+
+ err = tx.Commit()
+ t.AssertNil(err)
+
+ })
}
func Test_TX_Exec(t *testing.T) {
- tx, err := db.Begin(ctx)
- if err != nil {
- gtest.Error(err)
- }
- if _, err := tx.Exec("SELECT ?", 1); err != nil {
- gtest.Error(err)
- }
- if _, err := tx.Exec("SELECT ?+?", 1, 2); err != nil {
- gtest.Error(err)
- }
- if _, err := tx.Exec("SELECT ?+?", g.Slice{1, 2}); err != nil {
- gtest.Error(err)
- }
- if _, err := tx.Exec("ERROR"); err == nil {
- gtest.Error("FAIL")
- }
- if err := tx.Commit(); err != nil {
- gtest.Error(err)
- }
+ gtest.C(t, func(t *gtest.T) {
+ tx, err := db.Begin(ctx)
+ t.AssertNil(err)
+
+ _, err = tx.Exec("SELECT ?", 1)
+ t.AssertNil(err)
+
+ _, err = tx.Exec("SELECT ?+?", 1, 2)
+ t.AssertNil(err)
+
+ _, err = tx.Exec("SELECT ?+?", g.Slice{1, 2})
+ t.AssertNil(err)
+
+ _, err = tx.Exec("ERROR")
+ t.AssertNE(err, nil)
+
+ err = tx.Commit()
+ t.AssertNil(err)
+
+ })
}
func Test_TX_Commit(t *testing.T) {
- tx, err := db.Begin(ctx)
- if err != nil {
- gtest.Error(err)
- }
- if err := tx.Commit(); err != nil {
- gtest.Error(err)
- }
+ gtest.C(t, func(t *gtest.T) {
+ tx, err := db.Begin(ctx)
+ t.AssertNil(err)
+
+ err = tx.Commit()
+ t.AssertNil(err)
+
+ })
}
func Test_TX_Rollback(t *testing.T) {
- tx, err := db.Begin(ctx)
- if err != nil {
- gtest.Error(err)
- }
- if err := tx.Rollback(); err != nil {
- gtest.Error(err)
- }
+ gtest.C(t, func(t *gtest.T) {
+ tx, err := db.Begin(ctx)
+ t.AssertNil(err)
+
+ err = tx.Rollback()
+ t.AssertNil(err)
+
+ })
}
func Test_TX_Prepare(t *testing.T) {
@@ -96,13 +100,15 @@ func Test_TX_Prepare(t *testing.T) {
array, err := rows.Columns()
t.AssertNil(err)
+
t.Assert(array[0], "100")
- rows.Close()
+ err = rows.Close()
t.AssertNil(err)
- tx.Commit()
+ err = tx.Commit()
t.AssertNil(err)
+
})
}
@@ -112,38 +118,36 @@ func Test_TX_Insert(t *testing.T) {
gtest.C(t, func(t *gtest.T) {
tx, err := db.Begin(ctx)
- if err != nil {
- gtest.Error(err)
- }
+ t.AssertNil(err)
+
user := tx.Model(table)
- if _, err := user.Data(g.Map{
+
+ _, err = user.Data(g.Map{
"id": 1,
"passport": "t1",
"password": "25d55ad283aa400af464c76d713c07ad",
"nickname": "T1",
"create_time": gtime.Now().String(),
- }).Insert(); err != nil {
- gtest.Error(err)
- }
- if _, err := tx.Insert(table, g.Map{
+ }).Insert()
+ t.AssertNil(err)
+
+ _, err = tx.Insert(table, g.Map{
"id": 2,
"passport": "t1",
"password": "25d55ad283aa400af464c76d713c07ad",
"nickname": "T1",
"create_time": gtime.Now().String(),
- }); err != nil {
- gtest.Error(err)
- }
+ })
+ t.AssertNil(err)
- if n, err := tx.Model(table).Count(); err != nil {
- gtest.Error(err)
- } else {
- t.Assert(n, int64(2))
- }
+ n, err := tx.Model(table).Count()
+ t.AssertNil(err)
+
+ t.Assert(n, int64(2))
+
+ err = tx.Commit()
+ t.AssertNil(err)
- if err := tx.Commit(); err != nil {
- gtest.Error(err)
- }
})
}
@@ -153,10 +157,9 @@ func Test_TX_BatchInsert(t *testing.T) {
gtest.C(t, func(t *gtest.T) {
tx, err := db.Begin(ctx)
- if err != nil {
- gtest.Error(err)
- }
- if _, err := tx.Insert(table, g.List{
+ t.AssertNil(err)
+
+ _, err = tx.Insert(table, g.List{
{
"id": 2,
"passport": "t",
@@ -171,17 +174,16 @@ func Test_TX_BatchInsert(t *testing.T) {
"nickname": "T3",
"create_time": gtime.Now().String(),
},
- }, 10); err != nil {
- gtest.Error(err)
- }
- if err := tx.Commit(); err != nil {
- gtest.Error(err)
- }
- if n, err := db.Model(table).Count(); err != nil {
- gtest.Error(err)
- } else {
- t.Assert(n, int64(2))
- }
+ }, 10)
+ t.AssertNil(err)
+
+ err = tx.Commit()
+ t.AssertNil(err)
+
+ n, err := db.Model(table).Count()
+ t.AssertNil(err)
+
+ t.Assert(n, int64(2))
})
}
@@ -191,10 +193,9 @@ func Test_TX_BatchReplace(t *testing.T) {
gtest.C(t, func(t *gtest.T) {
tx, err := db.Begin(ctx)
- if err != nil {
- gtest.Error(err)
- }
- if _, err := tx.Replace(table, g.List{
+ t.AssertNil(err)
+
+ _, err = tx.Replace(table, g.List{
{
"id": 2,
"passport": "USER_2",
@@ -209,22 +210,21 @@ func Test_TX_BatchReplace(t *testing.T) {
"nickname": "NAME_4",
"create_time": gtime.Now().String(),
},
- }, 10); err != nil {
- gtest.Error(err)
- }
- if err := tx.Commit(); err != nil {
- gtest.Error(err)
- }
- if n, err := db.Model(table).Count(); err != nil {
- gtest.Error(err)
- } else {
- t.Assert(n, int64(TableSize))
- }
- if value, err := db.Model(table).Fields("password").Where("id", 2).Value(); err != nil {
- gtest.Error(err)
- } else {
- t.Assert(value.String(), "PASS_2")
- }
+ }, 10)
+ t.AssertNil(err)
+
+ err = tx.Commit()
+ t.AssertNil(err)
+
+ n, err := db.Model(table).Count()
+ t.AssertNil(err)
+
+ t.Assert(n, int64(TableSize))
+
+ value, err := db.Model(table).Fields("password").Where("id", 2).Value()
+ t.AssertNil(err)
+
+ t.Assert(value.String(), "PASS_2")
})
}
@@ -234,10 +234,9 @@ func Test_TX_BatchSave(t *testing.T) {
gtest.C(t, func(t *gtest.T) {
tx, err := db.Begin(ctx)
- if err != nil {
- gtest.Error(err)
- }
- if _, err := tx.Save(table, g.List{
+ t.AssertNil(err)
+
+ _, err = tx.Save(table, g.List{
{
"id": 4,
"passport": "USER_4",
@@ -245,24 +244,21 @@ func Test_TX_BatchSave(t *testing.T) {
"nickname": "NAME_4",
"create_time": gtime.Now().String(),
},
- }, 10); err != nil {
- gtest.Error(err)
- }
- if err := tx.Commit(); err != nil {
- gtest.Error(err)
- }
+ }, 10)
+ t.AssertNil(err)
- if n, err := db.Model(table).Count(); err != nil {
- gtest.Error(err)
- } else {
- t.Assert(n, int64(TableSize))
- }
+ err = tx.Commit()
+ t.AssertNil(err)
- if value, err := db.Model(table).Fields("password").Where("id", 4).Value(); err != nil {
- gtest.Error(err)
- } else {
- t.Assert(value.String(), "PASS_4")
- }
+ n, err := db.Model(table).Count()
+ t.AssertNil(err)
+
+ t.Assert(n, int64(TableSize))
+
+ value, err := db.Model(table).Fields("password").Where("id", 4).Value()
+ t.AssertNil(err)
+
+ t.Assert(value.String(), "PASS_4")
})
}
@@ -272,26 +268,24 @@ func Test_TX_Replace(t *testing.T) {
gtest.C(t, func(t *gtest.T) {
tx, err := db.Begin(ctx)
- if err != nil {
- gtest.Error(err)
- }
- if _, err := tx.Replace(table, g.Map{
+ t.AssertNil(err)
+
+ _, err = tx.Replace(table, g.Map{
"id": 1,
"passport": "USER_1",
"password": "PASS_1",
"nickname": "NAME_1",
"create_time": gtime.Now().String(),
- }); err != nil {
- gtest.Error(err)
- }
- if err := tx.Rollback(); err != nil {
- gtest.Error(err)
- }
- if value, err := db.Model(table).Fields("nickname").Where("id", 1).Value(); err != nil {
- gtest.Error(err)
- } else {
- t.Assert(value.String(), "name_1")
- }
+ })
+ t.AssertNil(err)
+
+ err = tx.Rollback()
+ t.AssertNil(err)
+
+ value, err := db.Model(table).Fields("nickname").Where("id", 1).Value()
+ t.AssertNil(err)
+
+ t.Assert(value.String(), "name_1")
})
}
@@ -301,26 +295,24 @@ func Test_TX_Save(t *testing.T) {
gtest.C(t, func(t *gtest.T) {
tx, err := db.Begin(ctx)
- if err != nil {
- gtest.Error(err)
- }
- if _, err := tx.Save(table, g.Map{
+ t.AssertNil(err)
+
+ _, err = tx.Save(table, g.Map{
"id": 1,
"passport": "USER_1",
"password": "PASS_1",
"nickname": "NAME_1",
"create_time": gtime.Now().String(),
- }); err != nil {
- gtest.Error(err)
- }
- if err := tx.Commit(); err != nil {
- gtest.Error(err)
- }
- if value, err := db.Model(table).Fields("nickname").Where("id", 1).Value(); err != nil {
- gtest.Error(err)
- } else {
- t.Assert(value.String(), "NAME_1")
- }
+ })
+ t.AssertNil(err)
+
+ err = tx.Commit()
+ t.AssertNil(err)
+
+ value, err := db.Model(table).Fields("nickname").Where("id", 1).Value()
+ t.AssertNil(err)
+
+ t.Assert(value.String(), "NAME_1")
})
}
@@ -330,26 +322,24 @@ func Test_TX_Update(t *testing.T) {
gtest.C(t, func(t *gtest.T) {
tx, err := db.Begin(ctx)
- if err != nil {
- gtest.Error(err)
- }
- if result, err := tx.Update(table, "create_time='2019-10-24 10:00:00'", "id=3"); err != nil {
- gtest.Error(err)
- } else {
- n, _ := result.RowsAffected()
- t.Assert(n, 1)
- }
- if err := tx.Commit(); err != nil {
- gtest.Error(err)
- }
+ t.AssertNil(err)
+
+ result, err := tx.Update(table, "create_time='2019-10-24 10:00:00'", "id=3")
+ t.AssertNil(err)
+
+ n, _ := result.RowsAffected()
+ t.Assert(n, 1)
+
+ err = tx.Commit()
+ t.AssertNil(err)
+
_, err = tx.Model(table).Fields("create_time").Where("id", 3).Value()
t.AssertNE(err, nil)
- if value, err := db.Model(table).Fields("create_time").Where("id", 3).Value(); err != nil {
- gtest.Error(err)
- } else {
- t.Assert(value.String(), "2019-10-24 10:00:00")
- }
+ value, err := db.Model(table).Fields("create_time").Where("id", 3).Value()
+ t.AssertNil(err)
+
+ t.Assert(value.String(), "2019-10-24 10:00:00")
})
}
@@ -359,17 +349,16 @@ func Test_TX_GetAll(t *testing.T) {
gtest.C(t, func(t *gtest.T) {
tx, err := db.Begin(ctx)
- if err != nil {
- gtest.Error(err)
- }
- if result, err := tx.GetAll(fmt.Sprintf("SELECT * FROM %s WHERE id=?", table), 1); err != nil {
- gtest.Error(err)
- } else {
- t.Assert(len(result), 1)
- }
- if err := tx.Commit(); err != nil {
- gtest.Error(err)
- }
+ t.AssertNil(err)
+
+ result, err := tx.GetAll(fmt.Sprintf("SELECT * FROM %s WHERE id=?", table), 1)
+ t.AssertNil(err)
+
+ t.Assert(len(result), 1)
+
+ err = tx.Commit()
+ t.AssertNil(err)
+
})
}
@@ -379,20 +368,17 @@ func Test_TX_GetOne(t *testing.T) {
gtest.C(t, func(t *gtest.T) {
tx, err := db.Begin(ctx)
- if err != nil {
- gtest.Error(err)
- }
- if record, err := tx.GetOne(fmt.Sprintf("SELECT * FROM %s WHERE passport=?", table), "user_2"); err != nil {
- gtest.Error(err)
- } else {
- if record == nil {
- gtest.Error("FAIL")
- }
- t.Assert(record["nickname"].String(), "name_2")
- }
- if err := tx.Commit(); err != nil {
- gtest.Error(err)
- }
+ t.AssertNil(err)
+
+ record, err := tx.GetOne(fmt.Sprintf("SELECT * FROM %s WHERE passport=?", table), "user_2")
+ t.AssertNil(err)
+
+ t.AssertNE(record, nil)
+ t.Assert(record["nickname"].String(), "name_2")
+
+ err = tx.Commit()
+ t.AssertNil(err)
+
})
}
@@ -402,17 +388,16 @@ func Test_TX_GetValue(t *testing.T) {
gtest.C(t, func(t *gtest.T) {
tx, err := db.Begin(ctx)
- if err != nil {
- gtest.Error(err)
- }
- if value, err := tx.GetValue(fmt.Sprintf("SELECT id FROM %s WHERE passport=?", table), "user_3"); err != nil {
- gtest.Error(err)
- } else {
- t.Assert(value.Int(), 3)
- }
- if err := tx.Commit(); err != nil {
- gtest.Error(err)
- }
+ t.AssertNil(err)
+
+ value, err := tx.GetValue(fmt.Sprintf("SELECT id FROM %s WHERE passport=?", table), "user_3")
+ t.AssertNil(err)
+
+ t.Assert(value.Int(), 3)
+
+ err = tx.Commit()
+ t.AssertNil(err)
+
})
}
@@ -422,17 +407,16 @@ func Test_TX_GetCount(t *testing.T) {
gtest.C(t, func(t *gtest.T) {
tx, err := db.Begin(ctx)
- if err != nil {
- gtest.Error(err)
- }
- if count, err := tx.GetCount("SELECT * FROM " + table); err != nil {
- gtest.Error(err)
- } else {
- t.Assert(count, int64(TableSize))
- }
- if err := tx.Commit(); err != nil {
- gtest.Error(err)
- }
+ t.AssertNil(err)
+
+ count, err := tx.GetCount("SELECT * FROM " + table)
+ t.AssertNil(err)
+
+ t.Assert(count, int64(TableSize))
+
+ err = tx.Commit()
+ t.AssertNil(err)
+
})
}
@@ -442,9 +426,8 @@ func Test_TX_GetStruct(t *testing.T) {
gtest.C(t, func(t *gtest.T) {
tx, err := db.Begin(ctx)
- if err != nil {
- gtest.Error(err)
- }
+ t.AssertNil(err)
+
type User struct {
Id int
Passport string
@@ -453,20 +436,21 @@ func Test_TX_GetStruct(t *testing.T) {
CreateTime gtime.Time
}
user := new(User)
- if err := tx.GetStruct(user, fmt.Sprintf("SELECT * FROM %s WHERE id=?", table), 3); err != nil {
- gtest.Error(err)
- }
+ err = tx.GetStruct(user, fmt.Sprintf("SELECT * FROM %s WHERE id=?", table), 3)
+ t.AssertNil(err)
+
t.Assert(user.NickName, "name_3")
t.Assert(user.CreateTime.String(), "2018-10-24 10:00:00")
- if err := tx.Commit(); err != nil {
- gtest.Error(err)
- }
+
+ err = tx.Commit()
+ t.AssertNil(err)
+
})
+
gtest.C(t, func(t *gtest.T) {
tx, err := db.Begin(ctx)
- if err != nil {
- gtest.Error(err)
- }
+ t.AssertNil(err)
+
type User struct {
Id int
Passport string
@@ -475,14 +459,14 @@ func Test_TX_GetStruct(t *testing.T) {
CreateTime *gtime.Time
}
user := new(User)
- if err := tx.GetStruct(user, fmt.Sprintf("SELECT * FROM %s WHERE id=?", table), 3); err != nil {
- gtest.Error(err)
- }
+ err = tx.GetStruct(user, fmt.Sprintf("SELECT * FROM %s WHERE id=?", table), 3)
+ t.AssertNil(err)
+
t.Assert(user.NickName, "name_3")
t.Assert(user.CreateTime.String(), "2018-10-24 10:00:00")
- if err := tx.Commit(); err != nil {
- gtest.Error(err)
- }
+ err = tx.Commit()
+ t.AssertNil(err)
+
})
}
@@ -492,9 +476,8 @@ func Test_TX_GetStructs(t *testing.T) {
gtest.C(t, func(t *gtest.T) {
tx, err := db.Begin(ctx)
- if err != nil {
- gtest.Error(err)
- }
+ t.AssertNil(err)
+
type User struct {
Id int
Passport string
@@ -503,9 +486,9 @@ func Test_TX_GetStructs(t *testing.T) {
CreateTime gtime.Time
}
var users []User
- if err := tx.GetStructs(&users, fmt.Sprintf("SELECT * FROM %s WHERE id>=?", table), 1); err != nil {
- gtest.Error(err)
- }
+ err = tx.GetStructs(&users, fmt.Sprintf("SELECT * FROM %s WHERE id>=?", table), 1)
+ t.AssertNil(err)
+
t.Assert(len(users), TableSize)
t.Assert(users[0].Id, 1)
t.Assert(users[1].Id, 2)
@@ -514,16 +497,15 @@ func Test_TX_GetStructs(t *testing.T) {
t.Assert(users[1].NickName, "name_2")
t.Assert(users[2].NickName, "name_3")
t.Assert(users[2].CreateTime.String(), "2018-10-24 10:00:00")
- if err := tx.Commit(); err != nil {
- gtest.Error(err)
- }
+ err = tx.Commit()
+ t.AssertNil(err)
+
})
gtest.C(t, func(t *gtest.T) {
tx, err := db.Begin(ctx)
- if err != nil {
- gtest.Error(err)
- }
+ t.AssertNil(err)
+
type User struct {
Id int
Passport string
@@ -532,9 +514,9 @@ func Test_TX_GetStructs(t *testing.T) {
CreateTime *gtime.Time
}
var users []User
- if err := tx.GetStructs(&users, fmt.Sprintf("SELECT * FROM %s WHERE id>=?", table), 1); err != nil {
- gtest.Error(err)
- }
+ err = tx.GetStructs(&users, fmt.Sprintf("SELECT * FROM %s WHERE id>=?", table), 1)
+ t.AssertNil(err)
+
t.Assert(len(users), TableSize)
t.Assert(users[0].Id, 1)
t.Assert(users[1].Id, 2)
@@ -543,9 +525,9 @@ func Test_TX_GetStructs(t *testing.T) {
t.Assert(users[1].NickName, "name_2")
t.Assert(users[2].NickName, "name_3")
t.Assert(users[2].CreateTime.String(), "2018-10-24 10:00:00")
- if err := tx.Commit(); err != nil {
- gtest.Error(err)
- }
+ err = tx.Commit()
+ t.AssertNil(err)
+
})
}
@@ -555,9 +537,8 @@ func Test_TX_GetScan(t *testing.T) {
gtest.C(t, func(t *gtest.T) {
tx, err := db.Begin(ctx)
- if err != nil {
- gtest.Error(err)
- }
+ t.AssertNil(err)
+
type User struct {
Id int
Passport string
@@ -566,20 +547,19 @@ func Test_TX_GetScan(t *testing.T) {
CreateTime gtime.Time
}
user := new(User)
- if err := tx.GetScan(user, fmt.Sprintf("SELECT * FROM %s WHERE id=?", table), 3); err != nil {
- gtest.Error(err)
- }
+ err = tx.GetScan(user, fmt.Sprintf("SELECT * FROM %s WHERE id=?", table), 3)
+ t.AssertNil(err)
+
t.Assert(user.NickName, "name_3")
t.Assert(user.CreateTime.String(), "2018-10-24 10:00:00")
- if err := tx.Commit(); err != nil {
- gtest.Error(err)
- }
+ err = tx.Commit()
+ t.AssertNil(err)
+
})
gtest.C(t, func(t *gtest.T) {
tx, err := db.Begin(ctx)
- if err != nil {
- gtest.Error(err)
- }
+ t.AssertNil(err)
+
type User struct {
Id int
Passport string
@@ -588,21 +568,20 @@ func Test_TX_GetScan(t *testing.T) {
CreateTime *gtime.Time
}
user := new(User)
- if err := tx.GetScan(user, fmt.Sprintf("SELECT * FROM %s WHERE id=?", table), 3); err != nil {
- gtest.Error(err)
- }
+ err = tx.GetScan(user, fmt.Sprintf("SELECT * FROM %s WHERE id=?", table), 3)
+ t.AssertNil(err)
+
t.Assert(user.NickName, "name_3")
t.Assert(user.CreateTime.String(), "2018-10-24 10:00:00")
- if err := tx.Commit(); err != nil {
- gtest.Error(err)
- }
+ err = tx.Commit()
+ t.AssertNil(err)
+
})
gtest.C(t, func(t *gtest.T) {
tx, err := db.Begin(ctx)
- if err != nil {
- gtest.Error(err)
- }
+ t.AssertNil(err)
+
type User struct {
Id int
Passport string
@@ -611,9 +590,9 @@ func Test_TX_GetScan(t *testing.T) {
CreateTime gtime.Time
}
var users []User
- if err := tx.GetScan(&users, fmt.Sprintf("SELECT * FROM %s WHERE id>=?", table), 1); err != nil {
- gtest.Error(err)
- }
+ err = tx.GetScan(&users, fmt.Sprintf("SELECT * FROM %s WHERE id>=?", table), 1)
+ t.AssertNil(err)
+
t.Assert(len(users), TableSize)
t.Assert(users[0].Id, 1)
t.Assert(users[1].Id, 2)
@@ -622,16 +601,15 @@ func Test_TX_GetScan(t *testing.T) {
t.Assert(users[1].NickName, "name_2")
t.Assert(users[2].NickName, "name_3")
t.Assert(users[2].CreateTime.String(), "2018-10-24 10:00:00")
- if err := tx.Commit(); err != nil {
- gtest.Error(err)
- }
+ err = tx.Commit()
+ t.AssertNil(err)
+
})
gtest.C(t, func(t *gtest.T) {
tx, err := db.Begin(ctx)
- if err != nil {
- gtest.Error(err)
- }
+ t.AssertNil(err)
+
type User struct {
Id int
Passport string
@@ -640,9 +618,9 @@ func Test_TX_GetScan(t *testing.T) {
CreateTime *gtime.Time
}
var users []User
- if err := tx.GetScan(&users, fmt.Sprintf("SELECT * FROM %s WHERE id>=?", table), 1); err != nil {
- gtest.Error(err)
- }
+ err = tx.GetScan(&users, fmt.Sprintf("SELECT * FROM %s WHERE id>=?", table), 1)
+ t.AssertNil(err)
+
t.Assert(len(users), TableSize)
t.Assert(users[0].Id, 1)
t.Assert(users[1].Id, 2)
@@ -651,9 +629,9 @@ func Test_TX_GetScan(t *testing.T) {
t.Assert(users[1].NickName, "name_2")
t.Assert(users[2].NickName, "name_3")
t.Assert(users[2].CreateTime.String(), "2018-10-24 10:00:00")
- if err := tx.Commit(); err != nil {
- gtest.Error(err)
- }
+ err = tx.Commit()
+ t.AssertNil(err)
+
})
}
@@ -662,21 +640,18 @@ func Test_TX_Delete(t *testing.T) {
table := createInitTable()
defer dropTable(table)
tx, err := db.Begin(ctx)
- if err != nil {
- gtest.Error(err)
- }
- if _, err := tx.Delete(table, 1); err != nil {
- gtest.Error(err)
- }
- if err := tx.Commit(); err != nil {
- gtest.Error(err)
- }
- if n, err := db.Model(table).Count(); err != nil {
- gtest.Error(err)
- } else {
- t.Assert(n, int64(0))
- }
+ t.AssertNil(err)
+ _, err = tx.Delete(table, 1)
+ t.AssertNil(err)
+
+ err = tx.Commit()
+ t.AssertNil(err)
+
+ n, err := db.Model(table).Count()
+ t.AssertNil(err)
+
+ t.Assert(n, int64(0))
t.Assert(tx.IsClosed(), true)
})
@@ -684,27 +659,22 @@ func Test_TX_Delete(t *testing.T) {
table := createInitTable()
defer dropTable(table)
tx, err := db.Begin(ctx)
- if err != nil {
- gtest.Error(err)
- }
- if _, err := tx.Delete(table, 1); err != nil {
- gtest.Error(err)
- }
- if n, err := tx.Model(table).Count(); err != nil {
- gtest.Error(err)
- } else {
- t.Assert(n, int64(0))
- }
- if err := tx.Rollback(); err != nil {
- gtest.Error(err)
- }
- if n, err := db.Model(table).Count(); err != nil {
- gtest.Error(err)
- } else {
- t.Assert(n, int64(TableSize))
- t.AssertNE(n, int64(0))
- }
+ t.AssertNil(err)
+ _, err = tx.Delete(table, 1)
+ t.AssertNil(err)
+
+ n, err := tx.Model(table).Count()
+ t.AssertNil(err)
+ t.Assert(n, int64(0))
+
+ err = tx.Rollback()
+ t.AssertNil(err)
+
+ n, err = db.Model(table).Count()
+ t.AssertNil(err)
+ t.Assert(n, int64(TableSize))
+ t.AssertNE(n, int64(0))
t.Assert(tx.IsClosed(), true)
})
}
@@ -716,48 +686,43 @@ func Test_Transaction(t *testing.T) {
gtest.C(t, func(t *gtest.T) {
ctx := context.TODO()
err := db.Transaction(ctx, func(ctx context.Context, tx gdb.TX) error {
- if _, err := tx.Ctx(ctx).Replace(table, g.Map{
+ _, err := tx.Ctx(ctx).Replace(table, g.Map{
"id": 1,
"passport": "USER_1",
"password": "PASS_1",
"nickname": "NAME_1",
"create_time": gtime.Now().String(),
- }); err != nil {
- t.Error(err)
- }
+ })
+ t.AssertNil(err)
+
t.Assert(tx.IsClosed(), false)
return gerror.New("error")
})
t.AssertNE(err, nil)
- if value, err := db.Model(table).Ctx(ctx).Fields("nickname").Where("id", 1).Value(); err != nil {
- gtest.Error(err)
- } else {
- t.Assert(value.String(), "name_1")
- }
+ value, err := db.Model(table).Ctx(ctx).Fields("nickname").Where("id", 1).Value()
+ t.AssertNil(err)
+ t.Assert(value.String(), "name_1")
})
gtest.C(t, func(t *gtest.T) {
ctx := context.TODO()
err := db.Transaction(ctx, func(ctx context.Context, tx gdb.TX) error {
- if _, err := tx.Replace(table, g.Map{
+ _, err := tx.Replace(table, g.Map{
"id": 1,
"passport": "USER_1",
"password": "PASS_1",
"nickname": "NAME_1",
"create_time": gtime.Now().String(),
- }); err != nil {
- t.Error(err)
- }
+ })
+ t.AssertNil(err)
return nil
})
t.AssertNil(err)
- if value, err := db.Model(table).Fields("nickname").Where("id", 1).Value(); err != nil {
- gtest.Error(err)
- } else {
- t.Assert(value.String(), "NAME_1")
- }
+ value, err := db.Model(table).Fields("nickname").Where("id", 1).Value()
+ t.AssertNil(err)
+ t.Assert(value.String(), "NAME_1")
})
}
@@ -768,25 +733,22 @@ func Test_Transaction_Panic(t *testing.T) {
gtest.C(t, func(t *gtest.T) {
ctx := context.TODO()
err := db.Transaction(ctx, func(ctx context.Context, tx gdb.TX) error {
- if _, err := tx.Replace(table, g.Map{
+ _, err := tx.Replace(table, g.Map{
"id": 1,
"passport": "USER_1",
"password": "PASS_1",
"nickname": "NAME_1",
"create_time": gtime.Now().String(),
- }); err != nil {
- t.Error(err)
- }
+ })
+ t.AssertNil(err)
panic("error")
return nil
})
t.AssertNE(err, nil)
- if value, err := db.Model(table).Fields("nickname").Where("id", 1).Value(); err != nil {
- gtest.Error(err)
- } else {
- t.Assert(value.String(), "name_1")
- }
+ value, err := db.Model(table).Fields("nickname").Where("id", 1).Value()
+ t.AssertNil(err)
+ t.Assert(value.String(), "name_1")
})
}
@@ -797,9 +759,11 @@ func Test_Transaction_Nested_Begin_Rollback_Commit(t *testing.T) {
gtest.C(t, func(t *gtest.T) {
tx, err := db.Begin(ctx)
t.AssertNil(err)
+
// tx begin.
err = tx.Begin()
t.AssertNil(err)
+
// tx rollback.
_, err = tx.Model(table).Data(g.Map{
"id": 1,
@@ -809,6 +773,7 @@ func Test_Transaction_Nested_Begin_Rollback_Commit(t *testing.T) {
}).Insert()
err = tx.Rollback()
t.AssertNil(err)
+
// tx commit.
_, err = tx.Model(table).Data(g.Map{
"id": 2,
@@ -818,9 +783,11 @@ func Test_Transaction_Nested_Begin_Rollback_Commit(t *testing.T) {
}).Insert()
err = tx.Commit()
t.AssertNil(err)
+
// check data.
all, err := db.Model(table).All()
t.AssertNil(err)
+
t.Assert(len(all), 1)
t.Assert(all[0]["id"], 2)
})
@@ -853,21 +820,27 @@ func Test_Transaction_Nested_TX_Transaction_UseTX(t *testing.T) {
"create_time": gtime.Now().String(),
}).Insert()
t.AssertNil(err)
+
return err
})
t.AssertNil(err)
+
return err
})
t.AssertNil(err)
+
return err
})
t.AssertNil(err)
+
return err
})
t.AssertNil(err)
+
return err
})
t.AssertNil(err)
+
// rollback
err = tx.Transaction(ctx, func(ctx context.Context, tx gdb.TX) error {
_, err = tx.Model(table).Data(g.Map{
@@ -878,6 +851,7 @@ func Test_Transaction_Nested_TX_Transaction_UseTX(t *testing.T) {
"create_time": gtime.Now().String(),
}).Insert()
t.AssertNil(err)
+
panic("error")
return err
})
@@ -888,6 +862,7 @@ func Test_Transaction_Nested_TX_Transaction_UseTX(t *testing.T) {
all, err := db.Ctx(ctx).Model(table).All()
t.AssertNil(err)
+
t.Assert(len(all), 1)
t.Assert(all[0]["id"], 1)
@@ -907,21 +882,27 @@ func Test_Transaction_Nested_TX_Transaction_UseTX(t *testing.T) {
"create_time": gtime.Now().String(),
}).Insert()
t.AssertNil(err)
+
return err
})
t.AssertNil(err)
+
return err
})
t.AssertNil(err)
+
return err
})
t.AssertNil(err)
+
return err
})
t.AssertNil(err)
+
return err
})
t.AssertNil(err)
+
// rollback
err = tx.Transaction(ctx, func(ctx context.Context, tx gdb.TX) error {
_, err = tx.Model(table).Data(g.Map{
@@ -932,6 +913,7 @@ func Test_Transaction_Nested_TX_Transaction_UseTX(t *testing.T) {
"create_time": gtime.Now().String(),
}).Insert()
t.AssertNil(err)
+
panic("error")
return err
})
@@ -942,6 +924,7 @@ func Test_Transaction_Nested_TX_Transaction_UseTX(t *testing.T) {
all, err = db.Ctx(ctx).Model(table).All()
t.AssertNil(err)
+
t.Assert(len(all), 2)
t.Assert(all[0]["id"], 1)
t.Assert(all[1]["id"], 3)
@@ -975,18 +958,23 @@ func Test_Transaction_Nested_TX_Transaction_UseDB(t *testing.T) {
"create_time": gtime.Now().String(),
}).Insert()
t.AssertNil(err)
+
return err
})
t.AssertNil(err)
+
return err
})
t.AssertNil(err)
+
return err
})
t.AssertNil(err)
+
return err
})
t.AssertNil(err)
+
return err
})
t.AssertNil(err)
@@ -1001,6 +989,7 @@ func Test_Transaction_Nested_TX_Transaction_UseDB(t *testing.T) {
"create_time": gtime.Now().String(),
}).Insert()
t.AssertNil(err)
+
// panic makes this transaction rollback.
panic("error")
return err
@@ -1009,8 +998,10 @@ func Test_Transaction_Nested_TX_Transaction_UseDB(t *testing.T) {
return nil
})
t.AssertNil(err)
+
all, err := db.Model(table).All()
t.AssertNil(err)
+
t.Assert(len(all), 1)
t.Assert(all[0]["id"], 1)
@@ -1029,18 +1020,23 @@ func Test_Transaction_Nested_TX_Transaction_UseDB(t *testing.T) {
"create_time": gtime.Now().String(),
}).Insert()
t.AssertNil(err)
+
return err
})
t.AssertNil(err)
+
return err
})
t.AssertNil(err)
+
return err
})
t.AssertNil(err)
+
return err
})
t.AssertNil(err)
+
return err
})
t.AssertNil(err)
@@ -1055,6 +1051,7 @@ func Test_Transaction_Nested_TX_Transaction_UseDB(t *testing.T) {
"create_time": gtime.Now().String(),
}).Insert()
t.AssertNil(err)
+
// panic makes this transaction rollback.
panic("error")
return err
@@ -1066,6 +1063,7 @@ func Test_Transaction_Nested_TX_Transaction_UseDB(t *testing.T) {
all, err = db.Model(table).All()
t.AssertNil(err)
+
t.Assert(len(all), 2)
t.Assert(all[0]["id"], 1)
t.Assert(all[1]["id"], 3)
@@ -1079,6 +1077,7 @@ func Test_Transaction_Nested_SavePoint_RollbackTo(t *testing.T) {
gtest.C(t, func(t *gtest.T) {
tx, err := db.Begin(ctx)
t.AssertNil(err)
+
// tx save point.
_, err = tx.Model(table).Data(g.Map{
"id": 1,
@@ -1088,6 +1087,7 @@ func Test_Transaction_Nested_SavePoint_RollbackTo(t *testing.T) {
}).Insert()
err = tx.SavePoint("MyPoint")
t.AssertNil(err)
+
_, err = tx.Model(table).Data(g.Map{
"id": 2,
"passport": "user_2",
@@ -1097,6 +1097,7 @@ func Test_Transaction_Nested_SavePoint_RollbackTo(t *testing.T) {
// tx rollback to.
err = tx.RollbackTo("MyPoint")
t.AssertNil(err)
+
// tx commit.
err = tx.Commit()
t.AssertNil(err)
@@ -1104,6 +1105,7 @@ func Test_Transaction_Nested_SavePoint_RollbackTo(t *testing.T) {
// check data.
all, err := db.Model(table).All()
t.AssertNil(err)
+
t.Assert(len(all), 1)
t.Assert(all[0]["id"], 1)
})
@@ -1130,12 +1132,14 @@ func Test_Transaction_Method(t *testing.T) {
"VALUES('t2','25d55ad283aa400af464c76d713c07ad','T2','2021-08-25 21:53:00',2) ",
table))
t.AssertNil(err)
+
return gerror.New("rollback")
})
t.AssertNE(err, nil)
count, err := db.Model(table).Count()
t.AssertNil(err)
+
t.Assert(count, int64(0))
})
}
diff --git a/contrib/drivers/mysql/testdata/date_time_example.sql b/contrib/drivers/mysql/testdata/date_time_example.sql
new file mode 100644
index 000000000..4dc0568a9
--- /dev/null
+++ b/contrib/drivers/mysql/testdata/date_time_example.sql
@@ -0,0 +1,9 @@
+CREATE TABLE `date_time_example` (
+ `id` int unsigned NOT NULL AUTO_INCREMENT,
+ `year` year DEFAULT NULL COMMENT 'year',
+ `date` date DEFAULT NULL COMMENT 'Date',
+ `time` time DEFAULT NULL COMMENT 'time',
+ `datetime` datetime DEFAULT NULL COMMENT 'datetime',
+ `timestamp` timestamp NULL DEFAULT NULL COMMENT 'Timestamp',
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
\ No newline at end of file
diff --git a/contrib/drivers/mysql/testdata/fix_gdb_order_by.sql b/contrib/drivers/mysql/testdata/fix_gdb_order_by.sql
new file mode 100644
index 000000000..2ba712641
--- /dev/null
+++ b/contrib/drivers/mysql/testdata/fix_gdb_order_by.sql
@@ -0,0 +1,9 @@
+CREATE TABLE IF NOT EXISTS `employee`
+(
+ id BIGINT AUTO_INCREMENT PRIMARY KEY,
+ name VARCHAR(255) NOT NULL,
+ age INT NOT NULL
+);
+
+INSERT INTO employee(name, age) VALUES ('John', 30);
+INSERT INTO employee(name, age) VALUES ('Mary', 28);
\ No newline at end of file
diff --git a/contrib/drivers/mysql/testdata/issue3626.sql b/contrib/drivers/mysql/testdata/issue3626.sql
new file mode 100644
index 000000000..e4ee53023
--- /dev/null
+++ b/contrib/drivers/mysql/testdata/issue3626.sql
@@ -0,0 +1,5 @@
+CREATE TABLE `issue3626` (
+ id int(11) NOT NULL,
+ name varchar(45) DEFAULT NULL,
+ PRIMARY KEY (id)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
\ No newline at end of file
diff --git a/contrib/drivers/mysql/testdata/issue3754.sql b/contrib/drivers/mysql/testdata/issue3754.sql
new file mode 100644
index 000000000..e6cdac030
--- /dev/null
+++ b/contrib/drivers/mysql/testdata/issue3754.sql
@@ -0,0 +1,8 @@
+CREATE TABLE `issue3754` (
+ id int(11) NOT NULL,
+ name varchar(45) DEFAULT NULL,
+ create_at datetime(0) DEFAULT NULL,
+ update_at datetime(0) DEFAULT NULL,
+ delete_at datetime(0) DEFAULT NULL,
+ PRIMARY KEY (id)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
\ No newline at end of file
diff --git a/contrib/drivers/mysql/testdata/with_tpl_user.sql b/contrib/drivers/mysql/testdata/with_tpl_user.sql
new file mode 100644
index 000000000..032e9c55d
--- /dev/null
+++ b/contrib/drivers/mysql/testdata/with_tpl_user.sql
@@ -0,0 +1,5 @@
+CREATE TABLE IF NOT EXISTS %s (
+ id int(10) unsigned NOT NULL AUTO_INCREMENT,
+ name varchar(45) NOT NULL,
+ PRIMARY KEY (id)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
\ No newline at end of file
diff --git a/contrib/drivers/mysql/testdata/with_tpl_user_detail.sql b/contrib/drivers/mysql/testdata/with_tpl_user_detail.sql
new file mode 100644
index 000000000..54bbccd09
--- /dev/null
+++ b/contrib/drivers/mysql/testdata/with_tpl_user_detail.sql
@@ -0,0 +1,5 @@
+CREATE TABLE IF NOT EXISTS %s (
+ uid int(10) unsigned NOT NULL AUTO_INCREMENT,
+ address varchar(45) NOT NULL,
+ PRIMARY KEY (uid)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
\ No newline at end of file
diff --git a/contrib/drivers/mysql/testdata/with_tpl_user_scores.sql b/contrib/drivers/mysql/testdata/with_tpl_user_scores.sql
new file mode 100644
index 000000000..d1640ee0a
--- /dev/null
+++ b/contrib/drivers/mysql/testdata/with_tpl_user_scores.sql
@@ -0,0 +1,6 @@
+CREATE TABLE IF NOT EXISTS %s (
+ id int(10) unsigned NOT NULL AUTO_INCREMENT,
+ uid int(10) unsigned NOT NULL,
+ score int(10) unsigned NOT NULL,
+ PRIMARY KEY (id)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
\ No newline at end of file
diff --git a/contrib/drivers/oracle/go.mod b/contrib/drivers/oracle/go.mod
index 2aa5d7007..2a4e319c1 100644
--- a/contrib/drivers/oracle/go.mod
+++ b/contrib/drivers/oracle/go.mod
@@ -1,34 +1,35 @@
module github.com/gogf/gf/contrib/drivers/oracle/v2
-go 1.18
+go 1.20
require (
- github.com/gogf/gf/v2 v2.7.2
+ github.com/gogf/gf/v2 v2.8.1
github.com/sijms/go-ora/v2 v2.7.10
)
require (
- github.com/BurntSushi/toml v1.3.2 // indirect
+ github.com/BurntSushi/toml v1.4.0 // indirect
github.com/clbanning/mxj/v2 v2.7.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
- github.com/fatih/color v1.16.0 // indirect
+ github.com/fatih/color v1.17.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
- github.com/go-logr/logr v1.2.4 // indirect
+ github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
- github.com/gorilla/websocket v1.5.1 // indirect
+ github.com/gorilla/websocket v1.5.3 // indirect
github.com/grokify/html-strip-tags-go v0.1.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
- github.com/rivo/uniseg v0.4.4 // indirect
- go.opentelemetry.io/otel v1.14.0 // indirect
- go.opentelemetry.io/otel/sdk v1.14.0 // indirect
- go.opentelemetry.io/otel/trace v1.14.0 // indirect
- golang.org/x/net v0.24.0 // indirect
- golang.org/x/sys v0.19.0 // indirect
- golang.org/x/text v0.14.0 // indirect
+ github.com/rivo/uniseg v0.4.7 // indirect
+ go.opentelemetry.io/otel v1.24.0 // indirect
+ go.opentelemetry.io/otel/metric v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.24.0 // indirect
+ go.opentelemetry.io/otel/trace v1.24.0 // indirect
+ golang.org/x/net v0.27.0 // indirect
+ golang.org/x/sys v0.22.0 // indirect
+ golang.org/x/text v0.16.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/contrib/drivers/oracle/go.sum b/contrib/drivers/oracle/go.sum
index 62895980d..4a2015402 100644
--- a/contrib/drivers/oracle/go.sum
+++ b/contrib/drivers/oracle/go.sum
@@ -1,22 +1,22 @@
-github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
-github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
+github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
+github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/clbanning/mxj/v2 v2.7.0 h1:WA/La7UGCanFe5NpHF0Q3DNtnCsVoxbPKuyBNHWRyME=
github.com/clbanning/mxj/v2 v2.7.0/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
-github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
-github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
+github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
+github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
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/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
+github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
-github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
-github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
-github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
+github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
+github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
+github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grokify/html-strip-tags-go v0.1.0 h1:03UrQLjAny8xci+R+qjCce/MYnpNXCtgzltlQbOBae4=
github.com/grokify/html-strip-tags-go v0.1.0/go.mod h1:ZdzgfHEzAfz9X6Xe5eBLVblWIxXfYSQ40S/VKrAOGpc=
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
@@ -33,25 +33,27 @@ github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
-github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
-github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
+github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
+github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/sijms/go-ora/v2 v2.7.10 h1:GSLdj0PYYgSndhsnm7b6p32OqgnwnUZSkFb3j+htfhI=
github.com/sijms/go-ora/v2 v2.7.10/go.mod h1:EHxlY6x7y9HAsdfumurRfTd+v8NrEOTR3Xl4FWlH6xk=
-github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
-go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM=
-go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU=
-go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY=
-go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM=
-go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M=
-go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8=
-golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
-golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
+github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
+golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
+golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
-golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
-golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
+golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
+golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
+golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
diff --git a/contrib/drivers/oracle/oracle.go b/contrib/drivers/oracle/oracle.go
index ab079e2d8..ae6a1c5dd 100644
--- a/contrib/drivers/oracle/oracle.go
+++ b/contrib/drivers/oracle/oracle.go
@@ -21,7 +21,8 @@ type Driver struct {
}
const (
- quoteChar = `"`
+ rowNumberAliasForSelect = `ROW_NUMBER__`
+ quoteChar = `"`
)
func init() {
diff --git a/contrib/drivers/oracle/oracle_do_commit.go b/contrib/drivers/oracle/oracle_do_commit.go
new file mode 100644
index 000000000..19fc88f95
--- /dev/null
+++ b/contrib/drivers/oracle/oracle_do_commit.go
@@ -0,0 +1,29 @@
+// Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
+//
+// This Source Code Form is subject to the terms of the MIT License.
+// If a copy of the MIT was not distributed with this file,
+// You can obtain one at https://github.com/gogf/gf.
+
+package oracle
+
+import (
+ "context"
+
+ "github.com/gogf/gf/v2/database/gdb"
+)
+
+// DoCommit commits current sql and arguments to underlying sql driver.
+func (d *Driver) DoCommit(ctx context.Context, in gdb.DoCommitInput) (out gdb.DoCommitOutput, err error) {
+ out, err = d.Core.DoCommit(ctx, in)
+ if err != nil {
+ return
+ }
+ if len(out.Records) > 0 {
+ // remove auto added field.
+ for i, record := range out.Records {
+ delete(record, rowNumberAliasForSelect)
+ out.Records[i] = record
+ }
+ }
+ return
+}
diff --git a/contrib/drivers/oracle/oracle_do_filter.go b/contrib/drivers/oracle/oracle_do_filter.go
index 0d9f8ed49..0f952857c 100644
--- a/contrib/drivers/oracle/oracle_do_filter.go
+++ b/contrib/drivers/oracle/oracle_do_filter.go
@@ -20,9 +20,8 @@ import (
var (
newSqlReplacementTmp = `
SELECT * FROM (
- SELECT GFORM.*, ROWNUM ROWNUM_ FROM (%s %s) GFORM WHERE ROWNUM <= %d
-)
- WHERE ROWNUM_ > %d
+ SELECT GFORM.*, ROWNUM ROW_NUMBER__ FROM (%s %s) GFORM WHERE ROWNUM <= %d
+) WHERE ROW_NUMBER__ > %d
`
)
diff --git a/contrib/drivers/oracle/oracle_order.go b/contrib/drivers/oracle/oracle_order.go
new file mode 100644
index 000000000..60d7157c4
--- /dev/null
+++ b/contrib/drivers/oracle/oracle_order.go
@@ -0,0 +1,12 @@
+// Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
+//
+// This Source Code Form is subject to the terms of the MIT License.
+// If a copy of the MIT was not distributed with this file,
+// You can obtain one at https://github.com/gogf/gf.
+
+package oracle
+
+// OrderRandomFunction returns the SQL function for random ordering.
+func (d *Driver) OrderRandomFunction() string {
+ return "DBMS_RANDOM.VALUE()"
+}
diff --git a/contrib/drivers/oracle/oracle_z_unit_model_test.go b/contrib/drivers/oracle/oracle_z_unit_model_test.go
index 3763564c8..b9ecb5b4c 100644
--- a/contrib/drivers/oracle/oracle_z_unit_model_test.go
+++ b/contrib/drivers/oracle/oracle_z_unit_model_test.go
@@ -460,6 +460,19 @@ func Test_Model_Count(t *testing.T) {
}
+func Test_Model_Exist(t *testing.T) {
+ table := createInitTable()
+ defer dropTable(table)
+ gtest.C(t, func(t *gtest.T) {
+ exist, err := db.Model(table).Exist()
+ t.AssertNil(err)
+ t.Assert(exist, TableSize > 0)
+ exist, err = db.Model(table).Where("id", -1).Exist()
+ t.AssertNil(err)
+ t.Assert(exist, false)
+ })
+}
+
func Test_Model_Select(t *testing.T) {
table := createInitTable()
defer dropTable(table)
@@ -1177,6 +1190,17 @@ func Test_Model_Replace(t *testing.T) {
})
}
+func Test_OrderRandom(t *testing.T) {
+ table := createInitTable()
+ defer dropTable(table)
+
+ gtest.C(t, func(t *gtest.T) {
+ result, err := db.Model(table).OrderRandom().All()
+ t.AssertNil(err)
+ t.Assert(len(result), TableSize)
+ })
+}
+
/* not support the "AS"
func Test_Model_Raw(t *testing.T) {
table := createInitTable()
diff --git a/contrib/drivers/pgsql/go.mod b/contrib/drivers/pgsql/go.mod
index 96315fa14..74d72cb9b 100644
--- a/contrib/drivers/pgsql/go.mod
+++ b/contrib/drivers/pgsql/go.mod
@@ -1,34 +1,35 @@
module github.com/gogf/gf/contrib/drivers/pgsql/v2
-go 1.18
+go 1.20
require (
- github.com/gogf/gf/v2 v2.7.2
+ github.com/gogf/gf/v2 v2.8.1
github.com/lib/pq v1.10.9
)
require (
- github.com/BurntSushi/toml v1.3.2 // indirect
+ github.com/BurntSushi/toml v1.4.0 // indirect
github.com/clbanning/mxj/v2 v2.7.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
- github.com/fatih/color v1.16.0 // indirect
+ github.com/fatih/color v1.17.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
- github.com/go-logr/logr v1.2.4 // indirect
+ github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
- github.com/gorilla/websocket v1.5.1 // indirect
+ github.com/gorilla/websocket v1.5.3 // indirect
github.com/grokify/html-strip-tags-go v0.1.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
- github.com/rivo/uniseg v0.4.4 // indirect
- go.opentelemetry.io/otel v1.14.0 // indirect
- go.opentelemetry.io/otel/sdk v1.14.0 // indirect
- go.opentelemetry.io/otel/trace v1.14.0 // indirect
- golang.org/x/net v0.24.0 // indirect
- golang.org/x/sys v0.19.0 // indirect
- golang.org/x/text v0.14.0 // indirect
+ github.com/rivo/uniseg v0.4.7 // indirect
+ go.opentelemetry.io/otel v1.24.0 // indirect
+ go.opentelemetry.io/otel/metric v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.24.0 // indirect
+ go.opentelemetry.io/otel/trace v1.24.0 // indirect
+ golang.org/x/net v0.27.0 // indirect
+ golang.org/x/sys v0.22.0 // indirect
+ golang.org/x/text v0.16.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/contrib/drivers/pgsql/go.sum b/contrib/drivers/pgsql/go.sum
index a4e6f627d..577f08841 100644
--- a/contrib/drivers/pgsql/go.sum
+++ b/contrib/drivers/pgsql/go.sum
@@ -1,22 +1,22 @@
-github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
-github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
+github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
+github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/clbanning/mxj/v2 v2.7.0 h1:WA/La7UGCanFe5NpHF0Q3DNtnCsVoxbPKuyBNHWRyME=
github.com/clbanning/mxj/v2 v2.7.0/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
-github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
-github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
+github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
+github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
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/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
+github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
-github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
-github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
-github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
+github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
+github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
+github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grokify/html-strip-tags-go v0.1.0 h1:03UrQLjAny8xci+R+qjCce/MYnpNXCtgzltlQbOBae4=
github.com/grokify/html-strip-tags-go v0.1.0/go.mod h1:ZdzgfHEzAfz9X6Xe5eBLVblWIxXfYSQ40S/VKrAOGpc=
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
@@ -35,23 +35,25 @@ github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
-github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
-github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
-github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
-go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM=
-go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU=
-go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY=
-go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM=
-go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M=
-go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8=
-golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
-golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
+github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
+github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
+github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
+golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
+golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
-golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
-golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
+golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
+golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
+golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
diff --git a/contrib/drivers/pgsql/pgsql_convert.go b/contrib/drivers/pgsql/pgsql_convert.go
index dc71a8cc4..71657669b 100644
--- a/contrib/drivers/pgsql/pgsql_convert.go
+++ b/contrib/drivers/pgsql/pgsql_convert.go
@@ -12,6 +12,7 @@ import (
"strings"
"github.com/gogf/gf/v2/database/gdb"
+ "github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/text/gregex"
"github.com/gogf/gf/v2/text/gstr"
"github.com/gogf/gf/v2/util/gconv"
@@ -19,17 +20,22 @@ import (
// ConvertValueForField converts value to database acceptable value.
func (d *Driver) ConvertValueForField(ctx context.Context, fieldType string, fieldValue interface{}) (interface{}, error) {
- var (
- fieldValueKind = reflect.TypeOf(fieldValue).Kind()
- )
+ if g.IsNil(fieldValue) {
+ return d.Core.ConvertValueForField(ctx, fieldType, fieldValue)
+ }
+
+ var fieldValueKind = reflect.TypeOf(fieldValue).Kind()
if fieldValueKind == reflect.Slice {
- fieldValue = gstr.ReplaceByMap(gconv.String(fieldValue),
- map[string]string{
- "[": "{",
- "]": "}",
- },
- )
+ // For pgsql, json or jsonb require '[]'
+ if !gstr.Contains(fieldType, "json") {
+ fieldValue = gstr.ReplaceByMap(gconv.String(fieldValue),
+ map[string]string{
+ "[": "{",
+ "]": "}",
+ },
+ )
+ }
}
return d.Core.ConvertValueForField(ctx, fieldType, fieldValue)
}
diff --git a/contrib/drivers/pgsql/pgsql_do_filter.go b/contrib/drivers/pgsql/pgsql_do_filter.go
index fa0b1c4a5..a595d908a 100644
--- a/contrib/drivers/pgsql/pgsql_do_filter.go
+++ b/contrib/drivers/pgsql/pgsql_do_filter.go
@@ -9,9 +9,9 @@ package pgsql
import (
"context"
"fmt"
-
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/text/gregex"
+ "github.com/gogf/gf/v2/text/gstr"
)
// DoFilter deals with the sql string before commits it to underlying sql driver.
@@ -31,9 +31,13 @@ func (d *Driver) DoFilter(
// Refer:
// https://github.com/gogf/gf/issues/1537
// https://www.postgresql.org/docs/12/functions-json.html
- newSql, err = gregex.ReplaceStringFuncMatch(`(::jsonb([^\w\d]*)\$\d)`, newSql, func(match []string) string {
- return fmt.Sprintf(`::jsonb%s?`, match[2])
- })
+ newSql, err = gregex.ReplaceStringFuncMatch(
+ `(::jsonb([^\w\d]*)\$\d)`,
+ newSql,
+ func(match []string) string {
+ return fmt.Sprintf(`::jsonb%s?`, match[2])
+ },
+ )
if err != nil {
return "", nil, err
}
@@ -41,6 +45,13 @@ func (d *Driver) DoFilter(
if err != nil {
return "", nil, err
}
+
+ // Add support for pgsql INSERT OR IGNORE.
+ if gstr.HasPrefix(newSql, gdb.InsertOperationIgnore) {
+ newSql = "INSERT" + newSql[len(gdb.InsertOperationIgnore):] + " ON CONFLICT DO NOTHING"
+ }
+
newArgs = args
+
return d.Core.DoFilter(ctx, link, newSql, newArgs)
}
diff --git a/contrib/drivers/pgsql/pgsql_do_insert.go b/contrib/drivers/pgsql/pgsql_do_insert.go
index 0e0ac31de..15a102cdc 100644
--- a/contrib/drivers/pgsql/pgsql_do_insert.go
+++ b/contrib/drivers/pgsql/pgsql_do_insert.go
@@ -9,7 +9,6 @@ package pgsql
import (
"context"
"database/sql"
-
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/errors/gcode"
"github.com/gogf/gf/v2/errors/gerror"
@@ -24,12 +23,6 @@ func (d *Driver) DoInsert(ctx context.Context, link gdb.Link, table string, list
`Replace operation is not supported by pgsql driver`,
)
- case gdb.InsertOptionIgnore:
- return nil, gerror.NewCode(
- gcode.CodeNotSupported,
- `Insert ignore operation is not supported by pgsql driver`,
- )
-
case gdb.InsertOptionDefault:
tableFields, err := d.GetCore().GetDB().TableFields(ctx, table)
if err == nil {
diff --git a/contrib/drivers/pgsql/pgsql_open.go b/contrib/drivers/pgsql/pgsql_open.go
index 7bbd98462..21d3dce13 100644
--- a/contrib/drivers/pgsql/pgsql_open.go
+++ b/contrib/drivers/pgsql/pgsql_open.go
@@ -34,16 +34,12 @@ func (d *Driver) Open(config *gdb.ConfigNode) (db *sql.DB, err error) {
source, _ = gregex.ReplaceString(`dbname=([\w\.\-]+)+`, "dbname="+config.Name, source)
}
} else {
+ source = fmt.Sprintf(
+ "user=%s password='%s' host=%s port=%s sslmode=disable",
+ config.User, config.Pass, config.Host, config.Port)
+
if config.Name != "" {
- source = fmt.Sprintf(
- "user=%s password=%s host=%s port=%s dbname=%s sslmode=disable",
- config.User, config.Pass, config.Host, config.Port, config.Name,
- )
- } else {
- source = fmt.Sprintf(
- "user=%s password=%s host=%s port=%s sslmode=disable",
- config.User, config.Pass, config.Host, config.Port,
- )
+ source = fmt.Sprintf("%s dbname=%s", source, config.Name)
}
if config.Namespace != "" {
diff --git a/contrib/drivers/pgsql/pgsql_order.go b/contrib/drivers/pgsql/pgsql_order.go
new file mode 100644
index 000000000..6fedce1eb
--- /dev/null
+++ b/contrib/drivers/pgsql/pgsql_order.go
@@ -0,0 +1,12 @@
+// Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
+//
+// This Source Code Form is subject to the terms of the MIT License.
+// If a copy of the MIT was not distributed with this file,
+// You can obtain one at https://github.com/gogf/gf.
+
+package pgsql
+
+// OrderRandomFunction returns the SQL function for random ordering.
+func (d *Driver) OrderRandomFunction() string {
+ return "RANDOM()"
+}
diff --git a/contrib/drivers/pgsql/pgsql_z_unit_db_test.go b/contrib/drivers/pgsql/pgsql_z_unit_db_test.go
index 9cadd86d1..fabccc45f 100644
--- a/contrib/drivers/pgsql/pgsql_z_unit_db_test.go
+++ b/contrib/drivers/pgsql/pgsql_z_unit_db_test.go
@@ -383,3 +383,115 @@ int_col INT);`
})
}
+
+func Test_DB_InsertIgnore(t *testing.T) {
+ table := createTable()
+ defer dropTable(table)
+
+ // Insert test record
+ gtest.C(t, func(t *gtest.T) {
+ _, err := db.Insert(ctx, table, g.Map{
+ "id": 1,
+ "passport": "t1",
+ "password": "25d55ad283aa400af464c76d713c07ad",
+ "nickname": "T1",
+ "create_time": gtime.Now().String(),
+ })
+ t.AssertNil(err)
+
+ answer, err := db.GetAll(ctx, fmt.Sprintf("SELECT * FROM %s WHERE id=?", table), 1)
+ t.AssertNil(err)
+ t.Assert(len(answer), 1)
+ t.Assert(answer[0]["passport"], "t1")
+ t.Assert(answer[0]["password"], "25d55ad283aa400af464c76d713c07ad")
+ t.Assert(answer[0]["nickname"], "T1")
+
+ // Ignore Duplicate record
+ result, err := db.InsertIgnore(ctx, table, g.Map{
+ "id": 1,
+ "passport": "t1_duplicate",
+ "password": "duplicate_password",
+ "nickname": "Duplicate",
+ "create_time": gtime.Now().String(),
+ })
+ t.AssertNil(err)
+
+ n, _ := result.RowsAffected()
+ t.Assert(n, 0)
+
+ answer, err = db.GetAll(ctx, fmt.Sprintf("SELECT * FROM %s WHERE id=?", table), 1)
+ t.AssertNil(err)
+ t.Assert(len(answer), 1)
+ t.Assert(answer[0]["passport"], "t1")
+ t.Assert(answer[0]["password"], "25d55ad283aa400af464c76d713c07ad")
+ t.Assert(answer[0]["nickname"], "T1")
+
+ // Insert Correct Record
+ result, err = db.Insert(ctx, table, g.Map{
+ "id": 2,
+ "passport": "t2",
+ "password": "25d55ad283aa400af464c76d713c07ad",
+ "nickname": "name_2",
+ "create_time": gtime.Now().String(),
+ })
+ t.AssertNil(err)
+ n, _ = result.RowsAffected()
+ t.Assert(n, 1)
+
+ answer, err = db.GetAll(ctx, fmt.Sprintf("SELECT * FROM %s WHERE id=?", table), 2)
+ t.AssertNil(err)
+ t.Assert(len(answer), 1)
+ t.Assert(answer[0]["passport"], "t2")
+ t.Assert(answer[0]["password"], "25d55ad283aa400af464c76d713c07ad")
+ t.Assert(answer[0]["nickname"], "name_2")
+
+ // Insert Multiple Records Using g.Map Array
+ data := g.List{
+ {
+ "id": 3,
+ "passport": "t3",
+ "password": "25d55ad283aa400af464c76d713c07ad",
+ "nickname": "name_3",
+ "create_time": gtime.Now().String(),
+ },
+ {
+ "id": 4,
+ "passport": "t4",
+ "password": "25d55ad283aa400af464c76d713c07ad",
+ "nickname": "name_4",
+ "create_time": gtime.Now().String(),
+ },
+ {
+ "id": 1,
+ "passport": "t1_conflict",
+ "password": "conflict_password",
+ "nickname": "conflict_name",
+ "create_time": gtime.Now().String(),
+ },
+ {
+ "id": 2,
+ "passport": "t2_conflict",
+ "password": "conflict_password",
+ "nickname": "conflict_name",
+ "create_time": gtime.Now().String(),
+ },
+ }
+
+ // Insert Multiple Records with Ignore
+ result, err = db.InsertIgnore(ctx, table, data)
+ t.AssertNil(err)
+
+ n, _ = result.RowsAffected()
+ t.Assert(n, 2)
+
+ answer, err = db.GetAll(ctx, fmt.Sprintf("SELECT * FROM %s", table))
+ t.AssertNil(err)
+ t.Assert(len(answer), 4)
+ // Should have four records in total (ID 1, 2, 3, 4)
+
+ t.Assert(answer[0]["passport"], "t1")
+ t.Assert(answer[1]["passport"], "t2")
+ t.Assert(answer[2]["passport"], "t3")
+ t.Assert(answer[3]["passport"], "t4")
+ })
+}
diff --git a/contrib/drivers/pgsql/pgsql_z_unit_issue_test.go b/contrib/drivers/pgsql/pgsql_z_unit_issue_test.go
index 492826c21..b329cdfdf 100644
--- a/contrib/drivers/pgsql/pgsql_z_unit_issue_test.go
+++ b/contrib/drivers/pgsql/pgsql_z_unit_issue_test.go
@@ -103,3 +103,72 @@ func Test_Issue3632(t *testing.T) {
t.AssertNil(err)
})
}
+
+// https://github.com/gogf/gf/issues/3671
+func Test_Issue3671(t *testing.T) {
+ type SubMember struct {
+ Seven string
+ Eight int64
+ }
+ type Member struct {
+ One []int64 `json:"one" orm:"one"`
+ Two [][]string `json:"two" orm:"two"`
+ Three []string `json:"three" orm:"three"`
+ Four []int64 `json:"four" orm:"four"`
+ Five []SubMember `json:"five" orm:"five"`
+ }
+ var (
+ sqlText = gtest.DataContent("issues", "issue3671.sql")
+ table = fmt.Sprintf(`%s_%d`, TablePrefix+"issue3632", gtime.TimestampNano())
+ )
+ if _, err := db.Exec(ctx, fmt.Sprintf(sqlText, table)); err != nil {
+ gtest.Fatal(err)
+ }
+ defer dropTable(table)
+
+ gtest.C(t, func(t *gtest.T) {
+ var (
+ dao = db.Model(table)
+ member = Member{
+ One: []int64{1, 2, 3},
+ Two: [][]string{{"a", "b"}, {"c", "d"}},
+ Three: []string{"x", "y", "z"},
+ Four: []int64{1, 2, 3},
+ Five: []SubMember{{Seven: "1", Eight: 2}, {Seven: "3", Eight: 4}},
+ }
+ )
+
+ _, err := dao.Ctx(ctx).Data(&member).Insert()
+ t.AssertNil(err)
+ })
+}
+
+// https://github.com/gogf/gf/issues/3668
+func Test_Issue3668(t *testing.T) {
+ type Issue3668 struct {
+ Text interface{}
+ Number interface{}
+ }
+ var (
+ sqlText = gtest.DataContent("issues", "issue3668.sql")
+ table = fmt.Sprintf(`%s_%d`, TablePrefix+"issue3668", gtime.TimestampNano())
+ )
+ if _, err := db.Exec(ctx, fmt.Sprintf(sqlText, table)); err != nil {
+ gtest.Fatal(err)
+ }
+ defer dropTable(table)
+
+ gtest.C(t, func(t *gtest.T) {
+ var (
+ dao = db.Model(table)
+ data = Issue3668{
+ Text: "我们都是自然的婴儿,卧在宇宙的摇篮里",
+ Number: nil,
+ }
+ )
+ _, err := dao.Ctx(ctx).
+ Data(data).
+ Insert()
+ t.AssertNil(err)
+ })
+}
diff --git a/contrib/drivers/pgsql/pgsql_z_unit_model_test.go b/contrib/drivers/pgsql/pgsql_z_unit_model_test.go
index 781438b76..634de6dc8 100644
--- a/contrib/drivers/pgsql/pgsql_z_unit_model_test.go
+++ b/contrib/drivers/pgsql/pgsql_z_unit_model_test.go
@@ -226,6 +226,19 @@ func Test_Model_Count(t *testing.T) {
})
}
+func Test_Model_Exist(t *testing.T) {
+ table := createInitTable()
+ defer dropTable(table)
+ gtest.C(t, func(t *gtest.T) {
+ exist, err := db.Model(table).Exist()
+ t.AssertNil(err)
+ t.Assert(exist, TableSize > 0)
+ exist, err = db.Model(table).Where("id", -1).Exist()
+ t.AssertNil(err)
+ t.Assert(exist, false)
+ })
+}
+
func Test_Model_Where(t *testing.T) {
table := createInitTable()
defer dropTable(table)
@@ -587,3 +600,14 @@ func Test_Model_OnDuplicateEx(t *testing.T) {
t.Assert(one["nickname"], "name_1")
})
}
+
+func Test_OrderRandom(t *testing.T) {
+ table := createInitTable()
+ defer dropTable(table)
+
+ gtest.C(t, func(t *gtest.T) {
+ result, err := db.Model(table).OrderRandom().All()
+ t.AssertNil(err)
+ t.Assert(len(result), TableSize)
+ })
+}
diff --git a/contrib/drivers/pgsql/testdata/issues/issue3668.sql b/contrib/drivers/pgsql/testdata/issues/issue3668.sql
new file mode 100644
index 000000000..968231ab6
--- /dev/null
+++ b/contrib/drivers/pgsql/testdata/issues/issue3668.sql
@@ -0,0 +1,4 @@
+CREATE TABLE "public"."%s" (
+ "text" varchar(255) COLLATE "pg_catalog"."default",
+ "number" int4
+);
diff --git a/contrib/drivers/pgsql/testdata/issues/issue3671.sql b/contrib/drivers/pgsql/testdata/issues/issue3671.sql
new file mode 100644
index 000000000..57d78d70c
--- /dev/null
+++ b/contrib/drivers/pgsql/testdata/issues/issue3671.sql
@@ -0,0 +1,8 @@
+CREATE TABLE "public"."%s"
+(
+ "one" int8[] NOT NULL,
+ "two" text[][] NOT NULL,
+ "three" jsonb,
+ "four" json,
+ "five" jsonb
+);
diff --git a/contrib/drivers/sqlite/go.mod b/contrib/drivers/sqlite/go.mod
index 45ec898ac..48b040e0f 100644
--- a/contrib/drivers/sqlite/go.mod
+++ b/contrib/drivers/sqlite/go.mod
@@ -1,23 +1,23 @@
module github.com/gogf/gf/contrib/drivers/sqlite/v2
-go 1.18
+go 1.20
require (
github.com/glebarez/go-sqlite v1.21.2
- github.com/gogf/gf/v2 v2.7.2
+ github.com/gogf/gf/v2 v2.8.1
)
require (
- github.com/BurntSushi/toml v1.3.2 // indirect
+ github.com/BurntSushi/toml v1.4.0 // indirect
github.com/clbanning/mxj/v2 v2.7.0 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
- github.com/fatih/color v1.16.0 // indirect
+ github.com/fatih/color v1.17.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
- github.com/go-logr/logr v1.2.4 // indirect
+ github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/google/uuid v1.3.0 // indirect
- github.com/gorilla/websocket v1.5.1 // indirect
+ github.com/gorilla/websocket v1.5.3 // indirect
github.com/grokify/html-strip-tags-go v0.1.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
@@ -25,13 +25,14 @@ require (
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
- github.com/rivo/uniseg v0.4.4 // indirect
- go.opentelemetry.io/otel v1.14.0 // indirect
- go.opentelemetry.io/otel/sdk v1.14.0 // indirect
- go.opentelemetry.io/otel/trace v1.14.0 // indirect
- golang.org/x/net v0.24.0 // indirect
- golang.org/x/sys v0.19.0 // indirect
- golang.org/x/text v0.14.0 // indirect
+ github.com/rivo/uniseg v0.4.7 // indirect
+ go.opentelemetry.io/otel v1.24.0 // indirect
+ go.opentelemetry.io/otel/metric v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.24.0 // indirect
+ go.opentelemetry.io/otel/trace v1.24.0 // indirect
+ golang.org/x/net v0.27.0 // indirect
+ golang.org/x/sys v0.22.0 // indirect
+ golang.org/x/text v0.16.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
modernc.org/libc v1.22.5 // indirect
modernc.org/mathutil v1.5.0 // indirect
diff --git a/contrib/drivers/sqlite/go.sum b/contrib/drivers/sqlite/go.sum
index 33d70c163..8707f88d5 100644
--- a/contrib/drivers/sqlite/go.sum
+++ b/contrib/drivers/sqlite/go.sum
@@ -1,5 +1,5 @@
-github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
-github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
+github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
+github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/clbanning/mxj/v2 v2.7.0 h1:WA/La7UGCanFe5NpHF0Q3DNtnCsVoxbPKuyBNHWRyME=
github.com/clbanning/mxj/v2 v2.7.0/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
@@ -7,23 +7,23 @@ github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkp
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
-github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
-github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
+github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
+github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/glebarez/go-sqlite v1.21.2 h1:3a6LFC4sKahUunAmynQKLZceZCOzUthkRkEAl9gAXWo=
github.com/glebarez/go-sqlite v1.21.2/go.mod h1:sfxdZyhQjTM2Wry3gVYWaW072Ri1WMdWJi0k6+3382k=
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/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
+github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
-github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
+github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 h1:Xim43kblpZXfIBQsbuBVKCudVG457BR2GZFIz3uw3hQ=
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
-github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
-github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
+github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
+github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grokify/html-strip-tags-go v0.1.0 h1:03UrQLjAny8xci+R+qjCce/MYnpNXCtgzltlQbOBae4=
github.com/grokify/html-strip-tags-go v0.1.0/go.mod h1:ZdzgfHEzAfz9X6Xe5eBLVblWIxXfYSQ40S/VKrAOGpc=
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
@@ -43,23 +43,25 @@ github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qq
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/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
-github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
-github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
-github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
-go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM=
-go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU=
-go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY=
-go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM=
-go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M=
-go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8=
-golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
-golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
+github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
+github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
+github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
+golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
+golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
-golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
-golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
+golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
+golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
+golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
diff --git a/contrib/drivers/sqlite/sqlite_do_filter.go b/contrib/drivers/sqlite/sqlite_do_filter.go
index fa6057674..3547b800e 100644
--- a/contrib/drivers/sqlite/sqlite_do_filter.go
+++ b/contrib/drivers/sqlite/sqlite_do_filter.go
@@ -14,7 +14,9 @@ import (
)
// DoFilter deals with the sql string before commits it to underlying sql driver.
-func (d *Driver) DoFilter(ctx context.Context, link gdb.Link, sql string, args []interface{}) (newSql string, newArgs []interface{}, err error) {
+func (d *Driver) DoFilter(
+ ctx context.Context, link gdb.Link, sql string, args []interface{},
+) (newSql string, newArgs []interface{}, err error) {
// Special insert/ignore operation for sqlite.
switch {
case gstr.HasPrefix(sql, gdb.InsertOperationIgnore):
diff --git a/contrib/drivers/sqlite/sqlite_order.go b/contrib/drivers/sqlite/sqlite_order.go
new file mode 100644
index 000000000..075e67ef9
--- /dev/null
+++ b/contrib/drivers/sqlite/sqlite_order.go
@@ -0,0 +1,12 @@
+// Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
+//
+// This Source Code Form is subject to the terms of the MIT License.
+// If a copy of the MIT was not distributed with this file,
+// You can obtain one at https://github.com/gogf/gf.
+
+package sqlite
+
+// OrderRandomFunction returns the SQL function for random ordering.
+func (d *Driver) OrderRandomFunction() string {
+ return "RANDOM()"
+}
diff --git a/contrib/drivers/sqlite/sqlite_z_unit_core_test.go b/contrib/drivers/sqlite/sqlite_z_unit_core_test.go
index 95c5cd68d..1c151472f 100644
--- a/contrib/drivers/sqlite/sqlite_z_unit_core_test.go
+++ b/contrib/drivers/sqlite/sqlite_z_unit_core_test.go
@@ -831,7 +831,7 @@ func Test_DB_ToJson(t *testing.T) {
}
// ToJson
- resultJson, err := gjson.LoadContent(result.Json())
+ resultJson, err := gjson.LoadContent([]byte(result.Json()))
if err != nil {
gtest.Fatal(err)
}
diff --git a/contrib/drivers/sqlite/sqlite_z_unit_init_test.go b/contrib/drivers/sqlite/sqlite_z_unit_init_test.go
index 6d82d9412..5a9aa66ed 100644
--- a/contrib/drivers/sqlite/sqlite_z_unit_init_test.go
+++ b/contrib/drivers/sqlite/sqlite_z_unit_init_test.go
@@ -111,13 +111,9 @@ func createTableWithDb(db gdb.DB, table ...string) (name string) {
if _, err := db.Exec(ctx, fmt.Sprintf(`
CREATE TABLE %s (
- id INTEGER PRIMARY KEY AUTOINCREMENT
- UNIQUE
- NOT NULL,
- passport VARCHAR(45) NOT NULL
- DEFAULT passport,
- password VARCHAR(128) NOT NULL
- DEFAULT password,
+ id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE NOT NULL,
+ passport VARCHAR(45) NOT NULL DEFAULT passport,
+ password VARCHAR(128) NOT NULL DEFAULT password,
nickname VARCHAR(45),
create_time DATETIME
);
@@ -125,7 +121,6 @@ func createTableWithDb(db gdb.DB, table ...string) (name string) {
)); err != nil {
gtest.Fatal(err)
}
-
return
}
diff --git a/contrib/drivers/sqlite/sqlite_z_unit_model_test.go b/contrib/drivers/sqlite/sqlite_z_unit_model_test.go
index 7734bb5b7..19e97bfa5 100644
--- a/contrib/drivers/sqlite/sqlite_z_unit_model_test.go
+++ b/contrib/drivers/sqlite/sqlite_z_unit_model_test.go
@@ -650,6 +650,7 @@ func Test_Model_AllAndCount(t *testing.T) {
t.Assert(len(result), TableSize)
t.Assert(count, TableSize)
})
+
// AllAndCount with no data
gtest.C(t, func(t *gtest.T) {
result, count, err := db.Model(table).Where("id<0").AllAndCount(false)
@@ -864,6 +865,19 @@ func Test_Model_Count(t *testing.T) {
})
}
+func Test_Model_Exist(t *testing.T) {
+ table := createInitTable()
+ defer dropTable(table)
+ gtest.C(t, func(t *gtest.T) {
+ exist, err := db.Model(table).Exist()
+ t.AssertNil(err)
+ t.Assert(exist, TableSize > 0)
+ exist, err = db.Model(table).Where("id", -1).Exist()
+ t.AssertNil(err)
+ t.Assert(exist, false)
+ })
+}
+
func Test_Model_Select(t *testing.T) {
table := createInitTable()
defer dropTable(table)
@@ -1417,7 +1431,7 @@ func Test_Model_OrderBy(t *testing.T) {
})
gtest.C(t, func(t *gtest.T) {
- result, err := db.Model(table).Order("NULL").All()
+ result, err := db.Model(table).Order(gdb.Raw("NULL")).All()
t.AssertNil(err)
t.Assert(len(result), TableSize)
t.Assert(result[0]["nickname"].String(), "name_1")
@@ -4299,3 +4313,14 @@ func TestResult_Structs1(t *testing.T) {
t.Assert(array[1].Name, "smith")
})
}
+
+func Test_OrderRandom(t *testing.T) {
+ table := createInitTable()
+ defer dropTable(table)
+
+ gtest.C(t, func(t *gtest.T) {
+ result, err := db.Model(table).OrderRandom().All()
+ t.AssertNil(err)
+ t.Assert(len(result), TableSize)
+ })
+}
diff --git a/contrib/drivers/sqlitecgo/go.mod b/contrib/drivers/sqlitecgo/go.mod
index ad3de69f5..1435ed4ff 100644
--- a/contrib/drivers/sqlitecgo/go.mod
+++ b/contrib/drivers/sqlitecgo/go.mod
@@ -1,34 +1,35 @@
module github.com/gogf/gf/contrib/drivers/sqlitecgo/v2
-go 1.18
+go 1.20
require (
- github.com/gogf/gf/v2 v2.7.2
+ github.com/gogf/gf/v2 v2.8.1
github.com/mattn/go-sqlite3 v1.14.17
)
require (
- github.com/BurntSushi/toml v1.3.2 // indirect
+ github.com/BurntSushi/toml v1.4.0 // indirect
github.com/clbanning/mxj/v2 v2.7.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
- github.com/fatih/color v1.16.0 // indirect
+ github.com/fatih/color v1.17.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
- github.com/go-logr/logr v1.2.4 // indirect
+ github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
- github.com/gorilla/websocket v1.5.1 // indirect
+ github.com/gorilla/websocket v1.5.3 // indirect
github.com/grokify/html-strip-tags-go v0.1.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
- github.com/rivo/uniseg v0.4.4 // indirect
- go.opentelemetry.io/otel v1.14.0 // indirect
- go.opentelemetry.io/otel/sdk v1.14.0 // indirect
- go.opentelemetry.io/otel/trace v1.14.0 // indirect
- golang.org/x/net v0.24.0 // indirect
- golang.org/x/sys v0.19.0 // indirect
- golang.org/x/text v0.14.0 // indirect
+ github.com/rivo/uniseg v0.4.7 // indirect
+ go.opentelemetry.io/otel v1.24.0 // indirect
+ go.opentelemetry.io/otel/metric v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.24.0 // indirect
+ go.opentelemetry.io/otel/trace v1.24.0 // indirect
+ golang.org/x/net v0.27.0 // indirect
+ golang.org/x/sys v0.22.0 // indirect
+ golang.org/x/text v0.16.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/contrib/drivers/sqlitecgo/go.sum b/contrib/drivers/sqlitecgo/go.sum
index b786b4bbd..8217c5949 100644
--- a/contrib/drivers/sqlitecgo/go.sum
+++ b/contrib/drivers/sqlitecgo/go.sum
@@ -1,22 +1,22 @@
-github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
-github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
+github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
+github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/clbanning/mxj/v2 v2.7.0 h1:WA/La7UGCanFe5NpHF0Q3DNtnCsVoxbPKuyBNHWRyME=
github.com/clbanning/mxj/v2 v2.7.0/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
-github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
-github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
+github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
+github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
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/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
+github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
-github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
-github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
-github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
+github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
+github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
+github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grokify/html-strip-tags-go v0.1.0 h1:03UrQLjAny8xci+R+qjCce/MYnpNXCtgzltlQbOBae4=
github.com/grokify/html-strip-tags-go v0.1.0/go.mod h1:ZdzgfHEzAfz9X6Xe5eBLVblWIxXfYSQ40S/VKrAOGpc=
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
@@ -35,23 +35,25 @@ github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
-github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
-github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
-github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
-go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM=
-go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU=
-go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY=
-go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM=
-go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M=
-go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8=
-golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
-golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
+github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
+github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
+github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
+golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
+golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
-golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
-golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
+golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
+golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
+golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
diff --git a/contrib/drivers/sqlitecgo/sqlitecgo_do_filter.go b/contrib/drivers/sqlitecgo/sqlitecgo_do_filter.go
index f53e4eadf..6c578225e 100644
--- a/contrib/drivers/sqlitecgo/sqlitecgo_do_filter.go
+++ b/contrib/drivers/sqlitecgo/sqlitecgo_do_filter.go
@@ -16,7 +16,9 @@ import (
)
// DoFilter deals with the sql string before commits it to underlying sql driver.
-func (d *Driver) DoFilter(ctx context.Context, link gdb.Link, sql string, args []interface{}) (newSql string, newArgs []interface{}, err error) {
+func (d *Driver) DoFilter(
+ ctx context.Context, link gdb.Link, sql string, args []interface{},
+) (newSql string, newArgs []interface{}, err error) {
// Special insert/ignore operation for sqlite.
switch {
case gstr.HasPrefix(sql, gdb.InsertOperationIgnore):
diff --git a/contrib/drivers/sqlitecgo/sqlitecgo_z_unit_core_test.go b/contrib/drivers/sqlitecgo/sqlitecgo_z_unit_core_test.go
index fee914add..fa2fe2c71 100644
--- a/contrib/drivers/sqlitecgo/sqlitecgo_z_unit_core_test.go
+++ b/contrib/drivers/sqlitecgo/sqlitecgo_z_unit_core_test.go
@@ -831,7 +831,7 @@ func Test_DB_ToJson(t *testing.T) {
}
// ToJson
- resultJson, err := gjson.LoadContent(result.Json())
+ resultJson, err := gjson.LoadContent([]byte(result.Json()))
if err != nil {
gtest.Fatal(err)
}
diff --git a/contrib/drivers/sqlitecgo/sqlitecgo_z_unit_model_test.go b/contrib/drivers/sqlitecgo/sqlitecgo_z_unit_model_test.go
index 05e146d76..613ef9c64 100644
--- a/contrib/drivers/sqlitecgo/sqlitecgo_z_unit_model_test.go
+++ b/contrib/drivers/sqlitecgo/sqlitecgo_z_unit_model_test.go
@@ -824,6 +824,19 @@ func Test_Model_Count(t *testing.T) {
})
}
+func Test_Model_Exist(t *testing.T) {
+ table := createInitTable()
+ defer dropTable(table)
+ gtest.C(t, func(t *gtest.T) {
+ exist, err := db.Model(table).Exist()
+ t.AssertNil(err)
+ t.Assert(exist, TableSize > 0)
+ exist, err = db.Model(table).Where("id", -1).Exist()
+ t.AssertNil(err)
+ t.Assert(exist, false)
+ })
+}
+
func Test_Model_Select(t *testing.T) {
table := createInitTable()
defer dropTable(table)
@@ -1377,7 +1390,7 @@ func Test_Model_OrderBy(t *testing.T) {
})
gtest.C(t, func(t *gtest.T) {
- result, err := db.Model(table).Order("NULL").All()
+ result, err := db.Model(table).Order(gdb.Raw("NULL")).All()
t.AssertNil(err)
t.Assert(len(result), TableSize)
t.Assert(result[0]["nickname"].String(), "name_1")
diff --git a/contrib/metric/otelmetric/go.mod b/contrib/metric/otelmetric/go.mod
index 48036c369..f12c66382 100644
--- a/contrib/metric/otelmetric/go.mod
+++ b/contrib/metric/otelmetric/go.mod
@@ -1,15 +1,15 @@
module github.com/gogf/gf/contrib/metric/otelmetric/v2
-go 1.21
+go 1.22
require (
github.com/gogf/gf/v2 v2.7.2
github.com/prometheus/client_golang v1.19.1
go.opentelemetry.io/contrib/instrumentation/runtime v0.53.0
- go.opentelemetry.io/otel v1.28.0
+ go.opentelemetry.io/otel v1.32.0
go.opentelemetry.io/otel/exporters/prometheus v0.50.0
- go.opentelemetry.io/otel/metric v1.28.0
- go.opentelemetry.io/otel/sdk v1.28.0
+ go.opentelemetry.io/otel/metric v1.32.0
+ go.opentelemetry.io/otel/sdk v1.32.0
go.opentelemetry.io/otel/sdk/metric v1.28.0
)
@@ -19,7 +19,7 @@ require (
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/clbanning/mxj/v2 v2.7.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
- github.com/fatih/color v1.17.0 // indirect
+ github.com/fatih/color v1.18.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
@@ -29,7 +29,7 @@ require (
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
- github.com/mattn/go-runewidth v0.0.15 // indirect
+ github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
@@ -37,10 +37,10 @@ require (
github.com/prometheus/procfs v0.15.1 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
- go.opentelemetry.io/otel/trace v1.28.0 // indirect
- golang.org/x/net v0.27.0 // indirect
- golang.org/x/sys v0.22.0 // indirect
- golang.org/x/text v0.16.0 // indirect
+ go.opentelemetry.io/otel/trace v1.32.0 // indirect
+ golang.org/x/net v0.31.0 // indirect
+ golang.org/x/sys v0.27.0 // indirect
+ golang.org/x/text v0.20.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/contrib/metric/otelmetric/go.sum b/contrib/metric/otelmetric/go.sum
index 14d7934e4..08814e6ab 100644
--- a/contrib/metric/otelmetric/go.sum
+++ b/contrib/metric/otelmetric/go.sum
@@ -10,8 +10,8 @@ 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/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
-github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
-github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
+github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
+github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
@@ -39,8 +39,8 @@ github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
-github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U=
-github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
+github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc=
+github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
@@ -64,26 +64,26 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
go.opentelemetry.io/contrib/instrumentation/runtime v0.53.0 h1:nOlJEAJyrcy8hexK65M+dsCHIx7CVVbybcFDNkcTcAc=
go.opentelemetry.io/contrib/instrumentation/runtime v0.53.0/go.mod h1:u79lGGIlkg3Ryw425RbMjEkGYNxSnXRyR286O840+u4=
-go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo=
-go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4=
+go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U=
+go.opentelemetry.io/otel v1.32.0/go.mod h1:00DCVSB0RQcnzlwyTfqtxSm+DRr9hpYrHjNGiBHVQIg=
go.opentelemetry.io/otel/exporters/prometheus v0.50.0 h1:2Ewsda6hejmbhGFyUvWZjUThC98Cf8Zy6g0zkIimOng=
go.opentelemetry.io/otel/exporters/prometheus v0.50.0/go.mod h1:pMm5PkUo5YwbLiuEf7t2xg4wbP0/eSJrMxIMxKosynY=
-go.opentelemetry.io/otel/metric v1.28.0 h1:f0HGvSl1KRAU1DLgLGFjrwVyismPlnuU6JD6bOeuA5Q=
-go.opentelemetry.io/otel/metric v1.28.0/go.mod h1:Fb1eVBFZmLVTMb6PPohq3TO9IIhUisDsbJoL/+uQW4s=
-go.opentelemetry.io/otel/sdk v1.28.0 h1:b9d7hIry8yZsgtbmM0DKyPWMMUMlK9NEKuIG4aBqWyE=
-go.opentelemetry.io/otel/sdk v1.28.0/go.mod h1:oYj7ClPUA7Iw3m+r7GeEjz0qckQRJK2B8zjcZEfu7Pg=
+go.opentelemetry.io/otel/metric v1.32.0 h1:xV2umtmNcThh2/a/aCP+h64Xx5wsj8qqnkYZktzNa0M=
+go.opentelemetry.io/otel/metric v1.32.0/go.mod h1:jH7CIbbK6SH2V2wE16W05BHCtIDzauciCRLoc/SyMv8=
+go.opentelemetry.io/otel/sdk v1.32.0 h1:RNxepc9vK59A8XsgZQouW8ue8Gkb4jpWtJm9ge5lEG4=
+go.opentelemetry.io/otel/sdk v1.32.0/go.mod h1:LqgegDBjKMmb2GC6/PrTnteJG39I8/vJCAP9LlJXEjU=
go.opentelemetry.io/otel/sdk/metric v1.28.0 h1:OkuaKgKrgAbYrrY0t92c+cC+2F6hsFNnCQArXCKlg08=
go.opentelemetry.io/otel/sdk/metric v1.28.0/go.mod h1:cWPjykihLAPvXKi4iZc1dpER3Jdq2Z0YLse3moQUCpg=
-go.opentelemetry.io/otel/trace v1.28.0 h1:GhQ9cUuQGmNDd5BTCP2dAvv75RdMxEfTmYejp+lkx9g=
-go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI=
-golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
-golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
+go.opentelemetry.io/otel/trace v1.32.0 h1:WIC9mYrXf8TmY/EXuULKc8hR17vE+Hjv2cssQDe03fM=
+go.opentelemetry.io/otel/trace v1.32.0/go.mod h1:+i4rkvCraA+tG6AzwloGaCtkx53Fa+L+V8e9a7YvhT8=
+golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo=
+golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
-golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
-golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
+golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s=
+golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug=
+golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4=
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
diff --git a/contrib/nosql/redis/go.mod b/contrib/nosql/redis/go.mod
index e25d98cd7..23f738421 100644
--- a/contrib/nosql/redis/go.mod
+++ b/contrib/nosql/redis/go.mod
@@ -1,35 +1,37 @@
module github.com/gogf/gf/contrib/nosql/redis/v2
-go 1.18
+go 1.20
require (
- github.com/gogf/gf/v2 v2.7.2
+ github.com/gogf/gf/v2 v2.8.1
github.com/redis/go-redis/v9 v9.2.1
- go.opentelemetry.io/otel v1.14.0
- go.opentelemetry.io/otel/trace v1.14.0
+ go.opentelemetry.io/otel v1.24.0
+ go.opentelemetry.io/otel/trace v1.24.0
)
require (
- github.com/BurntSushi/toml v1.3.2 // indirect
+ github.com/BurntSushi/toml v1.4.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/clbanning/mxj/v2 v2.7.0 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/emirpasic/gods v1.18.1 // indirect
- github.com/fatih/color v1.16.0 // indirect
+ github.com/fatih/color v1.17.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
- github.com/go-logr/logr v1.2.3 // indirect
+ github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
- github.com/gorilla/websocket v1.5.1 // indirect
+ github.com/gorilla/websocket v1.5.3 // indirect
github.com/grokify/html-strip-tags-go v0.1.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
- github.com/mattn/go-runewidth v0.0.9 // indirect
+ github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
- go.opentelemetry.io/otel/sdk v1.14.0 // indirect
- golang.org/x/net v0.24.0 // indirect
- golang.org/x/sys v0.19.0 // indirect
- golang.org/x/text v0.14.0 // indirect
+ github.com/rivo/uniseg v0.4.7 // indirect
+ go.opentelemetry.io/otel/metric v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.24.0 // indirect
+ golang.org/x/net v0.27.0 // indirect
+ golang.org/x/sys v0.22.0 // indirect
+ golang.org/x/text v0.16.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/contrib/nosql/redis/go.sum b/contrib/nosql/redis/go.sum
index c33db4f5c..e954f1914 100644
--- a/contrib/nosql/redis/go.sum
+++ b/contrib/nosql/redis/go.sum
@@ -1,5 +1,5 @@
-github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
-github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
+github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
+github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs=
github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
@@ -11,18 +11,18 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/r
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
-github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
-github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
+github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
+github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
-github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0=
-github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
+github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
+github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
-github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
-github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
-github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
+github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
+github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
+github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grokify/html-strip-tags-go v0.1.0 h1:03UrQLjAny8xci+R+qjCce/MYnpNXCtgzltlQbOBae4=
github.com/grokify/html-strip-tags-go v0.1.0/go.mod h1:ZdzgfHEzAfz9X6Xe5eBLVblWIxXfYSQ40S/VKrAOGpc=
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
@@ -32,28 +32,34 @@ github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovk
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
-github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
+github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U=
+github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/redis/go-redis/v9 v9.2.1 h1:WlYJg71ODF0dVspZZCpYmoF1+U1Jjk9Rwd7pq6QmlCg=
github.com/redis/go-redis/v9 v9.2.1/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M=
-github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
-go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM=
-go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU=
-go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY=
-go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM=
-go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M=
-go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8=
-golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
-golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
+github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
+github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
+github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
+github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
+golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
+golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
-golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
-golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
+golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
+golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
+golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
diff --git a/contrib/nosql/redis/redis_group_script.go b/contrib/nosql/redis/redis_group_script.go
index a074748df..3f1a6ef77 100644
--- a/contrib/nosql/redis/redis_group_script.go
+++ b/contrib/nosql/redis/redis_group_script.go
@@ -76,6 +76,9 @@ func (r GroupScript) ScriptExists(ctx context.Context, sha1 string, sha1s ...str
s = append(s, "Exists")
s = append(s, sha1Array...)
result, err := r.Operation.Do(ctx, "Script", s...)
+ if err != nil {
+ return nil, err
+ }
var (
m = make(map[string]bool)
resultArray = result.Vars()
diff --git a/contrib/registry/etcd/etcd.go b/contrib/registry/etcd/etcd.go
index 503478d12..fac43a9e4 100644
--- a/contrib/registry/etcd/etcd.go
+++ b/contrib/registry/etcd/etcd.go
@@ -12,6 +12,7 @@ import (
"time"
etcd3 "go.etcd.io/etcd/client/v3"
+ "google.golang.org/grpc"
"github.com/gogf/gf/v2/errors/gcode"
"github.com/gogf/gf/v2/errors/gerror"
@@ -38,11 +39,26 @@ type Registry struct {
type Option struct {
Logger glog.ILogger
KeepaliveTTL time.Duration
+
+ // DialTimeout is the timeout for failing to establish a connection.
+ DialTimeout time.Duration
+
+ // AutoSyncInterval is the interval to update endpoints with its latest members.
+ AutoSyncInterval time.Duration
+
+ DialOptions []grpc.DialOption
}
const (
// DefaultKeepAliveTTL is the default keepalive TTL.
DefaultKeepAliveTTL = 10 * time.Second
+
+ // DefaultDialTimeout is the timeout for failing to establish a connection.
+ DefaultDialTimeout = time.Second * 5
+
+ // DefaultAutoSyncInterval is the interval to update endpoints with its latest members.
+ // 0 disables auto-sync. By default auto-sync is disabled.
+ DefaultAutoSyncInterval = time.Second
)
// New creates and returns a new etcd registry.
@@ -80,6 +96,21 @@ func New(address string, option ...Option) gsvc.Registry {
if password != "" {
cfg.Password = password
}
+
+ cfg.DialTimeout = DefaultDialTimeout
+ cfg.AutoSyncInterval = DefaultAutoSyncInterval
+
+ var usedOption Option
+ if len(option) > 0 {
+ usedOption = option[0]
+ }
+ if usedOption.DialTimeout > 0 {
+ cfg.DialTimeout = usedOption.DialTimeout
+ }
+ if usedOption.AutoSyncInterval > 0 {
+ cfg.AutoSyncInterval = usedOption.AutoSyncInterval
+ }
+
client, err := etcd3.New(cfg)
if err != nil {
panic(gerror.Wrap(err, `create etcd client failed`))
diff --git a/contrib/registry/etcd/go.mod b/contrib/registry/etcd/go.mod
index 40701da71..487f54564 100644
--- a/contrib/registry/etcd/go.mod
+++ b/contrib/registry/etcd/go.mod
@@ -1,48 +1,49 @@
module github.com/gogf/gf/contrib/registry/etcd/v2
-go 1.18
+go 1.20
require (
- github.com/gogf/gf/v2 v2.7.2
+ github.com/gogf/gf/v2 v2.8.1
go.etcd.io/etcd/client/v3 v3.5.7
+ google.golang.org/grpc v1.59.0
)
require (
- github.com/BurntSushi/toml v1.3.2 // indirect
+ github.com/BurntSushi/toml v1.4.0 // indirect
github.com/clbanning/mxj/v2 v2.7.0 // indirect
github.com/coreos/go-semver v0.3.0 // indirect
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
- github.com/fatih/color v1.16.0 // indirect
+ github.com/fatih/color v1.17.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
- github.com/go-logr/logr v1.2.4 // indirect
+ github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
- github.com/gorilla/websocket v1.5.1 // indirect
+ github.com/gorilla/websocket v1.5.3 // indirect
github.com/grokify/html-strip-tags-go v0.1.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
- github.com/rivo/uniseg v0.4.4 // indirect
+ github.com/rivo/uniseg v0.4.7 // indirect
go.etcd.io/etcd/api/v3 v3.5.7 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.7 // indirect
- go.opentelemetry.io/otel v1.14.0 // indirect
- go.opentelemetry.io/otel/sdk v1.14.0 // indirect
- go.opentelemetry.io/otel/trace v1.14.0 // indirect
+ go.opentelemetry.io/otel v1.24.0 // indirect
+ go.opentelemetry.io/otel/metric v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.24.0 // indirect
+ go.opentelemetry.io/otel/trace v1.24.0 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.17.0 // indirect
- golang.org/x/net v0.24.0 // indirect
- golang.org/x/sys v0.19.0 // indirect
- golang.org/x/text v0.14.0 // indirect
+ golang.org/x/net v0.27.0 // indirect
+ golang.org/x/sys v0.22.0 // indirect
+ golang.org/x/text v0.16.0 // indirect
google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
- google.golang.org/grpc v1.59.0 // indirect
- google.golang.org/protobuf v1.31.0 // indirect
+ google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/contrib/registry/etcd/go.sum b/contrib/registry/etcd/go.sum
index 84da7e36b..379f4f2b5 100644
--- a/contrib/registry/etcd/go.sum
+++ b/contrib/registry/etcd/go.sum
@@ -1,5 +1,5 @@
-github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
-github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
+github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
+github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/clbanning/mxj/v2 v2.7.0 h1:WA/La7UGCanFe5NpHF0Q3DNtnCsVoxbPKuyBNHWRyME=
github.com/clbanning/mxj/v2 v2.7.0/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s=
github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM=
@@ -11,13 +11,13 @@ 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/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
-github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
-github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
+github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
+github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
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/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
+github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
@@ -27,9 +27,9 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS
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/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
-github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
-github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
+github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
+github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
+github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grokify/html-strip-tags-go v0.1.0 h1:03UrQLjAny8xci+R+qjCce/MYnpNXCtgzltlQbOBae4=
github.com/grokify/html-strip-tags-go v0.1.0/go.mod h1:ZdzgfHEzAfz9X6Xe5eBLVblWIxXfYSQ40S/VKrAOGpc=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
@@ -51,12 +51,12 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
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/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
-github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
-github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
+github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
+github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
-github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
+github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
go.etcd.io/etcd/api/v3 v3.5.7 h1:sbcmosSVesNrWOJ58ZQFitHMdncusIifYcrBfwrlJSY=
@@ -65,12 +65,14 @@ go.etcd.io/etcd/client/pkg/v3 v3.5.7 h1:y3kf5Gbp4e4q7egZdn5T7W9TSHUvkClN6u+Rq9mE
go.etcd.io/etcd/client/pkg/v3 v3.5.7/go.mod h1:o0Abi1MK86iad3YrWhgUsbGx1pmTS+hrORWc2CamuhY=
go.etcd.io/etcd/client/v3 v3.5.7 h1:u/OhpiuCgYY8awOHlhIhmGIGpxfBU/GZBUP3m/3/Iz4=
go.etcd.io/etcd/client/v3 v3.5.7/go.mod h1:sOWmj9DZUMyAngS7QQwCyAXXAL6WhgTOPLNS/NabQgw=
-go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM=
-go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU=
-go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY=
-go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM=
-go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M=
-go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4=
@@ -86,8 +88,8 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
-golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
-golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
+golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
+golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -96,12 +98,12 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
-golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
+golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
-golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
-golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
+golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
+golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
@@ -120,8 +122,8 @@ google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk=
google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98=
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.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
-google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
+google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
+google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
diff --git a/contrib/registry/file/file_discovery.go b/contrib/registry/file/file_discovery.go
index 36065cc11..b5c03d977 100644
--- a/contrib/registry/file/file_discovery.go
+++ b/contrib/registry/file/file_discovery.go
@@ -10,6 +10,7 @@ import (
"context"
"github.com/gogf/gf/v2/container/gmap"
+ "github.com/gogf/gf/v2/container/gtype"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/net/gsvc"
"github.com/gogf/gf/v2/os/gfile"
@@ -55,8 +56,12 @@ func (r *Registry) Watch(ctx context.Context, key string) (watcher gsvc.Watcher,
prefix: key,
discovery: r,
ch: make(chan gsvc.Service, 100),
+ closed: gtype.NewBool(false),
}
_, err = gfsnotify.Add(r.path, func(event *gfsnotify.Event) {
+ if fileWatcher.closed.Val() {
+ return
+ }
if event.IsChmod() {
return
}
@@ -94,7 +99,7 @@ func (r *Registry) getServices(ctx context.Context) (services []gsvc.Service, er
`service "%s" is expired, update at: %s, current: %s, sub duration: %s`,
s.GetKey(), updateAt.String(), nowTime.String(), subDuration.String(),
)
- _ = gfile.Remove(filePath)
+ _ = gfile.RemoveFile(filePath)
continue
}
services = append(services, s)
diff --git a/contrib/registry/file/file_registrar.go b/contrib/registry/file/file_registrar.go
index d98098779..d7bdfb8ee 100644
--- a/contrib/registry/file/file_registrar.go
+++ b/contrib/registry/file/file_registrar.go
@@ -44,7 +44,7 @@ func (r *Registry) Register(ctx context.Context, service gsvc.Service) (register
// Deregister off-lines and removes `service` from the Registry.
func (r *Registry) Deregister(ctx context.Context, service gsvc.Service) error {
- return gfile.Remove(r.getServiceFilePath(service))
+ return gfile.RemoveFile(r.getServiceFilePath(service))
}
func (r *Registry) getServiceFilePath(service gsvc.Service) string {
diff --git a/contrib/registry/file/file_watcher.go b/contrib/registry/file/file_watcher.go
index fa060ef0a..b10e74304 100644
--- a/contrib/registry/file/file_watcher.go
+++ b/contrib/registry/file/file_watcher.go
@@ -9,6 +9,8 @@ package file
import (
"context"
+ "github.com/gogf/gf/v2/container/gtype"
+ "github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/net/gsvc"
)
@@ -17,11 +19,15 @@ type Watcher struct {
prefix string // Watched prefix key, not file name prefix.
discovery gsvc.Discovery // Service discovery.
ch chan gsvc.Service // Changes that caused by inotify.
+ closed *gtype.Bool // Whether the channel has been closed
}
// Proceed proceeds watch in blocking way.
// It returns all complete services that watched by `key` if any change.
func (w *Watcher) Proceed() (services []gsvc.Service, err error) {
+ if w.closed.Val() {
+ return nil, gerror.New("discovery service was closed")
+ }
<-w.ch
return w.discovery.Search(context.Background(), gsvc.SearchInput{
Prefix: w.prefix,
@@ -30,6 +36,8 @@ func (w *Watcher) Proceed() (services []gsvc.Service, err error) {
// Close closes the watcher.
func (w *Watcher) Close() error {
- close(w.ch)
+ if w.closed.Cas(false, true) {
+ close(w.ch)
+ }
return nil
}
diff --git a/contrib/registry/file/go.mod b/contrib/registry/file/go.mod
index 37178c10c..8e1bb98d4 100644
--- a/contrib/registry/file/go.mod
+++ b/contrib/registry/file/go.mod
@@ -1,31 +1,32 @@
module github.com/gogf/gf/contrib/registry/file/v2
-go 1.18
+go 1.20
-require github.com/gogf/gf/v2 v2.7.2
+require github.com/gogf/gf/v2 v2.8.1
require (
- github.com/BurntSushi/toml v1.3.2 // indirect
+ github.com/BurntSushi/toml v1.4.0 // indirect
github.com/clbanning/mxj/v2 v2.7.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
- github.com/fatih/color v1.16.0 // indirect
+ github.com/fatih/color v1.17.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
- github.com/go-logr/logr v1.2.4 // indirect
+ github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
- github.com/gorilla/websocket v1.5.1 // indirect
+ github.com/gorilla/websocket v1.5.3 // indirect
github.com/grokify/html-strip-tags-go v0.1.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
- github.com/rivo/uniseg v0.4.4 // indirect
- go.opentelemetry.io/otel v1.14.0 // indirect
- go.opentelemetry.io/otel/sdk v1.14.0 // indirect
- go.opentelemetry.io/otel/trace v1.14.0 // indirect
- golang.org/x/net v0.24.0 // indirect
- golang.org/x/sys v0.19.0 // indirect
- golang.org/x/text v0.14.0 // indirect
+ github.com/rivo/uniseg v0.4.7 // indirect
+ go.opentelemetry.io/otel v1.24.0 // indirect
+ go.opentelemetry.io/otel/metric v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.24.0 // indirect
+ go.opentelemetry.io/otel/trace v1.24.0 // indirect
+ golang.org/x/net v0.27.0 // indirect
+ golang.org/x/sys v0.22.0 // indirect
+ golang.org/x/text v0.16.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/contrib/registry/file/go.sum b/contrib/registry/file/go.sum
index 726644ce5..ae66c9eaa 100644
--- a/contrib/registry/file/go.sum
+++ b/contrib/registry/file/go.sum
@@ -1,22 +1,22 @@
-github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
-github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
+github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
+github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/clbanning/mxj/v2 v2.7.0 h1:WA/La7UGCanFe5NpHF0Q3DNtnCsVoxbPKuyBNHWRyME=
github.com/clbanning/mxj/v2 v2.7.0/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
-github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
-github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
+github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
+github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
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/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
+github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
-github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
-github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
-github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
+github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
+github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
+github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grokify/html-strip-tags-go v0.1.0 h1:03UrQLjAny8xci+R+qjCce/MYnpNXCtgzltlQbOBae4=
github.com/grokify/html-strip-tags-go v0.1.0/go.mod h1:ZdzgfHEzAfz9X6Xe5eBLVblWIxXfYSQ40S/VKrAOGpc=
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
@@ -33,23 +33,25 @@ github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
-github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
-github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
-github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
-go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM=
-go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU=
-go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY=
-go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM=
-go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M=
-go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8=
-golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
-golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
+github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
+github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
+github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
+golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
+golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
-golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
-golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
+golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
+golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
+golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
diff --git a/contrib/registry/nacos/go.mod b/contrib/registry/nacos/go.mod
index aac9b7e19..f243e5954 100644
--- a/contrib/registry/nacos/go.mod
+++ b/contrib/registry/nacos/go.mod
@@ -1,14 +1,14 @@
module github.com/gogf/gf/contrib/registry/nacos/v2
-go 1.18
+go 1.20
require (
- github.com/gogf/gf/v2 v2.7.2
- github.com/joy999/nacos-sdk-go v0.0.0-20231120071639-10a34b3e7288
+ github.com/gogf/gf/v2 v2.8.1
+ github.com/nacos-group/nacos-sdk-go/v2 v2.2.7
)
require (
- github.com/BurntSushi/toml v1.3.2 // indirect
+ github.com/BurntSushi/toml v1.4.0 // indirect
github.com/alibabacloud-go/debug v0.0.0-20190504072949-9472017b5c68 // indirect
github.com/alibabacloud-go/tea v1.1.17 // indirect
github.com/alibabacloud-go/tea-utils v1.4.4 // indirect
@@ -20,13 +20,13 @@ require (
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/clbanning/mxj/v2 v2.7.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
- github.com/fatih/color v1.16.0 // indirect
+ github.com/fatih/color v1.17.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
- github.com/go-logr/logr v1.2.4 // indirect
+ github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
- github.com/gorilla/websocket v1.5.1 // indirect
+ github.com/gorilla/websocket v1.5.3 // indirect
github.com/grokify/html-strip-tags-go v0.1.0 // indirect
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af // indirect
github.com/json-iterator/go v1.1.12 // indirect
@@ -43,22 +43,23 @@ require (
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.32.1 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
- github.com/rivo/uniseg v0.4.4 // indirect
- go.opentelemetry.io/otel v1.14.0 // indirect
- go.opentelemetry.io/otel/sdk v1.14.0 // indirect
- go.opentelemetry.io/otel/trace v1.14.0 // indirect
+ github.com/rivo/uniseg v0.4.7 // indirect
+ go.opentelemetry.io/otel v1.24.0 // indirect
+ go.opentelemetry.io/otel/metric v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.24.0 // indirect
+ go.opentelemetry.io/otel/trace v1.24.0 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.21.0 // indirect
- golang.org/x/crypto v0.22.0 // indirect
- golang.org/x/net v0.24.0 // indirect
- golang.org/x/sync v0.1.0 // indirect
- golang.org/x/sys v0.19.0 // indirect
- golang.org/x/text v0.14.0 // indirect
+ golang.org/x/crypto v0.25.0 // indirect
+ golang.org/x/net v0.27.0 // indirect
+ golang.org/x/sync v0.7.0 // indirect
+ golang.org/x/sys v0.22.0 // indirect
+ golang.org/x/text v0.16.0 // indirect
golang.org/x/time v0.1.0 // indirect
- google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect
- google.golang.org/grpc v1.57.2 // indirect
- google.golang.org/protobuf v1.31.0 // indirect
+ google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
+ google.golang.org/grpc v1.56.3 // indirect
+ google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/ini.v1 v1.66.2 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
diff --git a/contrib/registry/nacos/go.sum b/contrib/registry/nacos/go.sum
index bd7ff2c08..43d0d9771 100644
--- a/contrib/registry/nacos/go.sum
+++ b/contrib/registry/nacos/go.sum
@@ -32,8 +32,8 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
-github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
-github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
+github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
+github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
@@ -82,8 +82,8 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
-github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
-github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
+github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
+github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
@@ -96,8 +96,8 @@ github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
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/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
+github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
@@ -145,7 +145,7 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
+github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/gofuzz v1.0.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=
@@ -159,8 +159,8 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
-github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
-github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
+github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
+github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grokify/html-strip-tags-go v0.1.0 h1:03UrQLjAny8xci+R+qjCce/MYnpNXCtgzltlQbOBae4=
github.com/grokify/html-strip-tags-go v0.1.0/go.mod h1:ZdzgfHEzAfz9X6Xe5eBLVblWIxXfYSQ40S/VKrAOGpc=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
@@ -168,8 +168,6 @@ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM=
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
-github.com/joy999/nacos-sdk-go v0.0.0-20231120071639-10a34b3e7288 h1:GuL6co0J2oMb2Rd/hbxZfJz1QlZr+DpIsz3Wcvok65o=
-github.com/joy999/nacos-sdk-go v0.0.0-20231120071639-10a34b3e7288/go.mod h1:xF3RcNkFUEIik3RCihkvgORtZXZXlp+OeGK0aUALVYU=
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
@@ -211,6 +209,8 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
+github.com/nacos-group/nacos-sdk-go/v2 v2.2.7 h1:wCC1f3/VzIR1WD30YKeJGZAOchYCK/35mLC8qWt6Q6o=
+github.com/nacos-group/nacos-sdk-go/v2 v2.2.7/go.mod h1:VYlyDPlQchPC31PmfBustu81vsOkdpCuO5k0dRdQcFc=
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
@@ -242,8 +242,8 @@ github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1
github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU=
github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
-github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
-github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
+github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
+github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
@@ -255,7 +255,7 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
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.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
+github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
@@ -265,12 +265,14 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
-go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM=
-go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU=
-go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY=
-go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM=
-go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M=
-go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI=
@@ -286,8 +288,8 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
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.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30=
-golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M=
+golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30=
+golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
@@ -349,8 +351,8 @@ golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81R
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
-golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
-golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
+golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
+golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -367,8 +369,8 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/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.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
-golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
+golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -409,8 +411,8 @@ golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
-golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
+golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -418,8 +420,8 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
-golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
-golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
+golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
+golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
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=
@@ -522,8 +524,8 @@ google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7Fc
google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
-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/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A=
+google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
@@ -536,8 +538,8 @@ google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKa
google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
-google.golang.org/grpc v1.57.2 h1:uw37EN34aMFFXB2QPW7Tq6tdTbind1GpRxw5aOX3a5k=
-google.golang.org/grpc v1.57.2/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo=
+google.golang.org/grpc v1.56.3 h1:8I4C0Yq1EjstUzUJzpcRVbuYA2mODtEmpWiQoN/b2nc=
+google.golang.org/grpc v1.56.3/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s=
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=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
@@ -550,8 +552,8 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
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.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
-google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
+google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
+google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
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=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
diff --git a/contrib/registry/nacos/nacos.go b/contrib/registry/nacos/nacos.go
index 78024b216..600ebe635 100644
--- a/contrib/registry/nacos/nacos.go
+++ b/contrib/registry/nacos/nacos.go
@@ -17,10 +17,10 @@ import (
"github.com/gogf/gf/v2/os/gctx"
"github.com/gogf/gf/v2/text/gstr"
"github.com/gogf/gf/v2/util/gconv"
- "github.com/joy999/nacos-sdk-go/clients"
- "github.com/joy999/nacos-sdk-go/clients/naming_client"
- "github.com/joy999/nacos-sdk-go/common/constant"
- "github.com/joy999/nacos-sdk-go/vo"
+ "github.com/nacos-group/nacos-sdk-go/v2/clients"
+ "github.com/nacos-group/nacos-sdk-go/v2/clients/naming_client"
+ "github.com/nacos-group/nacos-sdk-go/v2/common/constant"
+ "github.com/nacos-group/nacos-sdk-go/v2/vo"
)
const (
diff --git a/contrib/registry/nacos/nacos_discovery.go b/contrib/registry/nacos/nacos_discovery.go
index b67973c0c..6e38585db 100644
--- a/contrib/registry/nacos/nacos_discovery.go
+++ b/contrib/registry/nacos/nacos_discovery.go
@@ -13,8 +13,8 @@ import (
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/net/gsvc"
"github.com/gogf/gf/v2/text/gstr"
- "github.com/joy999/nacos-sdk-go/model"
- "github.com/joy999/nacos-sdk-go/vo"
+ "github.com/nacos-group/nacos-sdk-go/v2/model"
+ "github.com/nacos-group/nacos-sdk-go/v2/vo"
)
// Search searches and returns services with specified condition.
diff --git a/contrib/registry/nacos/nacos_register.go b/contrib/registry/nacos/nacos_register.go
index 70dff428a..afc950c60 100644
--- a/contrib/registry/nacos/nacos_register.go
+++ b/contrib/registry/nacos/nacos_register.go
@@ -11,7 +11,7 @@ import (
"github.com/gogf/gf/v2/net/gsvc"
"github.com/gogf/gf/v2/util/gconv"
- "github.com/joy999/nacos-sdk-go/vo"
+ "github.com/nacos-group/nacos-sdk-go/v2/vo"
)
// Register registers `service` to Registry.
diff --git a/contrib/registry/nacos/nacos_service.go b/contrib/registry/nacos/nacos_service.go
index 1bd7733d3..8ac5f5ce1 100644
--- a/contrib/registry/nacos/nacos_service.go
+++ b/contrib/registry/nacos/nacos_service.go
@@ -12,7 +12,7 @@ import (
"github.com/gogf/gf/v2/container/gmap"
"github.com/gogf/gf/v2/net/gsvc"
"github.com/gogf/gf/v2/text/gstr"
- "github.com/joy999/nacos-sdk-go/model"
+ "github.com/nacos-group/nacos-sdk-go/v2/model"
)
// NewServiceFromInstance new one service from instance
diff --git a/contrib/registry/nacos/nacos_watcher.go b/contrib/registry/nacos/nacos_watcher.go
index fe9fc85b3..c9454d164 100644
--- a/contrib/registry/nacos/nacos_watcher.go
+++ b/contrib/registry/nacos/nacos_watcher.go
@@ -12,7 +12,7 @@ import (
"github.com/gogf/gf/v2/errors/gcode"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/net/gsvc"
- "github.com/joy999/nacos-sdk-go/model"
+ "github.com/nacos-group/nacos-sdk-go/v2/model"
)
// Watcher used to mange service event such as update.
diff --git a/contrib/registry/nacos/nacos_z_test.go b/contrib/registry/nacos/nacos_z_test.go
index 959078c32..0470c4abb 100644
--- a/contrib/registry/nacos/nacos_z_test.go
+++ b/contrib/registry/nacos/nacos_z_test.go
@@ -18,7 +18,7 @@ import (
"github.com/gogf/gf/v2/os/gctx"
"github.com/gogf/gf/v2/test/gtest"
"github.com/gogf/gf/v2/util/guid"
- "github.com/joy999/nacos-sdk-go/common/constant"
+ "github.com/nacos-group/nacos-sdk-go/v2/common/constant"
)
const (
diff --git a/contrib/registry/polaris/README_ZH.MD b/contrib/registry/polaris/README_ZH.MD
index 0006cfb31..e47248b0c 100644
--- a/contrib/registry/polaris/README_ZH.MD
+++ b/contrib/registry/polaris/README_ZH.MD
@@ -19,7 +19,7 @@ require github.com/gogf/gf/contrib/registry/polaris/v2 latest
## Golang版本限制
```
-golang version >= 1.15
+golang version >= 1.20
```
## 示例
diff --git a/contrib/registry/polaris/go.mod b/contrib/registry/polaris/go.mod
index 91a79c044..b941c4387 100644
--- a/contrib/registry/polaris/go.mod
+++ b/contrib/registry/polaris/go.mod
@@ -1,58 +1,59 @@
module github.com/gogf/gf/contrib/registry/polaris/v2
-go 1.18
+go 1.21
require (
- github.com/gogf/gf/v2 v2.7.2
- github.com/polarismesh/polaris-go v1.5.5
+ github.com/gogf/gf/v2 v2.8.1
+ github.com/polarismesh/polaris-go v1.5.8
)
require (
- github.com/BurntSushi/toml v1.3.2 // indirect
+ github.com/BurntSushi/toml v1.4.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
- github.com/cespare/xxhash/v2 v2.2.0 // indirect
+ github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/clbanning/mxj/v2 v2.7.0 // indirect
- github.com/dlclark/regexp2 v1.7.0 // indirect
+ github.com/dlclark/regexp2 v1.11.2 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
- github.com/fatih/color v1.16.0 // indirect
+ github.com/fatih/color v1.17.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
- github.com/go-logr/logr v1.2.4 // indirect
+ github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
- github.com/golang/protobuf v1.5.3 // indirect
- github.com/google/uuid v1.3.1 // indirect
- github.com/gorilla/websocket v1.5.1 // indirect
+ github.com/golang/protobuf v1.5.4 // indirect
+ github.com/google/uuid v1.6.0 // indirect
+ github.com/gorilla/websocket v1.5.3 // indirect
github.com/grokify/html-strip-tags-go v0.1.0 // indirect
- github.com/hashicorp/errwrap v1.0.0 // indirect
+ github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
- github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
+ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/natefinch/lumberjack v2.0.0+incompatible // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/pkg/errors v0.9.1 // indirect
- github.com/polarismesh/specification v1.4.1 // indirect
- github.com/prometheus/client_golang v1.12.2 // indirect
- github.com/prometheus/client_model v0.2.0 // indirect
- github.com/prometheus/common v0.32.1 // indirect
- github.com/prometheus/procfs v0.7.3 // indirect
- github.com/rivo/uniseg v0.4.4 // indirect
+ github.com/polarismesh/specification v1.5.1 // indirect
+ github.com/prometheus/client_golang v1.19.1 // indirect
+ github.com/prometheus/client_model v0.6.1 // indirect
+ github.com/prometheus/common v0.55.0 // indirect
+ github.com/prometheus/procfs v0.15.1 // indirect
+ github.com/rivo/uniseg v0.4.7 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
- go.opentelemetry.io/otel v1.14.0 // indirect
- go.opentelemetry.io/otel/sdk v1.14.0 // indirect
- go.opentelemetry.io/otel/trace v1.14.0 // indirect
+ go.opentelemetry.io/otel v1.24.0 // indirect
+ go.opentelemetry.io/otel/metric v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.24.0 // indirect
+ go.opentelemetry.io/otel/trace v1.24.0 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.21.0 // indirect
- golang.org/x/net v0.24.0 // indirect
- golang.org/x/sys v0.19.0 // indirect
- golang.org/x/text v0.14.0 // indirect
- google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
- google.golang.org/grpc v1.59.0 // indirect
- google.golang.org/protobuf v1.31.0 // indirect
+ golang.org/x/net v0.28.0 // indirect
+ golang.org/x/sys v0.24.0 // indirect
+ golang.org/x/text v0.17.0 // indirect
+ google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
+ google.golang.org/grpc v1.56.3 // indirect
+ google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/contrib/registry/polaris/go.sum b/contrib/registry/polaris/go.sum
index f520733dd..26b7619c8 100644
--- a/contrib/registry/polaris/go.sum
+++ b/contrib/registry/polaris/go.sum
@@ -168,8 +168,8 @@ cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1V
cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
-github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
-github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
+github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
+github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/agiledragon/gomonkey v2.0.2+incompatible h1:eXKi9/piiC3cjJD1658mEE2o3NjkJ5vDLgYjCQu0Xlw=
@@ -190,8 +190,8 @@ github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA
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/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
-github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
-github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
+github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
+github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
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=
@@ -210,8 +210,9 @@ github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWH
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/dlclark/regexp2 v1.7.0 h1:7lJfhqlPssTb1WQx4yvTHN0uElPEv52sbaECrAQxjAo=
github.com/dlclark/regexp2 v1.7.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
+github.com/dlclark/regexp2 v1.11.2 h1:/u628IuisSTwri5/UKloiIsH8+qF2Pu7xEQX+yIKg68=
+github.com/dlclark/regexp2 v1.11.2/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
@@ -224,8 +225,8 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.m
github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0=
github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
-github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
-github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
+github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
+github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
@@ -239,8 +240,8 @@ github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
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/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
+github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
@@ -275,8 +276,8 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw
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/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/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
+github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/gonum/blas v0.0.0-20181208220705-f22b278b28ac/go.mod h1:P32wAyui1PQ58Oce/KYkOqQv8cVw1zAapXOl+dRFGbc=
github.com/gonum/floats v0.0.0-20181209220543-c233463c7e82/go.mod h1:PxC8OnwL11+aosOB5+iEPoV3picfs8tUpkVd0pDo+Kg=
@@ -301,7 +302,8 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
-github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
+github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
+github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/gofuzz v1.0.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=
@@ -324,8 +326,8 @@ github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLe
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
-github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4=
-github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
+github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8=
github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
@@ -339,13 +341,14 @@ github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqE
github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
-github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
-github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
+github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
+github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grokify/html-strip-tags-go v0.1.0 h1:03UrQLjAny8xci+R+qjCce/MYnpNXCtgzltlQbOBae4=
github.com/grokify/html-strip-tags-go v0.1.0/go.mod h1:ZdzgfHEzAfz9X6Xe5eBLVblWIxXfYSQ40S/VKrAOGpc=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
-github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA=
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-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
@@ -368,8 +371,9 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
-github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
+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/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
@@ -383,7 +387,6 @@ github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U=
github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
-github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
@@ -393,6 +396,8 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
+github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
+github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/natefinch/lumberjack v2.0.0+incompatible h1:4QJd3OLAMgj7ph+yZTuX13Ld4UpgHp07nNdFX7mqFfM=
@@ -405,37 +410,44 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
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/polarismesh/polaris-go v1.5.5 h1:TUxgla21J9Zb3zSynoAA9og0+sYJZ7TpZ2aFwzH7woI=
-github.com/polarismesh/polaris-go v1.5.5/go.mod h1:CuXO9bhHGjSoOIMWr4NXf3bJAkRBp5YoM7ibBzENC+c=
-github.com/polarismesh/specification v1.4.1 h1:lTZqeyUhhWuKyr6NDKBwmUrNfcUDvKLxWT/uOq71T5A=
+github.com/polarismesh/polaris-go v1.5.8 h1:zBZkZBa4wVxsG5Y/6U4PmY9dY/mddXdfNI65edVu6U8=
+github.com/polarismesh/polaris-go v1.5.8/go.mod h1:CuXO9bhHGjSoOIMWr4NXf3bJAkRBp5YoM7ibBzENC+c=
github.com/polarismesh/specification v1.4.1/go.mod h1:rDvMMtl5qebPmqiBLNa5Ps0XtwkP31ZLirbH4kXA0YU=
+github.com/polarismesh/specification v1.5.1 h1:cJ2m0RBepdopGo/e3UpKdsab3NpDZnw5IsVTB1sFc5I=
+github.com/polarismesh/specification v1.5.1/go.mod h1:rDvMMtl5qebPmqiBLNa5Ps0XtwkP31ZLirbH4kXA0YU=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0=
-github.com/prometheus/client_golang v1.12.2 h1:51L9cDoUHVrXx4zWYlcLQIZ+d+VXHgqnYKkIuq4g/34=
github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY=
+github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE=
+github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
-github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M=
github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
+github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
+github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc=
-github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4=
github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls=
+github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc=
+github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
-github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU=
github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
+github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
+github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
-github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
-github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
+github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
+github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
+github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
+github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
@@ -458,8 +470,9 @@ 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.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
@@ -473,12 +486,14 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
-go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM=
-go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU=
-go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY=
-go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM=
-go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M=
-go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
@@ -580,8 +595,8 @@ golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
-golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
-golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
+golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE=
+golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -692,8 +707,8 @@ golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
-golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=
+golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
@@ -707,8 +722,8 @@ 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/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
-golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
-golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
+golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
+golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
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=
@@ -923,8 +938,8 @@ google.golang.org/genproto v0.0.0-20220920201722-2b89144ce006/go.mod h1:ht8XFiar
google.golang.org/genproto v0.0.0-20220926165614-551eb538f295/go.mod h1:woMGP53BroOrRY3xTxlbr8Y3eB/nzAvvFM83q7kG2OI=
google.golang.org/genproto v0.0.0-20220926220553-6981cbe3cfce/go.mod h1:woMGP53BroOrRY3xTxlbr8Y3eB/nzAvvFM83q7kG2OI=
google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M=
+google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A=
+google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
@@ -960,8 +975,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu
google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI=
google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI=
google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww=
-google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk=
-google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98=
+google.golang.org/grpc v1.56.3 h1:8I4C0Yq1EjstUzUJzpcRVbuYA2mODtEmpWiQoN/b2nc=
+google.golang.org/grpc v1.56.3/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s=
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=
@@ -978,8 +993,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.28.1/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=
+google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
+google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
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=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
diff --git a/contrib/registry/zookeeper/go.mod b/contrib/registry/zookeeper/go.mod
index 68050d25d..3afa94bb4 100644
--- a/contrib/registry/zookeeper/go.mod
+++ b/contrib/registry/zookeeper/go.mod
@@ -1,35 +1,36 @@
module github.com/gogf/gf/contrib/registry/zookeeper/v2
-go 1.18
+go 1.20
require (
github.com/go-zookeeper/zk v1.0.3
- github.com/gogf/gf/v2 v2.7.2
- golang.org/x/sync v0.4.0
+ github.com/gogf/gf/v2 v2.8.1
+ golang.org/x/sync v0.7.0
)
require (
- github.com/BurntSushi/toml v1.3.2 // indirect
+ github.com/BurntSushi/toml v1.4.0 // indirect
github.com/clbanning/mxj/v2 v2.7.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
- github.com/fatih/color v1.16.0 // indirect
+ github.com/fatih/color v1.17.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
- github.com/go-logr/logr v1.2.4 // indirect
+ github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
- github.com/gorilla/websocket v1.5.1 // indirect
+ github.com/gorilla/websocket v1.5.3 // indirect
github.com/grokify/html-strip-tags-go v0.1.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
- github.com/rivo/uniseg v0.4.4 // indirect
- go.opentelemetry.io/otel v1.14.0 // indirect
- go.opentelemetry.io/otel/sdk v1.14.0 // indirect
- go.opentelemetry.io/otel/trace v1.14.0 // indirect
- golang.org/x/net v0.24.0 // indirect
- golang.org/x/sys v0.19.0 // indirect
- golang.org/x/text v0.14.0 // indirect
+ github.com/rivo/uniseg v0.4.7 // indirect
+ go.opentelemetry.io/otel v1.24.0 // indirect
+ go.opentelemetry.io/otel/metric v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.24.0 // indirect
+ go.opentelemetry.io/otel/trace v1.24.0 // indirect
+ golang.org/x/net v0.27.0 // indirect
+ golang.org/x/sys v0.22.0 // indirect
+ golang.org/x/text v0.16.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/contrib/registry/zookeeper/go.sum b/contrib/registry/zookeeper/go.sum
index ca644cedb..4768eeba0 100644
--- a/contrib/registry/zookeeper/go.sum
+++ b/contrib/registry/zookeeper/go.sum
@@ -1,24 +1,24 @@
-github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
-github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
+github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
+github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/clbanning/mxj/v2 v2.7.0 h1:WA/La7UGCanFe5NpHF0Q3DNtnCsVoxbPKuyBNHWRyME=
github.com/clbanning/mxj/v2 v2.7.0/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
-github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
-github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
+github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
+github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
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/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
+github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-zookeeper/zk v1.0.3 h1:7M2kwOsc//9VeeFiPtf+uSJlVpU66x9Ba5+8XK7/TDg=
github.com/go-zookeeper/zk v1.0.3/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw=
-github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
-github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
-github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
+github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
+github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
+github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grokify/html-strip-tags-go v0.1.0 h1:03UrQLjAny8xci+R+qjCce/MYnpNXCtgzltlQbOBae4=
github.com/grokify/html-strip-tags-go v0.1.0/go.mod h1:ZdzgfHEzAfz9X6Xe5eBLVblWIxXfYSQ40S/VKrAOGpc=
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
@@ -35,25 +35,27 @@ github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
-github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
-github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
-github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
-go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM=
-go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU=
-go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY=
-go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM=
-go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M=
-go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8=
-golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
-golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
-golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ=
-golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
+github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
+github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
+github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
+golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
+golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
+golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
+golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
-golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
-golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
+golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
+golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
+golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
diff --git a/contrib/registry/zookeeper/zookeeper_registrar.go b/contrib/registry/zookeeper/zookeeper_registrar.go
index 5b8a01817..26273a5b2 100644
--- a/contrib/registry/zookeeper/zookeeper_registrar.go
+++ b/contrib/registry/zookeeper/zookeeper_registrar.go
@@ -65,7 +65,7 @@ func (r *Registry) Register(_ context.Context, service gsvc.Service) (gsvc.Servi
// Deregister off-lines and removes `service` from the Registry.
func (r *Registry) Deregister(ctx context.Context, service gsvc.Service) error {
ch := make(chan error, 1)
- prefix := strings.TrimPrefix(strings.ReplaceAll(service.GetPrefix(), "/", "-"), "-")
+ prefix := strings.Trim(strings.ReplaceAll(service.GetPrefix(), "/", "-"), "-")
servicePath := path.Join(r.opts.namespace, prefix, service.GetName())
go func() {
err := r.conn.Delete(servicePath, -1)
diff --git a/contrib/registry/zookeeper/zookeeper_watcher.go b/contrib/registry/zookeeper/zookeeper_watcher.go
index def4fa818..1ee710a17 100644
--- a/contrib/registry/zookeeper/zookeeper_watcher.go
+++ b/contrib/registry/zookeeper/zookeeper_watcher.go
@@ -66,7 +66,7 @@ func (w *watcher) Proceed() ([]gsvc.Service, error) {
}
func (w *watcher) getServicesByPrefix() ([]gsvc.Service, error) {
- prefix := strings.TrimPrefix(strings.ReplaceAll(w.prefix, "/", "-"), "-")
+ prefix := strings.Trim(strings.ReplaceAll(w.prefix, "/", "-"), "-")
serviceNamePath := path.Join(w.nameSpace, prefix)
instances, err, _ := w.group.Do(serviceNamePath, func() (interface{}, error) {
servicesID, _, err := w.conn.Children(serviceNamePath)
@@ -122,7 +122,7 @@ func (w *watcher) Close() error {
}
func (w *watcher) watch(ctx context.Context) {
- prefix := strings.TrimPrefix(strings.ReplaceAll(w.prefix, "/", "-"), "-")
+ prefix := strings.Trim(strings.ReplaceAll(w.prefix, "/", "-"), "-")
serviceNamePath := path.Join(w.nameSpace, prefix)
for {
diff --git a/contrib/rpc/grpcx/go.mod b/contrib/rpc/grpcx/go.mod
index 5f7ddcbae..7040f915e 100644
--- a/contrib/rpc/grpcx/go.mod
+++ b/contrib/rpc/grpcx/go.mod
@@ -1,38 +1,38 @@
module github.com/gogf/gf/contrib/rpc/grpcx/v2
-go 1.18
+go 1.20
require (
- github.com/gogf/gf/contrib/registry/file/v2 v2.7.2
- github.com/gogf/gf/v2 v2.7.2
- go.opentelemetry.io/otel v1.14.0
- go.opentelemetry.io/otel/trace v1.14.0
- google.golang.org/grpc v1.57.2
- google.golang.org/protobuf v1.31.0
+ github.com/gogf/gf/contrib/registry/file/v2 v2.8.1
+ github.com/gogf/gf/v2 v2.8.1
+ go.opentelemetry.io/otel v1.24.0
+ go.opentelemetry.io/otel/trace v1.24.0
+ google.golang.org/grpc v1.64.1
+ google.golang.org/protobuf v1.34.2
)
require (
- github.com/BurntSushi/toml v1.3.2 // indirect
+ github.com/BurntSushi/toml v1.4.0 // indirect
github.com/clbanning/mxj/v2 v2.7.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
- github.com/fatih/color v1.16.0 // indirect
+ github.com/fatih/color v1.17.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
- github.com/go-logr/logr v1.2.4 // indirect
+ github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
- github.com/golang/protobuf v1.5.3 // indirect
- github.com/gorilla/websocket v1.5.1 // indirect
+ github.com/gorilla/websocket v1.5.3 // indirect
github.com/grokify/html-strip-tags-go v0.1.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
- github.com/rivo/uniseg v0.4.4 // indirect
- go.opentelemetry.io/otel/sdk v1.14.0 // indirect
- golang.org/x/net v0.24.0 // indirect
- golang.org/x/sys v0.19.0 // indirect
- golang.org/x/text v0.14.0 // indirect
- google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect
+ github.com/rivo/uniseg v0.4.7 // indirect
+ go.opentelemetry.io/otel/metric v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.24.0 // indirect
+ golang.org/x/net v0.27.0 // indirect
+ golang.org/x/sys v0.22.0 // indirect
+ golang.org/x/text v0.16.0 // indirect
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/contrib/rpc/grpcx/go.sum b/contrib/rpc/grpcx/go.sum
index 91076b49f..7afa6ebd7 100644
--- a/contrib/rpc/grpcx/go.sum
+++ b/contrib/rpc/grpcx/go.sum
@@ -1,26 +1,22 @@
-github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
-github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
+github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
+github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/clbanning/mxj/v2 v2.7.0 h1:WA/La7UGCanFe5NpHF0Q3DNtnCsVoxbPKuyBNHWRyME=
github.com/clbanning/mxj/v2 v2.7.0/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
-github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
-github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
+github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
+github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
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/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
+github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
-github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
-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/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
-github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
-github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
+github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
+github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
+github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grokify/html-strip-tags-go v0.1.0 h1:03UrQLjAny8xci+R+qjCce/MYnpNXCtgzltlQbOBae4=
github.com/grokify/html-strip-tags-go v0.1.0/go.mod h1:ZdzgfHEzAfz9X6Xe5eBLVblWIxXfYSQ40S/VKrAOGpc=
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
@@ -37,32 +33,31 @@ github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
-github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
-github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
-github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
-go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM=
-go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU=
-go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY=
-go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM=
-go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M=
-go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8=
-golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
-golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
+github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
+github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
+github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
+golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
+golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
-golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
-golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
-golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-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 v1.57.2 h1:uw37EN34aMFFXB2QPW7Tq6tdTbind1GpRxw5aOX3a5k=
-google.golang.org/grpc v1.57.2/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo=
-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.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
-google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
+golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
+golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
+golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 h1:NnYq6UN9ReLM9/Y01KWNOWyI5xQ9kbIms5GGJVwS/Yc=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY=
+google.golang.org/grpc v1.64.1 h1:LKtvyfbX3UGVPFcGqJ9ItpVWW6oN/2XqTxfAnwRRXiA=
+google.golang.org/grpc v1.64.1/go.mod h1:hiQF4LFZelK2WKaP6W0L92zGHtiQdZxk8CrSdvyjeP0=
+google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
+google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
diff --git a/contrib/rpc/grpcx/grpcx_grpc_client.go b/contrib/rpc/grpcx/grpcx_grpc_client.go
index 51b77ffc8..47aa27c7b 100644
--- a/contrib/rpc/grpcx/grpcx_grpc_client.go
+++ b/contrib/rpc/grpcx/grpcx_grpc_client.go
@@ -8,6 +8,7 @@ package grpcx
import (
"fmt"
+
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
@@ -31,11 +32,11 @@ func (c modClient) NewGrpcClientConn(serviceNameOrAddress string, opts ...grpc.D
autoLoadAndRegisterFileRegistry()
var (
- dialAddress = serviceNameOrAddress
+ target = serviceNameOrAddress
grpcClientOptions = make([]grpc.DialOption, 0)
)
if isServiceName(serviceNameOrAddress) {
- dialAddress = fmt.Sprintf(
+ target = fmt.Sprintf(
`%s://%s`,
gsvc.Schema, gsvc.NewServiceWithName(serviceNameOrAddress).GetKey(),
)
@@ -69,7 +70,7 @@ func (c modClient) NewGrpcClientConn(serviceNameOrAddress string, opts ...grpc.D
grpcClientOptions = append(grpcClientOptions, c.ChainStream(
c.StreamTracing,
))
- conn, err := grpc.Dial(dialAddress, grpcClientOptions...)
+ conn, err := grpc.NewClient(target, grpcClientOptions...)
if err != nil {
return nil, err
}
diff --git a/contrib/rpc/grpcx/grpcx_grpc_server.go b/contrib/rpc/grpcx/grpcx_grpc_server.go
index 7d14d30d9..c022e6ea9 100644
--- a/contrib/rpc/grpcx/grpcx_grpc_server.go
+++ b/contrib/rpc/grpcx/grpcx_grpc_server.go
@@ -285,23 +285,23 @@ func (s *GrpcServer) calculateListenedEndpoints(ctx context.Context) gsvc.Endpoi
s.Logger().Errorf(ctx, `error retrieving intranet ip: %+v`, err)
return nil
}
- // If no intranet ips found, it uses all ips that can be retrieved,
- // it may include internet ip.
- if len(intranetIps) == 0 {
- allIps, err := gipv4.GetIpArray()
- if err != nil {
- s.Logger().Errorf(ctx, `error retrieving ip from current node: %+v`, err)
- return nil
- }
- s.Logger().Noticef(
- ctx,
- `no intranet ip found, using internet ip to register service: %v`,
- allIps,
- )
- listenedIps = allIps
+ if len(intranetIps) != 0 {
+ listenedIps = intranetIps
break
}
- listenedIps = intranetIps
+ // If no intranet ips found, it uses all ips that can be retrieved,
+ // it may include internet ip.
+ allIps, err := gipv4.GetIpArray()
+ if err != nil {
+ s.Logger().Errorf(ctx, `error retrieving ip from current node: %+v`, err)
+ return nil
+ }
+ s.Logger().Noticef(
+ ctx,
+ `no intranet ip found, using internet ip to register service: %v`,
+ allIps,
+ )
+ listenedIps = allIps
default:
listenedIps = []string{addrArray[0]}
}
diff --git a/contrib/rpc/grpcx/internal/tracing/tracing.go b/contrib/rpc/grpcx/internal/tracing/tracing.go
index d8e22ea65..6b21f4c93 100644
--- a/contrib/rpc/grpcx/internal/tracing/tracing.go
+++ b/contrib/rpc/grpcx/internal/tracing/tracing.go
@@ -29,12 +29,10 @@ const (
tracingInstrumentGrpcClient = "github.com/gogf/gf/contrib/rpc/grpcx/v2/krpc.GrpcClient"
tracingInstrumentGrpcServer = "github.com/gogf/gf/contrib/rpc/grpcx/v2/krpc.GrpcServer"
tracingEventGrpcRequest = "grpc.request"
- tracingEventGrpcRequestMessage = "grpc.request.message"
tracingEventGrpcRequestBaggage = "grpc.request.baggage"
tracingEventGrpcMetadataOutgoing = "grpc.metadata.outgoing"
tracingEventGrpcMetadataIncoming = "grpc.metadata.incoming"
tracingEventGrpcResponse = "grpc.response"
- tracingEventGrpcResponseMessage = "grpc.response.message"
)
type metadataSupplier struct {
diff --git a/contrib/rpc/grpcx/internal/tracing/tracing_interceptor_client.go b/contrib/rpc/grpcx/internal/tracing/tracing_interceptor_client.go
index 2ccf475d8..a244eeb0d 100644
--- a/contrib/rpc/grpcx/internal/tracing/tracing_interceptor_client.go
+++ b/contrib/rpc/grpcx/internal/tracing/tracing_interceptor_client.go
@@ -19,7 +19,6 @@ import (
"google.golang.org/grpc/status"
"github.com/gogf/gf/contrib/rpc/grpcx/v2/internal/grpcctx"
- "github.com/gogf/gf/contrib/rpc/grpcx/v2/internal/utils"
"github.com/gogf/gf/v2"
"github.com/gogf/gf/v2/net/gtrace"
"github.com/gogf/gf/v2/util/gconv"
@@ -59,25 +58,10 @@ func UnaryClientInterceptor(ctx context.Context, method string, req, reply inter
span.AddEvent(tracingEventGrpcRequest, trace.WithAttributes(
attribute.String(tracingEventGrpcRequestBaggage, gconv.String(gtrace.GetBaggageMap(ctx))),
attribute.String(tracingEventGrpcMetadataOutgoing, gconv.String(grpcctx.Ctx{}.OutgoingMap(ctx))),
- attribute.String(
- tracingEventGrpcRequestMessage,
- utils.MarshalMessageToJsonStringForTracing(
- req, "Request", tracingMaxContentLogSize,
- ),
- ),
))
err := invoker(ctx, method, req, reply, cc, callOpts...)
- span.AddEvent(tracingEventGrpcResponse, trace.WithAttributes(
- attribute.String(
- tracingEventGrpcResponseMessage,
- utils.MarshalMessageToJsonStringForTracing(
- reply, "Response", tracingMaxContentLogSize,
- ),
- ),
- ))
-
if err != nil {
s, _ := status.FromError(err)
span.SetStatus(codes.Error, s.Message())
diff --git a/contrib/rpc/grpcx/internal/tracing/tracing_interceptor_server.go b/contrib/rpc/grpcx/internal/tracing/tracing_interceptor_server.go
index b94d4563e..fe77c6020 100644
--- a/contrib/rpc/grpcx/internal/tracing/tracing_interceptor_server.go
+++ b/contrib/rpc/grpcx/internal/tracing/tracing_interceptor_server.go
@@ -20,7 +20,6 @@ import (
"google.golang.org/grpc/status"
"github.com/gogf/gf/contrib/rpc/grpcx/v2/internal/grpcctx"
- "github.com/gogf/gf/contrib/rpc/grpcx/v2/internal/utils"
"github.com/gogf/gf/v2"
"github.com/gogf/gf/v2/net/gtrace"
"github.com/gogf/gf/v2/util/gconv"
@@ -58,25 +57,10 @@ func UnaryServerInterceptor(ctx context.Context, req interface{}, info *grpc.Una
span.AddEvent(tracingEventGrpcRequest, trace.WithAttributes(
attribute.String(tracingEventGrpcRequestBaggage, gconv.String(gtrace.GetBaggageMap(ctx))),
attribute.String(tracingEventGrpcMetadataIncoming, gconv.String(grpcctx.Ctx{}.IncomingMap(ctx))),
- attribute.String(
- tracingEventGrpcRequestMessage,
- utils.MarshalMessageToJsonStringForTracing(
- req, "Request", tracingMaxContentLogSize,
- ),
- ),
))
res, err := handler(ctx, req)
- span.AddEvent(tracingEventGrpcResponse, trace.WithAttributes(
- attribute.String(
- tracingEventGrpcResponseMessage,
- utils.MarshalMessageToJsonStringForTracing(
- res, "Response", tracingMaxContentLogSize,
- ),
- ),
- ))
-
if err != nil {
s, _ := status.FromError(err)
span.SetStatus(codes.Error, s.Message())
diff --git a/contrib/sdk/httpclient/go.mod b/contrib/sdk/httpclient/go.mod
index f10bbb8ca..ed6e4fa3b 100644
--- a/contrib/sdk/httpclient/go.mod
+++ b/contrib/sdk/httpclient/go.mod
@@ -1,31 +1,32 @@
module github.com/gogf/gf/contrib/sdk/httpclient/v2
-go 1.18
+go 1.20
-require github.com/gogf/gf/v2 v2.7.2
+require github.com/gogf/gf/v2 v2.8.1
require (
- github.com/BurntSushi/toml v1.3.2 // indirect
+ github.com/BurntSushi/toml v1.4.0 // indirect
github.com/clbanning/mxj/v2 v2.7.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
- github.com/fatih/color v1.16.0 // indirect
+ github.com/fatih/color v1.17.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
- github.com/go-logr/logr v1.2.4 // indirect
+ github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
- github.com/gorilla/websocket v1.5.1 // indirect
+ github.com/gorilla/websocket v1.5.3 // indirect
github.com/grokify/html-strip-tags-go v0.1.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
- github.com/rivo/uniseg v0.4.4 // indirect
- go.opentelemetry.io/otel v1.14.0 // indirect
- go.opentelemetry.io/otel/sdk v1.14.0 // indirect
- go.opentelemetry.io/otel/trace v1.14.0 // indirect
- golang.org/x/net v0.24.0 // indirect
- golang.org/x/sys v0.19.0 // indirect
- golang.org/x/text v0.14.0 // indirect
+ github.com/rivo/uniseg v0.4.7 // indirect
+ go.opentelemetry.io/otel v1.24.0 // indirect
+ go.opentelemetry.io/otel/metric v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.24.0 // indirect
+ go.opentelemetry.io/otel/trace v1.24.0 // indirect
+ golang.org/x/net v0.27.0 // indirect
+ golang.org/x/sys v0.22.0 // indirect
+ golang.org/x/text v0.16.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/contrib/sdk/httpclient/go.sum b/contrib/sdk/httpclient/go.sum
index 726644ce5..ae66c9eaa 100644
--- a/contrib/sdk/httpclient/go.sum
+++ b/contrib/sdk/httpclient/go.sum
@@ -1,22 +1,22 @@
-github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
-github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
+github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
+github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/clbanning/mxj/v2 v2.7.0 h1:WA/La7UGCanFe5NpHF0Q3DNtnCsVoxbPKuyBNHWRyME=
github.com/clbanning/mxj/v2 v2.7.0/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
-github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
-github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
+github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
+github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
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/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
+github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
-github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
-github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
-github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
+github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
+github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
+github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grokify/html-strip-tags-go v0.1.0 h1:03UrQLjAny8xci+R+qjCce/MYnpNXCtgzltlQbOBae4=
github.com/grokify/html-strip-tags-go v0.1.0/go.mod h1:ZdzgfHEzAfz9X6Xe5eBLVblWIxXfYSQ40S/VKrAOGpc=
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
@@ -33,23 +33,25 @@ github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
-github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
-github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
-github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
-go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM=
-go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU=
-go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY=
-go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM=
-go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M=
-go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8=
-golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
-golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
+github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
+github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
+github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
+golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
+golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
-golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
-golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
+golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
+golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
+golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
diff --git a/contrib/trace/jaeger/go.mod b/contrib/trace/jaeger/go.mod
deleted file mode 100644
index 22c2e6f4b..000000000
--- a/contrib/trace/jaeger/go.mod
+++ /dev/null
@@ -1,19 +0,0 @@
-module github.com/gogf/gf/contrib/trace/jaeger/v2
-
-go 1.18
-
-require (
- github.com/gogf/gf/v2 v2.7.2
- go.opentelemetry.io/otel v1.14.0
- go.opentelemetry.io/otel/exporters/jaeger v1.14.0
- go.opentelemetry.io/otel/sdk v1.14.0
-)
-
-require (
- github.com/go-logr/logr v1.2.3 // indirect
- github.com/go-logr/stdr v1.2.2 // indirect
- go.opentelemetry.io/otel/trace v1.14.0 // indirect
- golang.org/x/sys v0.19.0 // indirect
-)
-
-replace github.com/gogf/gf/v2 => ../../../
diff --git a/contrib/trace/jaeger/go.sum b/contrib/trace/jaeger/go.sum
deleted file mode 100644
index 6c3f9eb80..000000000
--- a/contrib/trace/jaeger/go.sum
+++ /dev/null
@@ -1,35 +0,0 @@
-github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
-github.com/clbanning/mxj/v2 v2.7.0 h1:WA/La7UGCanFe5NpHF0Q3DNtnCsVoxbPKuyBNHWRyME=
-github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
-github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
-github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
-github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
-github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
-github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0=
-github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
-github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
-github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
-github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
-github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
-github.com/grokify/html-strip-tags-go v0.1.0 h1:03UrQLjAny8xci+R+qjCce/MYnpNXCtgzltlQbOBae4=
-github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
-github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
-github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
-github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=
-github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
-github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
-github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
-github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
-go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM=
-go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU=
-go.opentelemetry.io/otel/exporters/jaeger v1.14.0 h1:CjbUNd4iN2hHmWekmOqZ+zSCU+dzZppG8XsV+A3oc8Q=
-go.opentelemetry.io/otel/exporters/jaeger v1.14.0/go.mod h1:4Ay9kk5vELRrbg5z4cpP9EtmQRFap2Wb0woPG4lujZA=
-go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY=
-go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM=
-go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M=
-go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8=
-golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
-golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
-golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
-gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
diff --git a/contrib/trace/jaeger/jaeger.go b/contrib/trace/jaeger/jaeger.go
deleted file mode 100644
index 3ddb82833..000000000
--- a/contrib/trace/jaeger/jaeger.go
+++ /dev/null
@@ -1,100 +0,0 @@
-// Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
-//
-// This Source Code Form is subject to the terms of the MIT License.
-// If a copy of the MIT was not distributed with this file,
-// You can obtain one at https://github.com/gogf/gf.
-
-// Package jaeger provides OpenTelemetry provider using jaeger.
-//
-// Deprecated:
-// Please use `github.com/gogf/gf/contrib/trace/otlphttp/v2` instead.
-// As dependent package `go.opentelemetry.io/otel/exporters/jaeger` is deprecated in otel,
-// this package will be never be maintained from goframe v2.6.0.
-package jaeger
-
-import (
- "strings"
-
- "go.opentelemetry.io/otel"
- "go.opentelemetry.io/otel/attribute"
- "go.opentelemetry.io/otel/exporters/jaeger"
- "go.opentelemetry.io/otel/sdk/resource"
- "go.opentelemetry.io/otel/sdk/trace"
- semconv "go.opentelemetry.io/otel/semconv/v1.4.0"
-
- "github.com/gogf/gf/v2/errors/gcode"
- "github.com/gogf/gf/v2/errors/gerror"
- "github.com/gogf/gf/v2/net/gipv4"
- "github.com/gogf/gf/v2/text/gregex"
-)
-
-const (
- tracerHostnameTagKey = "hostname"
-)
-
-// Init initializes and registers jaeger to global TracerProvider.
-//
-// The output parameter `flush` is used for waiting exported trace spans to be uploaded,
-// which is useful if your program is ending, and you do not want to lose recent spans.
-func Init(serviceName, endpoint string) (*trace.TracerProvider, error) {
- // Create the Jaeger exporter
- var endpointOption jaeger.EndpointOption
- if strings.HasPrefix(endpoint, "http") {
- // HTTP.
- endpointOption = jaeger.WithCollectorEndpoint(jaeger.WithEndpoint(endpoint))
- } else {
- // UDP.
- match, err := gregex.MatchString(`(.+):(\d+)`, endpoint)
- if err != nil {
- return nil, err
- }
- if len(match) < 3 {
- return nil, gerror.NewCodef(
- gcode.CodeInvalidParameter, `invalid endpoint "%s"`, endpoint,
- )
- }
- var (
- host = match[1]
- port = match[2]
- )
- endpointOption = jaeger.WithAgentEndpoint(
- jaeger.WithAgentHost(host), jaeger.WithAgentPort(port),
- )
- }
- // Try retrieving host ip for tracing info.
- var (
- hostIp = "NoHostIpFound"
- intranetIPArray, err = gipv4.GetIntranetIpArray()
- )
- if err != nil {
- return nil, err
- }
- if len(intranetIPArray) == 0 {
- if intranetIPArray, err = gipv4.GetIpArray(); err != nil {
- return nil, err
- }
- }
- if len(intranetIPArray) > 0 {
- hostIp = intranetIPArray[0]
- }
-
- exp, err := jaeger.New(endpointOption)
- if err != nil {
- return nil, err
- }
- tp := trace.NewTracerProvider(
- // Always be sure to batch in production.
- trace.WithBatcher(exp),
- // Record information about this application in a Resource.
- trace.WithResource(resource.NewWithAttributes(
- semconv.SchemaURL,
- semconv.ServiceNameKey.String(serviceName),
- semconv.HostNameKey.String(hostIp),
- attribute.String(tracerHostnameTagKey, hostIp),
- )),
- )
- // Register our TracerProvider as the global, so any imported
- // instrumentation in the future will default to using it.
- otel.SetTracerProvider(tp)
- return tp, nil
-}
diff --git a/contrib/trace/otlpgrpc/go.mod b/contrib/trace/otlpgrpc/go.mod
index 549cad184..565db9acd 100644
--- a/contrib/trace/otlpgrpc/go.mod
+++ b/contrib/trace/otlpgrpc/go.mod
@@ -1,27 +1,26 @@
module github.com/gogf/gf/contrib/trace/otlpgrpc/v2
-go 1.18
+go 1.20
require (
- github.com/gogf/gf/v2 v2.7.2
- go.opentelemetry.io/otel v1.22.0
- go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0
- go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.22.0
- go.opentelemetry.io/otel/sdk v1.22.0
- google.golang.org/grpc v1.60.1
+ github.com/gogf/gf/v2 v2.8.1
+ go.opentelemetry.io/otel v1.24.0
+ go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0
+ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0
+ go.opentelemetry.io/otel/sdk v1.24.0
+ google.golang.org/grpc v1.64.1
)
require (
- github.com/BurntSushi/toml v1.3.2 // indirect
+ github.com/BurntSushi/toml v1.4.0 // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/clbanning/mxj/v2 v2.7.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
- github.com/fatih/color v1.16.0 // indirect
+ github.com/fatih/color v1.17.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
- github.com/go-logr/logr v1.4.1 // indirect
+ github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
- github.com/golang/protobuf v1.5.3 // indirect
- github.com/gorilla/websocket v1.5.1 // indirect
+ github.com/gorilla/websocket v1.5.3 // indirect
github.com/grokify/html-strip-tags-go v0.1.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
@@ -29,16 +28,16 @@ require (
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
- github.com/rivo/uniseg v0.4.4 // indirect
- go.opentelemetry.io/otel/metric v1.22.0 // indirect
- go.opentelemetry.io/otel/trace v1.22.0 // indirect
+ github.com/rivo/uniseg v0.4.7 // indirect
+ go.opentelemetry.io/otel/metric v1.24.0 // indirect
+ go.opentelemetry.io/otel/trace v1.24.0 // indirect
go.opentelemetry.io/proto/otlp v1.1.0 // indirect
- golang.org/x/net v0.24.0 // indirect
- golang.org/x/sys v0.19.0 // indirect
- golang.org/x/text v0.14.0 // indirect
- google.golang.org/genproto/googleapis/api v0.0.0-20240116215550-a9fa1716bcac // indirect
- google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac // indirect
- google.golang.org/protobuf v1.32.0 // indirect
+ golang.org/x/net v0.27.0 // indirect
+ golang.org/x/sys v0.22.0 // indirect
+ golang.org/x/text v0.16.0 // indirect
+ google.golang.org/genproto/googleapis/api v0.0.0-20240711142825-46eb208f015d // indirect
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect
+ google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/contrib/trace/otlpgrpc/go.sum b/contrib/trace/otlpgrpc/go.sum
index a3c7ee86b..a8b1a5e15 100644
--- a/contrib/trace/otlpgrpc/go.sum
+++ b/contrib/trace/otlpgrpc/go.sum
@@ -1,5 +1,5 @@
-github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
-github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
+github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
+github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/clbanning/mxj/v2 v2.7.0 h1:WA/La7UGCanFe5NpHF0Q3DNtnCsVoxbPKuyBNHWRyME=
@@ -7,22 +7,18 @@ github.com/clbanning/mxj/v2 v2.7.0/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
-github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
-github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
+github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
+github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
-github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
-github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
+github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
+github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
-github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
-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/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
-github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
-github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
+github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
+github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grokify/html-strip-tags-go v0.1.0 h1:03UrQLjAny8xci+R+qjCce/MYnpNXCtgzltlQbOBae4=
github.com/grokify/html-strip-tags-go v0.1.0/go.mod h1:ZdzgfHEzAfz9X6Xe5eBLVblWIxXfYSQ40S/VKrAOGpc=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 h1:Wqo399gCIufwto+VfwCSvsnfGpF/w5E9CNxSwbpD6No=
@@ -43,45 +39,41 @@ github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
-github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
-github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
+github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
+github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
-go.opentelemetry.io/otel v1.22.0 h1:xS7Ku+7yTFvDfDraDIJVpw7XPyuHlB9MCiqqX5mcJ6Y=
-go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0 h1:9M3+rhx7kZCIQQhQRYaZCdNu1V73tm4TvXs2ntl98C4=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0/go.mod h1:noq80iT8rrHP1SfybmPiRGc9dc5M8RPmGvtwo7Oo7tc=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.22.0 h1:H2JFgRcGiyHg7H7bwcwaQJYrNFqCqrbTQ8K4p1OvDu8=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.22.0/go.mod h1:WfCWp1bGoYK8MeULtI15MmQVczfR+bFkk0DF3h06QmQ=
-go.opentelemetry.io/otel/metric v1.22.0 h1:lypMQnGyJYeuYPhOM/bgjbFM6WE44W1/T45er4d8Hhg=
-go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY=
-go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw=
-go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc=
-go.opentelemetry.io/otel/trace v1.22.0 h1:Hg6pPujv0XG9QaVbGOBVHunyuLcCC3jN7WEhPx83XD0=
-go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0 h1:t6wl9SPayj+c7lEIFgm4ooDBZVb01IhLB4InpomhRw8=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0/go.mod h1:iSDOcsnSA5INXzZtwaBPrKp/lWu/V14Dd+llD0oI2EA=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0 h1:Mw5xcxMwlqoJd97vwPxA8isEaIoxsta9/Q51+TTJLGE=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0/go.mod h1:CQNu9bj7o7mC6U7+CA/schKEYakYXWr79ucDHTMGhCM=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
go.opentelemetry.io/proto/otlp v1.1.0 h1:2Di21piLrCqJ3U3eXGCTPHE9R8Nh+0uglSnOyxikMeI=
go.opentelemetry.io/proto/otlp v1.1.0/go.mod h1:GpBHCBWiqvVLDqmHZsoMM3C5ySeKTC7ej/RNTae6MdY=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
-golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
-golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
+golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
+golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
-golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
-golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
-golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917 h1:nz5NESFLZbJGPFxDT/HCn+V1mZ8JGNoY4nUpmW/Y2eg=
-google.golang.org/genproto/googleapis/api v0.0.0-20240116215550-a9fa1716bcac h1:OZkkudMUu9LVQMCoRUbI/1p5VCo9BOrlvkqMvWtqa6s=
-google.golang.org/genproto/googleapis/api v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:B5xPO//w8qmBDjGReYLpR6UJPnkldGkCSMoH/2vxJeg=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac h1:nUQEQmH/csSvFECKYRv6HWEyypysidKl2I6Qpsglq/0=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:daQN87bsDqDoe316QbbvX60nMoJQa4r6Ds0ZuoAe5yA=
-google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU=
-google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM=
-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.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
-google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
+golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
+golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
+golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
+google.golang.org/genproto/googleapis/api v0.0.0-20240711142825-46eb208f015d h1:kHjw/5UfflP/L5EbledDrcG4C2597RtymmGRZvHiCuY=
+google.golang.org/genproto/googleapis/api v0.0.0-20240711142825-46eb208f015d/go.mod h1:mw8MG/Qz5wfgYr6VqVCiZcHe/GJEfI+oGGDCohaVgB0=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 h1:BwIjyKYGsK9dMCBOorzRri8MQwmi7mT9rGHsCEinZkA=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY=
+google.golang.org/grpc v1.64.1 h1:LKtvyfbX3UGVPFcGqJ9ItpVWW6oN/2XqTxfAnwRRXiA=
+google.golang.org/grpc v1.64.1/go.mod h1:hiQF4LFZelK2WKaP6W0L92zGHtiQdZxk8CrSdvyjeP0=
+google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
+google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
diff --git a/contrib/trace/otlpgrpc/otlpgrpc.go b/contrib/trace/otlpgrpc/otlpgrpc.go
index 872d156a6..79de7012a 100644
--- a/contrib/trace/otlpgrpc/otlpgrpc.go
+++ b/contrib/trace/otlpgrpc/otlpgrpc.go
@@ -17,9 +17,9 @@ import (
"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc"
"go.opentelemetry.io/otel/propagation"
"go.opentelemetry.io/otel/sdk/resource"
- sdktrace "go.opentelemetry.io/otel/sdk/trace"
- semconv "go.opentelemetry.io/otel/semconv/v1.20.0"
- "google.golang.org/grpc"
+ "go.opentelemetry.io/otel/sdk/trace"
+ semconv "go.opentelemetry.io/otel/semconv/v1.24.0"
+ "google.golang.org/grpc/encoding/gzip"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/net/gipv4"
@@ -33,7 +33,7 @@ const (
//
// The output parameter `Shutdown` is used for waiting exported trace spans to be uploaded,
// which is useful if your program is ending, and you do not want to lose recent spans.
-func Init(serviceName, endpoint, traceToken string) (func(), error) {
+func Init(serviceName, endpoint, traceToken string) (func(ctx context.Context), error) {
// Try retrieving host ip for tracing info.
var (
intranetIPArray, err = gipv4.GetIntranetIpArray()
@@ -53,13 +53,12 @@ func Init(serviceName, endpoint, traceToken string) (func(), error) {
hostIP = intranetIPArray[0]
}
- traceClient := otlptracegrpc.NewClient(
+ ctx := context.Background()
+ traceExp, err := otlptrace.New(ctx, otlptracegrpc.NewClient(
otlptracegrpc.WithInsecure(),
otlptracegrpc.WithEndpoint(endpoint), // Replace the otel Agent Addr with the access point obtained in the prerequisite。
otlptracegrpc.WithHeaders(map[string]string{"Authentication": traceToken}),
- otlptracegrpc.WithDialOption(grpc.WithBlock()))
- ctx := context.Background()
- traceExp, err := otlptrace.New(ctx, traceClient)
+ otlptracegrpc.WithCompressor(gzip.Name)))
if err != nil {
return nil, err
}
@@ -79,18 +78,26 @@ func Init(serviceName, endpoint, traceToken string) (func(), error) {
return nil, err
}
- bsp := sdktrace.NewBatchSpanProcessor(traceExp)
- tracerProvider := sdktrace.NewTracerProvider(
- sdktrace.WithSampler(sdktrace.AlwaysSample()),
- sdktrace.WithResource(res),
- sdktrace.WithSpanProcessor(bsp),
+ tracerProvider := trace.NewTracerProvider(
+ // AlwaysSample is a sampler that samples every trace.
+ // see: https://pkg.go.dev/go.opentelemetry.io/otel/sdk/trace#AlwaysSample
+ // example see: [example/trace/provider/grpc/main.go](../../../../../example/trace/provider/grpc/main.go#L87)
+ trace.WithSampler(trace.AlwaysSample()),
+ // WithResource returns a trace option that sets the resource to be associated with spans.
+ // see: https://pkg.go.dev/go.opentelemetry.io/otel/sdk/trace#WithResource
+ // example see: [example/trace/provider/grpc/main.go](../../../../../example/trace/provider/grpc/main.go#L36)
+ trace.WithResource(res),
+ // WithSpanProcessor returns a trace option that sets the span processor to be used by the trace provider.
+ // see: https://pkg.go.dev/go.opentelemetry.io/otel/sdk/trace#WithSpanProcessor
+ // example see: [example/trace/provider/grpc/main.go](../../../../../example/trace/provider/grpc/main.go#L99)
+ trace.WithSpanProcessor(trace.NewBatchSpanProcessor(traceExp)),
)
// Set the global propagator to traceContext (not set by default).
- otel.SetTextMapPropagator(propagation.TraceContext{})
+ otel.SetTextMapPropagator(propagation.NewCompositeTextMapPropagator(propagation.TraceContext{}, propagation.Baggage{}))
otel.SetTracerProvider(tracerProvider)
- return func() {
+ return func(ctx context.Context) {
ctx, cancel := context.WithTimeout(ctx, time.Second)
defer cancel()
if err = tracerProvider.Shutdown(ctx); err != nil {
diff --git a/contrib/trace/otlphttp/go.mod b/contrib/trace/otlphttp/go.mod
index 794f02092..6b817b4b6 100644
--- a/contrib/trace/otlphttp/go.mod
+++ b/contrib/trace/otlphttp/go.mod
@@ -1,26 +1,26 @@
module github.com/gogf/gf/contrib/trace/otlphttp/v2
-go 1.18
+go 1.20
require (
- github.com/gogf/gf/v2 v2.7.2
- go.opentelemetry.io/otel v1.22.0
- go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0
- go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.22.0
- go.opentelemetry.io/otel/sdk v1.22.0
+ github.com/gogf/gf/v2 v2.8.1
+ go.opentelemetry.io/otel v1.24.0
+ go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0
+ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0
+ go.opentelemetry.io/otel/sdk v1.24.0
)
require (
- github.com/BurntSushi/toml v1.3.2 // indirect
+ github.com/BurntSushi/toml v1.4.0 // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/clbanning/mxj/v2 v2.7.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
- github.com/fatih/color v1.16.0 // indirect
+ github.com/fatih/color v1.17.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
- github.com/go-logr/logr v1.4.1 // indirect
+ github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
- github.com/gorilla/websocket v1.5.1 // indirect
+ github.com/gorilla/websocket v1.5.3 // indirect
github.com/grokify/html-strip-tags-go v0.1.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
@@ -28,17 +28,17 @@ require (
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
- github.com/rivo/uniseg v0.4.4 // indirect
- go.opentelemetry.io/otel/metric v1.22.0 // indirect
- go.opentelemetry.io/otel/trace v1.22.0 // indirect
+ github.com/rivo/uniseg v0.4.7 // indirect
+ go.opentelemetry.io/otel/metric v1.24.0 // indirect
+ go.opentelemetry.io/otel/trace v1.24.0 // indirect
go.opentelemetry.io/proto/otlp v1.1.0 // indirect
- golang.org/x/net v0.24.0 // indirect
- golang.org/x/sys v0.19.0 // indirect
- golang.org/x/text v0.14.0 // indirect
- google.golang.org/genproto/googleapis/api v0.0.0-20240116215550-a9fa1716bcac // indirect
- google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac // indirect
- google.golang.org/grpc v1.60.1 // indirect
- google.golang.org/protobuf v1.32.0 // indirect
+ golang.org/x/net v0.27.0 // indirect
+ golang.org/x/sys v0.22.0 // indirect
+ golang.org/x/text v0.16.0 // indirect
+ google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917 // indirect
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 // indirect
+ google.golang.org/grpc v1.61.1 // indirect
+ google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/contrib/trace/otlphttp/go.sum b/contrib/trace/otlphttp/go.sum
index 2161434e5..a70b53bcf 100644
--- a/contrib/trace/otlphttp/go.sum
+++ b/contrib/trace/otlphttp/go.sum
@@ -1,5 +1,5 @@
-github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
-github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
+github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
+github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/clbanning/mxj/v2 v2.7.0 h1:WA/La7UGCanFe5NpHF0Q3DNtnCsVoxbPKuyBNHWRyME=
@@ -7,13 +7,13 @@ github.com/clbanning/mxj/v2 v2.7.0/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
-github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
-github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
+github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
+github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
-github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
-github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
+github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
+github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
@@ -21,8 +21,8 @@ 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/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
-github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
-github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
+github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
+github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grokify/html-strip-tags-go v0.1.0 h1:03UrQLjAny8xci+R+qjCce/MYnpNXCtgzltlQbOBae4=
github.com/grokify/html-strip-tags-go v0.1.0/go.mod h1:ZdzgfHEzAfz9X6Xe5eBLVblWIxXfYSQ40S/VKrAOGpc=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 h1:Wqo399gCIufwto+VfwCSvsnfGpF/w5E9CNxSwbpD6No=
@@ -43,44 +43,44 @@ github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
-github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
-github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
+github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
+github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
-go.opentelemetry.io/otel v1.22.0 h1:xS7Ku+7yTFvDfDraDIJVpw7XPyuHlB9MCiqqX5mcJ6Y=
-go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0 h1:9M3+rhx7kZCIQQhQRYaZCdNu1V73tm4TvXs2ntl98C4=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0/go.mod h1:noq80iT8rrHP1SfybmPiRGc9dc5M8RPmGvtwo7Oo7tc=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.22.0 h1:FyjCyI9jVEfqhUh2MoSkmolPjfh5fp2hnV0b0irxH4Q=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.22.0/go.mod h1:hYwym2nDEeZfG/motx0p7L7J1N1vyzIThemQsb4g2qY=
-go.opentelemetry.io/otel/metric v1.22.0 h1:lypMQnGyJYeuYPhOM/bgjbFM6WE44W1/T45er4d8Hhg=
-go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY=
-go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw=
-go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc=
-go.opentelemetry.io/otel/trace v1.22.0 h1:Hg6pPujv0XG9QaVbGOBVHunyuLcCC3jN7WEhPx83XD0=
-go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0 h1:t6wl9SPayj+c7lEIFgm4ooDBZVb01IhLB4InpomhRw8=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0/go.mod h1:iSDOcsnSA5INXzZtwaBPrKp/lWu/V14Dd+llD0oI2EA=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0 h1:Xw8U6u2f8DK2XAkGRFV7BBLENgnTGX9i4rQRxJf+/vs=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0/go.mod h1:6KW1Fm6R/s6Z3PGXwSJN2K4eT6wQB3vXX6CVnYX9NmM=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
go.opentelemetry.io/proto/otlp v1.1.0 h1:2Di21piLrCqJ3U3eXGCTPHE9R8Nh+0uglSnOyxikMeI=
go.opentelemetry.io/proto/otlp v1.1.0/go.mod h1:GpBHCBWiqvVLDqmHZsoMM3C5ySeKTC7ej/RNTae6MdY=
-golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
-golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
+golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
+golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
-golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
-golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
+golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
+golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
+golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917 h1:nz5NESFLZbJGPFxDT/HCn+V1mZ8JGNoY4nUpmW/Y2eg=
-google.golang.org/genproto/googleapis/api v0.0.0-20240116215550-a9fa1716bcac h1:OZkkudMUu9LVQMCoRUbI/1p5VCo9BOrlvkqMvWtqa6s=
-google.golang.org/genproto/googleapis/api v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:B5xPO//w8qmBDjGReYLpR6UJPnkldGkCSMoH/2vxJeg=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac h1:nUQEQmH/csSvFECKYRv6HWEyypysidKl2I6Qpsglq/0=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:daQN87bsDqDoe316QbbvX60nMoJQa4r6Ds0ZuoAe5yA=
-google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU=
-google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM=
+google.golang.org/genproto v0.0.0-20231212172506-995d672761c0 h1:YJ5pD9rF8o9Qtta0Cmy9rdBwkSjrTCT6XTiUQVOtIos=
+google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917 h1:rcS6EyEaoCO52hQDupoSfrxI3R6C2Tq741is7X8OvnM=
+google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917/go.mod h1:CmlNWB9lSezaYELKS5Ym1r44VrrbPUa7JTvw+6MbpJ0=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 h1:6G8oQ016D88m1xAKljMlBOOGWDZkes4kMhgGFlf8WcQ=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917/go.mod h1:xtjpI3tXFPP051KaWnhvxkiubL/6dJ18vLVf7q2pTOU=
+google.golang.org/grpc v1.61.1 h1:kLAiWrZs7YeDM6MumDe7m3y4aM6wacLzM1Y/wiLP9XY=
+google.golang.org/grpc v1.61.1/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs=
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.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
-google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
+google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
+google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
diff --git a/contrib/trace/otlphttp/otlphttp.go b/contrib/trace/otlphttp/otlphttp.go
index 91ac74fd3..2a09b664d 100644
--- a/contrib/trace/otlphttp/otlphttp.go
+++ b/contrib/trace/otlphttp/otlphttp.go
@@ -17,8 +17,8 @@ import (
"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp"
"go.opentelemetry.io/otel/propagation"
"go.opentelemetry.io/otel/sdk/resource"
- sdktrace "go.opentelemetry.io/otel/sdk/trace"
- semconv "go.opentelemetry.io/otel/semconv/v1.20.0"
+ "go.opentelemetry.io/otel/sdk/trace"
+ semconv "go.opentelemetry.io/otel/semconv/v1.24.0"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/net/gipv4"
@@ -32,7 +32,7 @@ const (
//
// The output parameter `Shutdown` is used for waiting exported trace spans to be uploaded,
// which is useful if your program is ending, and you do not want to lose recent spans.
-func Init(serviceName, endpoint, path string) (func(), error) {
+func Init(serviceName, endpoint, path string) (func(ctx context.Context), error) {
// Try retrieving host ip for tracing info.
var (
intranetIPArray, err = gipv4.GetIntranetIpArray()
@@ -52,15 +52,13 @@ func Init(serviceName, endpoint, path string) (func(), error) {
hostIP = intranetIPArray[0]
}
- traceClientHTTP := otlptracehttp.NewClient(
+ ctx := context.Background()
+ traceExp, err := otlptrace.New(ctx, otlptracehttp.NewClient(
otlptracehttp.WithEndpoint(endpoint),
otlptracehttp.WithURLPath(path),
otlptracehttp.WithInsecure(),
otlptracehttp.WithCompression(1),
- )
-
- ctx := context.Background()
- traceExp, err := otlptrace.New(ctx, traceClientHTTP)
+ ))
if err != nil {
return nil, err
}
@@ -77,18 +75,26 @@ func Init(serviceName, endpoint, path string) (func(), error) {
),
)
- bsp := sdktrace.NewBatchSpanProcessor(traceExp)
- tracerProvider := sdktrace.NewTracerProvider(
- sdktrace.WithSampler(sdktrace.AlwaysSample()),
- sdktrace.WithResource(res),
- sdktrace.WithSpanProcessor(bsp),
+ tracerProvider := trace.NewTracerProvider(
+ // AlwaysSample is a sampler that samples every trace.
+ // see: https://pkg.go.dev/go.opentelemetry.io/otel/sdk/trace#AlwaysSample
+ // example see: [example/trace/provider/http/main.go](../../../../../example/trace/provider/http/main.go#L84)
+ trace.WithSampler(trace.AlwaysSample()),
+ // WithResource returns a trace option that sets the resource to be associated with spans.
+ // see: https://pkg.go.dev/go.opentelemetry.io/otel/sdk/trace#WithResource
+ // example see: [example/trace/provider/http/main.go](../../../../../example/trace/provider/http/main.go#L33)
+ trace.WithResource(res),
+ // WithSpanProcessor returns a trace option that sets the span processor to be used by the trace provider.
+ // see: https://pkg.go.dev/go.opentelemetry.io/otel/sdk/trace#WithSpanProcessor
+ // example see: [example/trace/provider/http/main.go](../../../../../example/trace/provider/http/main.go#L96)
+ trace.WithSpanProcessor(trace.NewBatchSpanProcessor(traceExp)),
)
// Set the global propagator to traceContext (not set by default).
- otel.SetTextMapPropagator(propagation.TraceContext{})
+ otel.SetTextMapPropagator(propagation.NewCompositeTextMapPropagator(propagation.TraceContext{}, propagation.Baggage{}))
otel.SetTracerProvider(tracerProvider)
- return func() {
+ return func(ctx context.Context) {
ctx, cancel := context.WithTimeout(ctx, time.Second)
defer cancel()
if err = tracerProvider.Shutdown(ctx); err != nil {
diff --git a/database/gdb/gdb.go b/database/gdb/gdb.go
index 8bffa2636..74d76e5c8 100644
--- a/database/gdb/gdb.go
+++ b/database/gdb/gdb.go
@@ -178,6 +178,7 @@ type DB interface {
ConvertValueForLocal(ctx context.Context, fieldType string, fieldValue interface{}) (interface{}, error) // See Core.ConvertValueForLocal
CheckLocalTypeForField(ctx context.Context, fieldType string, fieldValue interface{}) (LocalType, error) // See Core.CheckLocalTypeForField
FormatUpsert(columns []string, list List, option DoInsertOption) (string, error) // See Core.DoFormatUpsert
+ OrderRandomFunction() string // See Core.OrderRandomFunction
}
// TX defines the interfaces for ORM transaction operations.
@@ -395,12 +396,13 @@ const (
linkPattern = `(\w+):([\w\-\$]*):(.*?)@(\w+?)\((.+?)\)/{0,1}([^\?]*)\?{0,1}(.*)`
)
-type queryType int
+type SelectType int
const (
- queryTypeNormal queryType = iota
- queryTypeCount
- queryTypeValue
+ SelectTypeDefault SelectType = iota
+ SelectTypeCount
+ SelectTypeValue
+ SelectTypeArray
)
type joinOperator string
@@ -446,6 +448,7 @@ type LocalType string
const (
LocalTypeUndefined LocalType = ""
LocalTypeString LocalType = "string"
+ LocalTypeTime LocalType = "time"
LocalTypeDate LocalType = "date"
LocalTypeDatetime LocalType = "datetime"
LocalTypeInt LocalType = "int"
@@ -491,9 +494,11 @@ const (
fieldTypeSmallmoney = "smallmoney"
fieldTypeBool = "bool"
fieldTypeBit = "bit"
- fieldTypeDate = "date"
- fieldTypeDatetime = "datetime"
- fieldTypeTimestamp = "timestamp"
+ fieldTypeYear = "year" // YYYY
+ fieldTypeDate = "date" // YYYY-MM-DD
+ fieldTypeTime = "time" // HH:MM:SS
+ fieldTypeDatetime = "datetime" // YYYY-MM-DD HH:MM:SS
+ fieldTypeTimestamp = "timestamp" // YYYYMMDD HHMMSS
fieldTypeTimestampz = "timestamptz"
fieldTypeJson = "json"
fieldTypeJsonb = "jsonb"
@@ -631,6 +636,8 @@ func Instance(name ...string) (db DB, err error) {
// getConfigNodeByGroup calculates and returns a configuration node of given group. It
// calculates the value internally using weight algorithm for load balance.
//
+// The returned node is a clone of configuration node, which is safe for later modification.
+//
// The parameter `master` specifies whether retrieving a master node, or else a slave node
// if master-slave configured.
func getConfigNodeByGroup(group string, master bool) (*ConfigNode, error) {
@@ -670,6 +677,7 @@ func getConfigNodeByGroup(group string, master bool) (*ConfigNode, error) {
}
// getConfigNodeByWeight calculates the configuration weights and randomly returns a node.
+// The returned node is a clone of configuration node, which is safe for later modification.
//
// Calculation algorithm brief:
// 1. If we have 2 nodes, and their weights are both 1, then the weight range is [0, 199];
@@ -693,13 +701,13 @@ func getConfigNodeByWeight(cg ConfigGroup) *ConfigNode {
}
// Exclude the right border value.
var (
- min = 0
- max = 0
- random = grand.N(0, total-1)
+ minWeight = 0
+ maxWeight = 0
+ random = grand.N(0, total-1)
)
for i := 0; i < len(cg); i++ {
- max = min + cg[i].Weight*100
- if random >= min && random < max {
+ maxWeight = minWeight + cg[i].Weight*100
+ if random >= minWeight && random < maxWeight {
// ====================================================
// Return a COPY of the ConfigNode.
// ====================================================
@@ -707,7 +715,7 @@ func getConfigNodeByWeight(cg ConfigGroup) *ConfigNode {
node = cg[i]
return &node
}
- min = max
+ minWeight = maxWeight
}
return nil
}
@@ -725,6 +733,7 @@ func (c *Core) getSqlDb(master bool, schema ...string) (sqlDb *sql.DB, err error
configs.RLock()
defer configs.RUnlock()
// Value COPY for node.
+ // The returned node is a clone of configuration node, which is safe for later modification.
node, err = getConfigNodeByGroup(c.group, master)
if err != nil {
return nil, err
@@ -773,7 +782,7 @@ func (c *Core) getSqlDb(master bool, schema ...string) (sqlDb *sql.DB, err error
}
return sqlDb
}
- // it here uses node value not pointer as the cache key, in case of oracle ORA-12516 error.
+ // it here uses NODE VALUE not pointer as the cache key, in case of oracle ORA-12516 error.
instanceValue = c.links.GetOrSetFuncLock(*node, instanceCacheFunc)
)
if instanceValue != nil && sqlDb == nil {
diff --git a/database/gdb/gdb_core.go b/database/gdb/gdb_core.go
index a3896c30b..ec14ffd1b 100644
--- a/database/gdb/gdb_core.go
+++ b/database/gdb/gdb_core.go
@@ -278,7 +278,7 @@ func (c *Core) doUnion(ctx context.Context, unionType int, unions ...*Model) *Mo
unionTypeStr = "UNION"
}
for _, v := range unions {
- sqlWithHolder, holderArgs := v.getFormattedSqlAndArgs(ctx, queryTypeNormal, false)
+ sqlWithHolder, holderArgs := v.getFormattedSqlAndArgs(ctx, SelectTypeDefault, false)
if composedSqlStr == "" {
composedSqlStr += fmt.Sprintf(`(%s)`, sqlWithHolder)
} else {
@@ -697,7 +697,7 @@ func (c *Core) FilteredLink() string {
//
// Note that this interface implements mainly for workaround for a json infinite loop bug
// of Golang version < v1.14.
-func (c Core) MarshalJSON() ([]byte, error) {
+func (c *Core) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`%+v`, c)), nil
}
diff --git a/database/gdb/gdb_core_config.go b/database/gdb/gdb_core_config.go
index d649f8998..fdec90f2e 100644
--- a/database/gdb/gdb_core_config.go
+++ b/database/gdb/gdb_core_config.go
@@ -276,12 +276,18 @@ func parseConfigNodeLink(node *ConfigNode) *ConfigNode {
node.Pass = match[3]
node.Protocol = match[4]
array := gstr.Split(match[5], ":")
- if len(array) == 2 && node.Protocol != "file" {
- node.Host = array[0]
- node.Port = array[1]
- node.Name = match[6]
- } else {
+ if node.Protocol == "file" {
node.Name = match[5]
+ } else {
+ if len(array) == 2 {
+ // link with port.
+ node.Host = array[0]
+ node.Port = array[1]
+ } else {
+ // link without port.
+ node.Host = array[0]
+ }
+ node.Name = match[6]
}
if len(match) > 6 && match[7] != "" {
node.Extra = match[7]
diff --git a/database/gdb/gdb_core_structure.go b/database/gdb/gdb_core_structure.go
index 852c7aa58..bbb9df757 100644
--- a/database/gdb/gdb_core_structure.go
+++ b/database/gdb/gdb_core_structure.go
@@ -28,7 +28,19 @@ import (
func (c *Core) GetFieldTypeStr(ctx context.Context, fieldName, table, schema string) string {
field := c.GetFieldType(ctx, fieldName, table, schema)
if field != nil {
- return field.Type
+ // Kinds of data type examples:
+ // year(4)
+ // datetime
+ // varchar(64)
+ // bigint(20)
+ // int(10) unsigned
+ typeName := gstr.StrTillEx(field.Type, "(") // int(10) unsigned -> int
+ if typeName != "" {
+ typeName = gstr.Trim(typeName)
+ } else {
+ typeName = field.Type
+ }
+ return typeName
}
return ""
}
@@ -63,9 +75,10 @@ func (c *Core) ConvertDataForRecord(ctx context.Context, value interface{}, tabl
data = MapOrStructToMapDeep(value, true)
)
for fieldName, fieldValue := range data {
+ var fieldType = c.GetFieldTypeStr(ctx, fieldName, table, c.GetSchema())
data[fieldName], err = c.db.ConvertValueForField(
ctx,
- c.GetFieldTypeStr(ctx, fieldName, table, c.GetSchema()),
+ fieldType,
fieldValue,
)
if err != nil {
@@ -83,6 +96,10 @@ func (c *Core) ConvertValueForField(ctx context.Context, fieldType string, field
err error
convertedValue = fieldValue
)
+ switch fieldValue.(type) {
+ case time.Time, *time.Time, gtime.Time, *gtime.Time:
+ goto Default
+ }
// If `value` implements interface `driver.Valuer`, it then uses the interface for value converting.
if valuer, ok := fieldValue.(driver.Valuer); ok {
if convertedValue, err = valuer.Value(); err != nil {
@@ -90,6 +107,7 @@ func (c *Core) ConvertValueForField(ctx context.Context, fieldType string, field
}
return convertedValue, nil
}
+Default:
// Default value converting.
var (
rvValue = reflect.ValueOf(fieldValue)
@@ -100,6 +118,9 @@ func (c *Core) ConvertValueForField(ctx context.Context, fieldType string, field
rvKind = rvValue.Kind()
}
switch rvKind {
+ case reflect.Invalid:
+ convertedValue = nil
+
case reflect.Slice, reflect.Array, reflect.Map:
// It should ignore the bytes type.
if _, ok := fieldValue.([]byte); !ok {
@@ -109,7 +130,6 @@ func (c *Core) ConvertValueForField(ctx context.Context, fieldType string, field
return nil, err
}
}
-
case reflect.Struct:
switch r := fieldValue.(type) {
// If the time is zero, it then updates it to nil,
@@ -117,25 +137,65 @@ func (c *Core) ConvertValueForField(ctx context.Context, fieldType string, field
case time.Time:
if r.IsZero() {
convertedValue = nil
+ } else {
+ switch fieldType {
+ case fieldTypeYear:
+ convertedValue = r.Format("2006")
+ case fieldTypeDate:
+ convertedValue = r.Format("2006-01-02")
+ case fieldTypeTime:
+ convertedValue = r.Format("15:04:05")
+ default:
+ }
+ }
+
+ case *time.Time:
+ if r == nil {
+ // Nothing to do.
+ } else {
+ switch fieldType {
+ case fieldTypeYear:
+ convertedValue = r.Format("2006")
+ case fieldTypeDate:
+ convertedValue = r.Format("2006-01-02")
+ case fieldTypeTime:
+ convertedValue = r.Format("15:04:05")
+ default:
+ }
}
case gtime.Time:
if r.IsZero() {
convertedValue = nil
} else {
- convertedValue = r.Time
+ switch fieldType {
+ case fieldTypeYear:
+ convertedValue = r.Layout("2006")
+ case fieldTypeDate:
+ convertedValue = r.Layout("2006-01-02")
+ case fieldTypeTime:
+ convertedValue = r.Layout("15:04:05")
+ default:
+ convertedValue = r.Time
+ }
}
case *gtime.Time:
if r.IsZero() {
convertedValue = nil
} else {
- convertedValue = r.Time
+ switch fieldType {
+ case fieldTypeYear:
+ convertedValue = r.Layout("2006")
+ case fieldTypeDate:
+ convertedValue = r.Layout("2006-01-02")
+ case fieldTypeTime:
+ convertedValue = r.Layout("15:04:05")
+ default:
+ convertedValue = r.Time
+ }
}
- case *time.Time:
- // Nothing to do.
-
case Counter, *Counter:
// Nothing to do.
@@ -156,7 +216,9 @@ func (c *Core) ConvertValueForField(ctx context.Context, fieldType string, field
}
}
}
+ default:
}
+
return convertedValue, nil
}
@@ -247,6 +309,10 @@ func (c *Core) CheckLocalTypeForField(ctx context.Context, fieldType string, fie
fieldTypeDate:
return LocalTypeDate, nil
+ case
+ fieldTypeTime:
+ return LocalTypeTime, nil
+
case
fieldTypeDatetime,
fieldTypeTimestamp,
@@ -353,13 +419,19 @@ func (c *Core) ConvertValueForLocal(
return gconv.Bool(fieldValue), nil
case LocalTypeDate:
- // Date without time.
if t, ok := fieldValue.(time.Time); ok {
return gtime.NewFromTime(t).Format("Y-m-d"), nil
}
t, _ := gtime.StrToTime(gconv.String(fieldValue))
return t.Format("Y-m-d"), nil
+ case LocalTypeTime:
+ if t, ok := fieldValue.(time.Time); ok {
+ return gtime.NewFromTime(t).Format("H:i:s"), nil
+ }
+ t, _ := gtime.StrToTime(gconv.String(fieldValue))
+ return t.Format("H:i:s"), nil
+
case LocalTypeDatetime:
if t, ok := fieldValue.(time.Time); ok {
return gtime.NewFromTime(t), nil
diff --git a/database/gdb/gdb_core_underlying.go b/database/gdb/gdb_core_underlying.go
index dec32513a..dbdc59eb3 100644
--- a/database/gdb/gdb_core_underlying.go
+++ b/database/gdb/gdb_core_underlying.go
@@ -53,7 +53,9 @@ func (c *Core) DoQuery(ctx context.Context, link Link, sql string, args ...inter
}
if c.db.GetConfig().QueryTimeout > 0 {
- ctx, _ = context.WithTimeout(ctx, c.db.GetConfig().QueryTimeout)
+ var cancelFunc context.CancelFunc
+ ctx, cancelFunc = context.WithTimeout(ctx, c.db.GetConfig().QueryTimeout)
+ defer cancelFunc()
}
// Sql filtering.
@@ -83,6 +85,9 @@ func (c *Core) DoQuery(ctx context.Context, link Link, sql string, args ...inter
Type: SqlTypeQueryContext,
IsTransaction: link.IsTransaction(),
})
+ if err != nil {
+ return nil, err
+ }
return out.Records, err
}
@@ -144,13 +149,18 @@ func (c *Core) DoExec(ctx context.Context, link Link, sql string, args ...interf
Type: SqlTypeExecContext,
IsTransaction: link.IsTransaction(),
})
+ if err != nil {
+ return nil, err
+ }
return out.Result, err
}
// DoFilter is a hook function, which filters the sql and its arguments before it's committed to underlying driver.
// The parameter `link` specifies the current database connection operation object. You can modify the sql
// string `sql` and its arguments `args` as you wish before they're committed to driver.
-func (c *Core) DoFilter(ctx context.Context, link Link, sql string, args []interface{}) (newSql string, newArgs []interface{}, err error) {
+func (c *Core) DoFilter(
+ ctx context.Context, link Link, sql string, args []interface{},
+) (newSql string, newArgs []interface{}, err error) {
return sql, args, nil
}
@@ -322,7 +332,6 @@ func (c *Core) DoPrepare(ctx context.Context, link Link, sql string) (stmt *Stmt
link = &txLink{tx.GetSqlTX()}
} else {
// Or else it creates one from master node.
- var err error
if link, err = c.MasterLink(); err != nil {
return nil, err
}
@@ -336,7 +345,9 @@ func (c *Core) DoPrepare(ctx context.Context, link Link, sql string) (stmt *Stmt
if c.db.GetConfig().PrepareTimeout > 0 {
// DO NOT USE cancel function in prepare statement.
- ctx, _ = context.WithTimeout(ctx, c.db.GetConfig().PrepareTimeout)
+ var cancelFunc context.CancelFunc
+ ctx, cancelFunc = context.WithTimeout(ctx, c.db.GetConfig().PrepareTimeout)
+ defer cancelFunc()
}
// Link execution.
@@ -347,6 +358,9 @@ func (c *Core) DoPrepare(ctx context.Context, link Link, sql string) (stmt *Stmt
Type: SqlTypePrepareContext,
IsTransaction: link.IsTransaction(),
})
+ if err != nil {
+ return nil, err
+ }
return out.Stmt, err
}
@@ -379,7 +393,7 @@ func (c *Core) FormatUpsert(columns []string, list List, option DoInsertOption)
}
} else {
for _, column := range columns {
- // If it's SAVE operation, do not automatically update the creating time.
+ // If it's `SAVE` operation, do not automatically update the creating time.
if c.IsSoftCreatedFieldName(column) {
continue
}
@@ -455,6 +469,11 @@ func (c *Core) RowsToResult(ctx context.Context, rows *sql.Rows) (Result, error)
return result, nil
}
+// OrderRandomFunction returns the SQL function for random ordering.
+func (c *Core) OrderRandomFunction() string {
+ return "RAND()"
+}
+
func (c *Core) columnValueToLocalValue(ctx context.Context, value interface{}, columnType *sql.ColumnType) (interface{}, error) {
var scanType = columnType.ScanType()
if scanType != nil {
@@ -469,6 +488,7 @@ func (c *Core) columnValueToLocalValue(ctx context.Context, value interface{}, c
gconv.String(value),
columnType.ScanType().String(),
), nil
+ default:
}
}
// Other complex types, especially custom types.
diff --git a/database/gdb/gdb_func.go b/database/gdb/gdb_func.go
index 38e0d5b4c..752710d1c 100644
--- a/database/gdb/gdb_func.go
+++ b/database/gdb/gdb_func.go
@@ -344,8 +344,8 @@ func doQuoteString(s, charLeft, charRight string) string {
return gstr.Join(array1, ",")
}
-func getFieldsFromStructOrMap(structOrMap interface{}) (fields []string) {
- fields = []string{}
+func getFieldsFromStructOrMap(structOrMap any) (fields []any) {
+ fields = []any{}
if utils.IsStruct(structOrMap) {
structFields, _ := gstructs.Fields(gstructs.FieldsInput{
Pointer: structOrMap,
@@ -362,7 +362,7 @@ func getFieldsFromStructOrMap(structOrMap interface{}) (fields []string) {
}
}
} else {
- fields = gutil.Keys(structOrMap)
+ fields = gconv.Interfaces(gutil.Keys(structOrMap))
}
return
}
@@ -777,11 +777,7 @@ func formatWhereKeyValue(in formatWhereKeyValueInput) (newArgs []interface{}) {
} else {
in.Buffer.WriteString(quotedKey)
}
- if s, ok := in.Value.(Raw); ok {
- in.Buffer.WriteString(gconv.String(s))
- } else {
- in.Args = append(in.Args, in.Value)
- }
+ in.Args = append(in.Args, in.Value)
}
}
return in.Args
diff --git a/database/gdb/gdb_model.go b/database/gdb/gdb_model.go
index ab9cf4317..beaa51500 100644
--- a/database/gdb/gdb_model.go
+++ b/database/gdb/gdb_model.go
@@ -24,8 +24,8 @@ type Model struct {
linkType int // Mark for operation on master or slave.
tablesInit string // Table names when model initialization.
tables string // Operation table names, which can be more than one table names and aliases, like: "user", "user u", "user u, user_detail ud".
- fields string // Operation fields, multiple fields joined using char ','.
- fieldsEx string // Excluded operation fields, multiple fields joined using char ','.
+ fields []any // Operation fields, multiple fields joined using char ','.
+ fieldsEx []any // Excluded operation fields, it here uses slice instead of string type for quick filtering.
withArray []interface{} // Arguments for With feature.
withAll bool // Enable model association operations on all objects that have "with" tag in the struct.
extraArgs []interface{} // Extra custom arguments for sql, which are prepended to the arguments before sql committed to underlying driver.
@@ -65,7 +65,7 @@ type ChunkHandler func(result Result, err error) bool
const (
linkTypeMaster = 1
linkTypeSlave = 2
- defaultFields = "*"
+ defaultField = "*"
whereHolderOperatorWhere = 1
whereHolderOperatorAnd = 2
whereHolderOperatorOr = 3
@@ -132,7 +132,6 @@ func (c *Core) Model(tableNameQueryOrStruct ...interface{}) *Model {
schema: c.schema,
tablesInit: tableStr,
tables: tableStr,
- fields: defaultFields,
start: -1,
offset: -1,
filter: true,
@@ -281,6 +280,14 @@ func (m *Model) Clone() *Model {
newModel.whereBuilder = m.whereBuilder.Clone()
newModel.whereBuilder.model = newModel
// Shallow copy slice attributes.
+ if n := len(m.fields); n > 0 {
+ newModel.fields = make([]any, n)
+ copy(newModel.fields, m.fields)
+ }
+ if n := len(m.fieldsEx); n > 0 {
+ newModel.fieldsEx = make([]any, n)
+ copy(newModel.fieldsEx, m.fieldsEx)
+ }
if n := len(m.extraArgs); n > 0 {
newModel.extraArgs = make([]interface{}, n)
copy(newModel.extraArgs, m.extraArgs)
@@ -289,6 +296,10 @@ func (m *Model) Clone() *Model {
newModel.withArray = make([]interface{}, n)
copy(newModel.withArray, m.withArray)
}
+ if n := len(m.having); n > 0 {
+ newModel.having = make([]interface{}, n)
+ copy(newModel.having, m.having)
+ }
return newModel
}
diff --git a/database/gdb/gdb_model_cache.go b/database/gdb/gdb_model_cache.go
index c1b6ca820..76592cdec 100644
--- a/database/gdb/gdb_model_cache.go
+++ b/database/gdb/gdb_model_cache.go
@@ -90,7 +90,7 @@ func (m *Model) getSelectResultFromCache(ctx context.Context, sql string, args .
}
func (m *Model) saveSelectResultToCache(
- ctx context.Context, queryType queryType, result Result, sql string, args ...interface{},
+ ctx context.Context, selectType SelectType, result Result, sql string, args ...interface{},
) (err error) {
if !m.cacheEnabled || m.tx != nil {
return
@@ -108,18 +108,19 @@ func (m *Model) saveSelectResultToCache(
// Special handler for Value/Count operations result.
if len(result) > 0 {
var core = m.db.GetCore()
- switch queryType {
- case queryTypeValue, queryTypeCount:
+ switch selectType {
+ case SelectTypeValue, SelectTypeArray, SelectTypeCount:
if internalData := core.getInternalColumnFromCtx(ctx); internalData != nil {
if result[0][internalData.FirstResultColumn].IsEmpty() {
result = nil
}
}
+ default:
}
}
// In case of Cache Penetration.
- if result.IsEmpty() {
+ if result != nil && result.IsEmpty() {
if m.cacheOption.Force {
result = Result{}
} else {
diff --git a/database/gdb/gdb_model_fields.go b/database/gdb/gdb_model_fields.go
index c9e29a3f8..9f7e2cc7c 100644
--- a/database/gdb/gdb_model_fields.go
+++ b/database/gdb/gdb_model_fields.go
@@ -10,6 +10,7 @@ import (
"fmt"
"github.com/gogf/gf/v2/container/gset"
+ "github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/text/gstr"
"github.com/gogf/gf/v2/util/gconv"
)
@@ -17,31 +18,38 @@ import (
// Fields appends `fieldNamesOrMapStruct` to the operation fields of the model, multiple fields joined using char ','.
// The parameter `fieldNamesOrMapStruct` can be type of string/map/*map/struct/*struct.
//
-// Eg:
+// Example:
// Fields("id", "name", "age")
// Fields([]string{"id", "name", "age"})
// Fields(map[string]interface{}{"id":1, "name":"john", "age":18})
-// Fields(User{ Id: 1, Name: "john", Age: 18}).
+// Fields(User{Id: 1, Name: "john", Age: 18}).
func (m *Model) Fields(fieldNamesOrMapStruct ...interface{}) *Model {
length := len(fieldNamesOrMapStruct)
if length == 0 {
return m
}
- fields := m.getFieldsFrom(m.tablesInit, fieldNamesOrMapStruct...)
+ fields := m.filterFieldsFrom(m.tablesInit, fieldNamesOrMapStruct...)
if len(fields) == 0 {
return m
}
- return m.appendFieldsByStr(gstr.Join(fields, ","))
+ model := m.getModel()
+ return model.appendToFields(fields...)
}
// FieldsPrefix performs as function Fields but add extra prefix for each field.
func (m *Model) FieldsPrefix(prefixOrAlias string, fieldNamesOrMapStruct ...interface{}) *Model {
- fields := m.getFieldsFrom(m.getTableNameByPrefixOrAlias(prefixOrAlias), fieldNamesOrMapStruct...)
+ fields := m.filterFieldsFrom(
+ m.getTableNameByPrefixOrAlias(prefixOrAlias),
+ fieldNamesOrMapStruct...,
+ )
if len(fields) == 0 {
return m
}
- gstr.PrefixArray(fields, prefixOrAlias+".")
- return m.appendFieldsByStr(gstr.Join(fields, ","))
+ for i, field := range fields {
+ fields[i] = prefixOrAlias + "." + gconv.String(field)
+ }
+ model := m.getModel()
+ return model.appendToFields(fields...)
}
// FieldsEx appends `fieldNamesOrMapStruct` to the excluded operation fields of the model,
@@ -49,28 +57,38 @@ func (m *Model) FieldsPrefix(prefixOrAlias string, fieldNamesOrMapStruct ...inte
// Note that this function supports only single table operations.
// The parameter `fieldNamesOrMapStruct` can be type of string/map/*map/struct/*struct.
//
-// Also see Fields.
+// Example:
+// FieldsEx("id", "name", "age")
+// FieldsEx([]string{"id", "name", "age"})
+// FieldsEx(map[string]interface{}{"id":1, "name":"john", "age":18})
+// FieldsEx(User{Id: 1, Name: "john", Age: 18}).
func (m *Model) FieldsEx(fieldNamesOrMapStruct ...interface{}) *Model {
return m.doFieldsEx(m.tablesInit, fieldNamesOrMapStruct...)
}
+
func (m *Model) doFieldsEx(table string, fieldNamesOrMapStruct ...interface{}) *Model {
length := len(fieldNamesOrMapStruct)
if length == 0 {
return m
}
- fields := m.getFieldsFrom(table, fieldNamesOrMapStruct...)
+ fields := m.filterFieldsFrom(table, fieldNamesOrMapStruct...)
if len(fields) == 0 {
return m
}
- return m.appendFieldsExByStr(gstr.Join(fields, ","))
+ model := m.getModel()
+ model.fieldsEx = append(model.fieldsEx, fields...)
+ return model
}
// FieldsExPrefix performs as function FieldsEx but add extra prefix for each field.
func (m *Model) FieldsExPrefix(prefixOrAlias string, fieldNamesOrMapStruct ...interface{}) *Model {
- model := m.doFieldsEx(m.getTableNameByPrefixOrAlias(prefixOrAlias), fieldNamesOrMapStruct...)
- array := gstr.SplitAndTrim(model.fieldsEx, ",")
- gstr.PrefixArray(array, prefixOrAlias+".")
- model.fieldsEx = gstr.Join(array, ",")
+ model := m.doFieldsEx(
+ m.getTableNameByPrefixOrAlias(prefixOrAlias),
+ fieldNamesOrMapStruct...,
+ )
+ for i, field := range model.fieldsEx {
+ model.fieldsEx[i] = prefixOrAlias + "." + gconv.String(field)
+ }
return model
}
@@ -80,7 +98,10 @@ func (m *Model) FieldCount(column string, as ...string) *Model {
if len(as) > 0 && as[0] != "" {
asStr = fmt.Sprintf(` AS %s`, m.db.GetCore().QuoteWord(as[0]))
}
- return m.appendFieldsByStr(fmt.Sprintf(`COUNT(%s)%s`, m.QuoteWord(column), asStr))
+ model := m.getModel()
+ return model.appendToFields(
+ fmt.Sprintf(`COUNT(%s)%s`, m.QuoteWord(column), asStr),
+ )
}
// FieldSum formats and appends commonly used field `SUM(column)` to the select fields of model.
@@ -89,7 +110,10 @@ func (m *Model) FieldSum(column string, as ...string) *Model {
if len(as) > 0 && as[0] != "" {
asStr = fmt.Sprintf(` AS %s`, m.db.GetCore().QuoteWord(as[0]))
}
- return m.appendFieldsByStr(fmt.Sprintf(`SUM(%s)%s`, m.QuoteWord(column), asStr))
+ model := m.getModel()
+ return model.appendToFields(
+ fmt.Sprintf(`SUM(%s)%s`, m.QuoteWord(column), asStr),
+ )
}
// FieldMin formats and appends commonly used field `MIN(column)` to the select fields of model.
@@ -98,7 +122,10 @@ func (m *Model) FieldMin(column string, as ...string) *Model {
if len(as) > 0 && as[0] != "" {
asStr = fmt.Sprintf(` AS %s`, m.db.GetCore().QuoteWord(as[0]))
}
- return m.appendFieldsByStr(fmt.Sprintf(`MIN(%s)%s`, m.QuoteWord(column), asStr))
+ model := m.getModel()
+ return model.appendToFields(
+ fmt.Sprintf(`MIN(%s)%s`, m.QuoteWord(column), asStr),
+ )
}
// FieldMax formats and appends commonly used field `MAX(column)` to the select fields of model.
@@ -107,7 +134,10 @@ func (m *Model) FieldMax(column string, as ...string) *Model {
if len(as) > 0 && as[0] != "" {
asStr = fmt.Sprintf(` AS %s`, m.db.GetCore().QuoteWord(as[0]))
}
- return m.appendFieldsByStr(fmt.Sprintf(`MAX(%s)%s`, m.QuoteWord(column), asStr))
+ model := m.getModel()
+ return model.appendToFields(
+ fmt.Sprintf(`MAX(%s)%s`, m.QuoteWord(column), asStr),
+ )
}
// FieldAvg formats and appends commonly used field `AVG(column)` to the select fields of model.
@@ -116,7 +146,10 @@ func (m *Model) FieldAvg(column string, as ...string) *Model {
if len(as) > 0 && as[0] != "" {
asStr = fmt.Sprintf(` AS %s`, m.db.GetCore().QuoteWord(as[0]))
}
- return m.appendFieldsByStr(fmt.Sprintf(`AVG(%s)%s`, m.QuoteWord(column), asStr))
+ model := m.getModel()
+ return model.appendToFields(
+ fmt.Sprintf(`AVG(%s)%s`, m.QuoteWord(column), asStr),
+ )
}
// GetFieldsStr retrieves and returns all fields from the table, joined with char ','.
@@ -152,17 +185,17 @@ func (m *Model) GetFieldsStr(prefix ...string) string {
// joined with char ','.
// The parameter `fields` specifies the fields that are excluded.
// The optional parameter `prefix` specifies the prefix for each field, eg: FieldsExStr("id", "u.").
-func (m *Model) GetFieldsExStr(fields string, prefix ...string) string {
+func (m *Model) GetFieldsExStr(fields string, prefix ...string) (string, error) {
prefixStr := ""
if len(prefix) > 0 {
prefixStr = prefix[0]
}
tableFields, err := m.TableFields(m.tablesInit)
if err != nil {
- panic(err)
+ return "", err
}
if len(tableFields) == 0 {
- panic(fmt.Sprintf(`empty table fields for table "%s"`, m.tables))
+ return "", gerror.Newf(`empty table fields for table "%s"`, m.tables)
}
fieldsExSet := gset.NewStrSetFrom(gstr.SplitAndTrim(fields, ","))
fieldsArray := make([]string, len(tableFields))
@@ -180,7 +213,7 @@ func (m *Model) GetFieldsExStr(fields string, prefix ...string) string {
newFields += prefixStr + k
}
newFields = m.db.GetCore().QuoteString(newFields)
- return newFields
+ return newFields, nil
}
// HasField determine whether the field exists in the table.
@@ -189,7 +222,7 @@ func (m *Model) HasField(field string) (bool, error) {
}
// getFieldsFrom retrieves, filters and returns fields name from table `table`.
-func (m *Model) getFieldsFrom(table string, fieldNamesOrMapStruct ...interface{}) []string {
+func (m *Model) filterFieldsFrom(table string, fieldNamesOrMapStruct ...any) []any {
length := len(fieldNamesOrMapStruct)
if length == 0 {
return nil
@@ -198,7 +231,7 @@ func (m *Model) getFieldsFrom(table string, fieldNamesOrMapStruct ...interface{}
// String slice.
case length >= 2:
return m.mappingAndFilterToTableFields(
- table, gconv.Strings(fieldNamesOrMapStruct), true,
+ table, fieldNamesOrMapStruct, true,
)
// It needs type asserting.
@@ -206,13 +239,13 @@ func (m *Model) getFieldsFrom(table string, fieldNamesOrMapStruct ...interface{}
structOrMap := fieldNamesOrMapStruct[0]
switch r := structOrMap.(type) {
case string:
- return m.mappingAndFilterToTableFields(table, []string{r}, false)
+ return m.mappingAndFilterToTableFields(table, []any{r}, false)
case []string:
- return m.mappingAndFilterToTableFields(table, r, true)
+ return m.mappingAndFilterToTableFields(table, gconv.Interfaces(r), true)
case Raw, *Raw:
- return []string{gconv.String(structOrMap)}
+ return []any{structOrMap}
default:
return m.mappingAndFilterToTableFields(table, getFieldsFromStructOrMap(structOrMap), true)
@@ -223,29 +256,20 @@ func (m *Model) getFieldsFrom(table string, fieldNamesOrMapStruct ...interface{}
}
}
-func (m *Model) appendFieldsByStr(fields string) *Model {
- if fields != "" {
- model := m.getModel()
- if model.fields == defaultFields {
- model.fields = ""
- }
- if model.fields != "" {
- model.fields += ","
- }
- model.fields += fields
- return model
+func (m *Model) appendToFields(fields ...any) *Model {
+ if len(fields) == 0 {
+ return m
}
- return m
+ model := m.getModel()
+ model.fields = append(model.fields, fields...)
+ return model
}
-func (m *Model) appendFieldsExByStr(fieldsEx string) *Model {
- if fieldsEx != "" {
- model := m.getModel()
- if model.fieldsEx != "" {
- model.fieldsEx += ","
+func (m *Model) isFieldInFieldsEx(field string) bool {
+ for _, v := range m.fieldsEx {
+ if v == field {
+ return true
}
- model.fieldsEx += fieldsEx
- return model
}
- return m
+ return false
}
diff --git a/database/gdb/gdb_model_hook.go b/database/gdb/gdb_model_hook.go
index 7dd007405..3428990a7 100644
--- a/database/gdb/gdb_model_hook.go
+++ b/database/gdb/gdb_model_hook.go
@@ -66,11 +66,12 @@ type internalParamHookDelete struct {
// which is usually not be interesting for upper business hook handler.
type HookSelectInput struct {
internalParamHookSelect
- Model *Model // Current operation Model.
- Table string // The table name that to be used. Update this attribute to change target table name.
- Schema string // The schema name that to be used. Update this attribute to change target schema name.
- Sql string // The sql string that to be committed.
- Args []interface{} // The arguments of sql.
+ Model *Model // Current operation Model.
+ Table string // The table name that to be used. Update this attribute to change target table name.
+ Schema string // The schema name that to be used. Update this attribute to change target schema name.
+ Sql string // The sql string that to be committed.
+ Args []interface{} // The arguments of sql.
+ SelectType SelectType // The type of this SELECT operation.
}
// HookInsertInput holds the parameters for insert hook operation.
diff --git a/database/gdb/gdb_model_insert.go b/database/gdb/gdb_model_insert.go
index 798b355ae..fad1728ac 100644
--- a/database/gdb/gdb_model_insert.go
+++ b/database/gdb/gdb_model_insert.go
@@ -45,11 +45,11 @@ func (m *Model) Data(data ...interface{}) *Model {
model.data = s
model.extraArgs = data[1:]
} else {
- m := make(map[string]interface{})
+ newData := make(map[string]interface{})
for i := 0; i < len(data); i += 2 {
- m[gconv.String(data[i])] = data[i+1]
+ newData[gconv.String(data[i])] = data[i+1]
}
- model.data = m
+ model.data = newData
}
} else if len(data) == 1 {
switch value := data[0].(type) {
@@ -285,7 +285,14 @@ func (m *Model) doInsertWithOption(ctx context.Context, insertOption InsertOptio
}
// Automatic handling for creating/updating time.
- if !m.unscoped && (fieldNameCreate != "" || fieldNameUpdate != "") {
+ if fieldNameCreate != "" && m.isFieldInFieldsEx(fieldNameCreate) {
+ fieldNameCreate = ""
+ }
+ if fieldNameUpdate != "" && m.isFieldInFieldsEx(fieldNameUpdate) {
+ fieldNameUpdate = ""
+ }
+ var isSoftTimeFeatureEnabled = fieldNameCreate != "" || fieldNameUpdate != ""
+ if !m.unscoped && isSoftTimeFeatureEnabled {
for k, v := range list {
if fieldNameCreate != "" && empty.IsNil(v[fieldNameCreate]) {
fieldCreateValue := stm.GetValueByFieldTypeForCreateOrUpdate(ctx, fieldTypeCreate, false)
@@ -299,6 +306,7 @@ func (m *Model) doInsertWithOption(ctx context.Context, insertOption InsertOptio
v[fieldNameUpdate] = fieldUpdateValue
}
}
+ // for timestamp field that should initialize the delete_at field with value, for example 0.
if fieldNameDelete != "" && empty.IsNil(v[fieldNameDelete]) {
fieldDeleteValue := stm.GetValueByFieldTypeForCreateOrUpdate(ctx, fieldTypeDelete, true)
if fieldDeleteValue != nil {
diff --git a/database/gdb/gdb_model_order_group.go b/database/gdb/gdb_model_order_group.go
index 8e25c14da..664dcf540 100644
--- a/database/gdb/gdb_model_order_group.go
+++ b/database/gdb/gdb_model_order_group.go
@@ -15,28 +15,42 @@ import (
// Order sets the "ORDER BY" statement for the model.
//
-// Eg:
+// Example:
// Order("id desc")
-// Order("id", "desc").
+// Order("id", "desc")
// Order("id desc,name asc")
+// Order("id desc", "name asc")
// Order("id desc").Order("name asc")
// Order(gdb.Raw("field(id, 3,1,2)")).
func (m *Model) Order(orderBy ...interface{}) *Model {
if len(orderBy) == 0 {
return m
}
- model := m.getModel()
- if model.orderBy != "" {
- model.orderBy += ","
- }
+ var (
+ core = m.db.GetCore()
+ model = m.getModel()
+ )
for _, v := range orderBy {
+ if model.orderBy != "" {
+ model.orderBy += ","
+ }
switch v.(type) {
case Raw, *Raw:
model.orderBy += gconv.String(v)
- return model
+ default:
+ orderByStr := gconv.String(v)
+ if gstr.Contains(orderByStr, " ") {
+ model.orderBy += core.QuoteString(orderByStr)
+ } else {
+ if gstr.Equal(orderByStr, "ASC") || gstr.Equal(orderByStr, "DESC") {
+ model.orderBy = gstr.TrimRight(model.orderBy, ",")
+ model.orderBy += " " + orderByStr
+ } else {
+ model.orderBy += core.QuoteWord(orderByStr)
+ }
+ }
}
}
- model.orderBy += model.db.GetCore().QuoteString(gstr.JoinAny(orderBy, " "))
return model
}
@@ -59,7 +73,7 @@ func (m *Model) OrderDesc(column string) *Model {
// OrderRandom sets the "ORDER BY RANDOM()" statement for the model.
func (m *Model) OrderRandom() *Model {
model := m.getModel()
- model.orderBy = "RAND()"
+ model.orderBy = m.db.OrderRandomFunction()
return model
}
@@ -68,10 +82,14 @@ func (m *Model) Group(groupBy ...string) *Model {
if len(groupBy) == 0 {
return m
}
- model := m.getModel()
+ var (
+ core = m.db.GetCore()
+ model = m.getModel()
+ )
+
if model.groupBy != "" {
model.groupBy += ","
}
- model.groupBy += model.db.GetCore().QuoteString(strings.Join(groupBy, ","))
+ model.groupBy += core.QuoteString(strings.Join(groupBy, ","))
return model
}
diff --git a/database/gdb/gdb_model_select.go b/database/gdb/gdb_model_select.go
index 975ca6dc4..8c6433abf 100644
--- a/database/gdb/gdb_model_select.go
+++ b/database/gdb/gdb_model_select.go
@@ -12,6 +12,7 @@ import (
"reflect"
"github.com/gogf/gf/v2/container/gset"
+ "github.com/gogf/gf/v2/encoding/gjson"
"github.com/gogf/gf/v2/errors/gcode"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/internal/reflection"
@@ -27,7 +28,7 @@ import (
// see Model.Where.
func (m *Model) All(where ...interface{}) (Result, error) {
var ctx = m.GetCtx()
- return m.doGetAll(ctx, false, where...)
+ return m.doGetAll(ctx, SelectTypeDefault, false, where...)
}
// AllAndCount retrieves all records and the total count of records from the model.
@@ -53,7 +54,7 @@ func (m *Model) AllAndCount(useFieldForCount bool) (result Result, totalCount in
// If useFieldForCount is false, set the fields to a constant value of 1 for counting
if !useFieldForCount {
- countModel.fields = "1"
+ countModel.fields = []any{Raw("1")}
}
// Get the total count of records
@@ -68,7 +69,7 @@ func (m *Model) AllAndCount(useFieldForCount bool) (result Result, totalCount in
}
// Retrieve all records
- result, err = m.doGetAll(m.GetCtx(), false)
+ result, err = m.doGetAll(m.GetCtx(), SelectTypeDefault, false)
return
}
@@ -109,7 +110,7 @@ func (m *Model) One(where ...interface{}) (Record, error) {
if len(where) > 0 {
return m.Where(where[0], where[1:]...).One()
}
- all, err := m.doGetAll(ctx, true)
+ all, err := m.doGetAll(ctx, SelectTypeDefault, true)
if err != nil {
return nil, err
}
@@ -135,24 +136,42 @@ func (m *Model) Array(fieldsAndWhere ...interface{}) ([]Value, error) {
return m.Fields(gconv.String(fieldsAndWhere[0])).Array()
}
}
- all, err := m.All()
- if err != nil {
- return nil, err
- }
+
var (
field string
core = m.db.GetCore()
ctx = core.injectInternalColumn(m.GetCtx())
)
+ all, err := m.doGetAll(ctx, SelectTypeArray, false)
+ if err != nil {
+ return nil, err
+ }
if len(all) > 0 {
- if internalData := core.getInternalColumnFromCtx(ctx); internalData != nil {
- field = internalData.FirstResultColumn
- } else {
+ internalData := core.getInternalColumnFromCtx(ctx)
+ if internalData == nil {
return nil, gerror.NewCode(
gcode.CodeInternalError,
- `query array error: the internal context data is missing. there's internal issue should be fixed`,
+ `query count error: the internal context data is missing. there's internal issue should be fixed`,
)
}
+ // If FirstResultColumn present, it returns the value of the first record of the first field.
+ // It means it use no cache mechanism, while cache mechanism makes `internalData` missing.
+ field = internalData.FirstResultColumn
+ if field == "" {
+ // Fields number check.
+ var recordFields = m.getRecordFields(all[0])
+ if len(recordFields) == 1 {
+ field = recordFields[0]
+ } else {
+ // it returns error if there are multiple fields in the result record.
+ return nil, gerror.NewCodef(
+ gcode.CodeInvalidParameter,
+ `invalid fields for "Array" operation, result fields number "%d"%s, but expect one`,
+ len(recordFields),
+ gjson.MustEncodeString(recordFields),
+ )
+ }
+ }
}
return all.Array(field), nil
}
@@ -176,7 +195,7 @@ func (m *Model) Array(fieldsAndWhere ...interface{}) ([]Value, error) {
func (m *Model) doStruct(pointer interface{}, where ...interface{}) error {
model := m
// Auto selecting fields by struct attributes.
- if model.fieldsEx == "" && (model.fields == "" || model.fields == "*") {
+ if len(model.fieldsEx) == 0 && len(model.fields) == 0 {
if v, ok := pointer.(reflect.Value); ok {
model = m.Fields(v.Interface())
} else {
@@ -212,7 +231,7 @@ func (m *Model) doStruct(pointer interface{}, where ...interface{}) error {
func (m *Model) doStructs(pointer interface{}, where ...interface{}) error {
model := m
// Auto selecting fields by struct attributes.
- if model.fieldsEx == "" && (model.fields == "" || model.fields == "*") {
+ if len(model.fieldsEx) == 0 && len(model.fields) == 0 {
if v, ok := pointer.(reflect.Value); ok {
model = m.Fields(
reflect.New(
@@ -281,10 +300,12 @@ func (m *Model) Scan(pointer interface{}, where ...interface{}) error {
}
}
-// ScanAndCount scans a single record or record array that matches the given conditions and counts the total number of records that match those conditions.
-// If useFieldForCount is true, it will use the fields specified in the model for counting;
-// The pointer parameter is a pointer to a struct that the scanned data will be stored in.
-// The pointerCount parameter is a pointer to an integer that will be set to the total number of records that match the given conditions.
+// ScanAndCount scans a single record or record array that matches the given conditions and counts the total number
+// of records that match those conditions.
+//
+// If `useFieldForCount` is true, it will use the fields specified in the model for counting;
+// The `pointer` parameter is a pointer to a struct that the scanned data will be stored in.
+// The `totalCount` parameter is a pointer to an integer that will be set to the total number of records that match the given conditions.
// The where parameter is an optional list of conditions to use when retrieving records.
//
// Example:
@@ -314,7 +335,7 @@ func (m *Model) ScanAndCount(pointer interface{}, totalCount *int, useFieldForCo
countModel := m.Clone()
// If useFieldForCount is false, set the fields to a constant value of 1 for counting
if !useFieldForCount {
- countModel.fields = "1"
+ countModel.fields = []any{Raw("1")}
}
// Get the total count of records
@@ -341,7 +362,7 @@ func (m *Model) ScanList(structSlicePointer interface{}, bindToAttrName string,
if err != nil {
return err
}
- if m.fields != defaultFields || m.fieldsEx != "" {
+ if len(m.fields) > 0 || len(m.fieldsEx) != 0 {
// There are custom fields.
result, err = m.All()
} else {
@@ -394,27 +415,54 @@ func (m *Model) Value(fieldsAndWhere ...interface{}) (Value, error) {
}
}
var (
- sqlWithHolder, holderArgs = m.getFormattedSqlAndArgs(ctx, queryTypeValue, true)
- all, err = m.doGetAllBySql(ctx, queryTypeValue, sqlWithHolder, holderArgs...)
+ sqlWithHolder, holderArgs = m.getFormattedSqlAndArgs(ctx, SelectTypeValue, true)
+ all, err = m.doGetAllBySql(ctx, SelectTypeValue, sqlWithHolder, holderArgs...)
)
if err != nil {
return nil, err
}
if len(all) > 0 {
- if internalData := core.getInternalColumnFromCtx(ctx); internalData != nil {
- if v, ok := all[0][internalData.FirstResultColumn]; ok {
- return v, nil
- }
- } else {
+ internalData := core.getInternalColumnFromCtx(ctx)
+ if internalData == nil {
return nil, gerror.NewCode(
gcode.CodeInternalError,
- `query value error: the internal context data is missing. there's internal issue should be fixed`,
+ `query count error: the internal context data is missing. there's internal issue should be fixed`,
)
}
+ // If FirstResultColumn present, it returns the value of the first record of the first field.
+ // It means it use no cache mechanism, while cache mechanism makes `internalData` missing.
+ if v, ok := all[0][internalData.FirstResultColumn]; ok {
+ return v, nil
+ }
+ // Fields number check.
+ var recordFields = m.getRecordFields(all[0])
+ if len(recordFields) == 1 {
+ for _, v := range all[0] {
+ return v, nil
+ }
+ }
+ // it returns error if there are multiple fields in the result record.
+ return nil, gerror.NewCodef(
+ gcode.CodeInvalidParameter,
+ `invalid fields for "Value" operation, result fields number "%d"%s, but expect one`,
+ len(recordFields),
+ gjson.MustEncodeString(recordFields),
+ )
}
return nil, nil
}
+func (m *Model) getRecordFields(record Record) []string {
+ if len(record) == 0 {
+ return nil
+ }
+ var fields = make([]string, 0)
+ for k := range record {
+ fields = append(fields, k)
+ }
+ return fields
+}
+
// Count does "SELECT COUNT(x) FROM ..." statement for the model.
// The optional parameter `where` is the same as the parameter of Model.Where function,
// see Model.Where.
@@ -427,27 +475,62 @@ func (m *Model) Count(where ...interface{}) (int, error) {
return m.Where(where[0], where[1:]...).Count()
}
var (
- sqlWithHolder, holderArgs = m.getFormattedSqlAndArgs(ctx, queryTypeCount, false)
- all, err = m.doGetAllBySql(ctx, queryTypeCount, sqlWithHolder, holderArgs...)
+ sqlWithHolder, holderArgs = m.getFormattedSqlAndArgs(ctx, SelectTypeCount, false)
+ all, err = m.doGetAllBySql(ctx, SelectTypeCount, sqlWithHolder, holderArgs...)
)
if err != nil {
return 0, err
}
if len(all) > 0 {
- if internalData := core.getInternalColumnFromCtx(ctx); internalData != nil {
- if v, ok := all[0][internalData.FirstResultColumn]; ok {
- return v.Int(), nil
- }
- } else {
+ internalData := core.getInternalColumnFromCtx(ctx)
+ if internalData == nil {
return 0, gerror.NewCode(
gcode.CodeInternalError,
`query count error: the internal context data is missing. there's internal issue should be fixed`,
)
}
+ // If FirstResultColumn present, it returns the value of the first record of the first field.
+ // It means it use no cache mechanism, while cache mechanism makes `internalData` missing.
+ if v, ok := all[0][internalData.FirstResultColumn]; ok {
+ return v.Int(), nil
+ }
+ // Fields number check.
+ var recordFields = m.getRecordFields(all[0])
+ if len(recordFields) == 1 {
+ for _, v := range all[0] {
+ return v.Int(), nil
+ }
+ }
+ // it returns error if there are multiple fields in the result record.
+ return 0, gerror.NewCodef(
+ gcode.CodeInvalidParameter,
+ `invalid fields for "Count" operation, result fields number "%d"%s, but expect one`,
+ len(recordFields),
+ gjson.MustEncodeString(recordFields),
+ )
}
return 0, nil
}
+// Exist does "SELECT 1 FROM ... LIMIT 1" statement for the model.
+// The optional parameter `where` is the same as the parameter of Model.Where function,
+// see Model.Where.
+func (m *Model) Exist(where ...interface{}) (bool, error) {
+ if len(where) > 0 {
+ return m.Where(where[0], where[1:]...).Exist()
+ }
+ one, err := m.Fields(Raw("1")).One()
+ if err != nil {
+ return false, err
+ }
+ for _, val := range one {
+ if val.Bool() {
+ return true, nil
+ }
+ }
+ return false, nil
+}
+
// CountColumn does "SELECT COUNT(x) FROM ..." statement for the model.
func (m *Model) CountColumn(column string) (int, error) {
if len(column) == 0 {
@@ -576,16 +659,18 @@ func (m *Model) Having(having interface{}, args ...interface{}) *Model {
// The parameter `limit1` specifies whether limits querying only one record if m.limit is not set.
// The optional parameter `where` is the same as the parameter of Model.Where function,
// see Model.Where.
-func (m *Model) doGetAll(ctx context.Context, limit1 bool, where ...interface{}) (Result, error) {
+func (m *Model) doGetAll(ctx context.Context, selectType SelectType, limit1 bool, where ...interface{}) (Result, error) {
if len(where) > 0 {
return m.Where(where[0], where[1:]...).All()
}
- sqlWithHolder, holderArgs := m.getFormattedSqlAndArgs(ctx, queryTypeNormal, limit1)
- return m.doGetAllBySql(ctx, queryTypeNormal, sqlWithHolder, holderArgs...)
+ sqlWithHolder, holderArgs := m.getFormattedSqlAndArgs(ctx, selectType, limit1)
+ return m.doGetAllBySql(ctx, selectType, sqlWithHolder, holderArgs...)
}
// doGetAllBySql does the select statement on the database.
-func (m *Model) doGetAllBySql(ctx context.Context, queryType queryType, sql string, args ...interface{}) (result Result, err error) {
+func (m *Model) doGetAllBySql(
+ ctx context.Context, selectType SelectType, sql string, args ...interface{},
+) (result Result, err error) {
if result, err = m.getSelectResultFromCache(ctx, sql, args...); err != nil || result != nil {
return
}
@@ -597,29 +682,30 @@ func (m *Model) doGetAllBySql(ctx context.Context, queryType queryType, sql stri
},
handler: m.hookHandler.Select,
},
- Model: m,
- Table: m.tables,
- Sql: sql,
- Args: m.mergeArguments(args),
+ Model: m,
+ Table: m.tables,
+ Sql: sql,
+ Args: m.mergeArguments(args),
+ SelectType: selectType,
}
if result, err = in.Next(ctx); err != nil {
return
}
- err = m.saveSelectResultToCache(ctx, queryType, result, sql, args...)
+ err = m.saveSelectResultToCache(ctx, selectType, result, sql, args...)
return
}
func (m *Model) getFormattedSqlAndArgs(
- ctx context.Context, queryType queryType, limit1 bool,
+ ctx context.Context, selectType SelectType, limit1 bool,
) (sqlWithHolder string, holderArgs []interface{}) {
- switch queryType {
- case queryTypeCount:
+ switch selectType {
+ case SelectTypeCount:
queryFields := "COUNT(1)"
- if m.fields != "" && m.fields != "*" {
+ if len(m.fields) > 0 {
// DO NOT quote the m.fields here, in case of fields like:
// DISTINCT t.user_id uid
- queryFields = fmt.Sprintf(`COUNT(%s%s)`, m.distinct, m.fields)
+ queryFields = fmt.Sprintf(`COUNT(%s%s)`, m.distinct, m.getFieldsAsStr())
}
// Raw SQL Model.
if m.rawSql != "" {
@@ -656,7 +742,7 @@ func (m *Model) getFormattedSqlAndArgs(
func (m *Model) getHolderAndArgsAsSubModel(ctx context.Context) (holder string, args []interface{}) {
holder, args = m.getFormattedSqlAndArgs(
- ctx, queryTypeNormal, false,
+ ctx, SelectTypeDefault, false,
)
args = m.mergeArguments(args)
return
@@ -672,29 +758,50 @@ func (m *Model) getAutoPrefix() string {
return autoPrefix
}
+func (m *Model) getFieldsAsStr() string {
+ var (
+ fieldsStr string
+ core = m.db.GetCore()
+ )
+ for _, v := range m.fields {
+ field := gconv.String(v)
+ switch {
+ case gstr.ContainsAny(field, "()"):
+ case gstr.ContainsAny(field, ". "):
+ default:
+ switch v.(type) {
+ case Raw, *Raw:
+ default:
+ field = core.QuoteString(field)
+ }
+ }
+ if fieldsStr != "" {
+ fieldsStr += ","
+ }
+ fieldsStr += field
+ }
+ return fieldsStr
+}
+
// getFieldsFiltered checks the fields and fieldsEx attributes, filters and returns the fields that will
// really be committed to underlying database driver.
func (m *Model) getFieldsFiltered() string {
- if m.fieldsEx == "" {
- // No filtering, containing special chars.
- if gstr.ContainsAny(m.fields, "()") {
- return m.fields
- }
- // No filtering.
- if !gstr.ContainsAny(m.fields, ". ") {
- return m.db.GetCore().QuoteString(m.fields)
- }
- return m.fields
+ if len(m.fieldsEx) == 0 && len(m.fields) == 0 {
+ return defaultField
+ }
+ if len(m.fieldsEx) == 0 && len(m.fields) > 0 {
+ return m.getFieldsAsStr()
}
var (
fieldsArray []string
- fieldsExSet = gset.NewStrSetFrom(gstr.SplitAndTrim(m.fieldsEx, ","))
+ fieldsExSet = gset.NewStrSetFrom(gconv.Strings(m.fieldsEx))
)
- if m.fields != "*" {
+ if len(m.fields) > 0 {
// Filter custom fields with fieldEx.
fieldsArray = make([]string, 0, 8)
- for _, v := range gstr.SplitAndTrim(m.fields, ",") {
- fieldsArray = append(fieldsArray, v[gstr.PosR(v, "-")+1:])
+ for _, v := range m.fields {
+ field := gconv.String(v)
+ fieldsArray = append(fieldsArray, field[gstr.PosR(field, "-")+1:])
}
} else {
if gstr.Contains(m.tables, " ") {
diff --git a/database/gdb/gdb_model_soft_time.go b/database/gdb/gdb_model_soft_time.go
index c2817d12a..73e155275 100644
--- a/database/gdb/gdb_model_soft_time.go
+++ b/database/gdb/gdb_model_soft_time.go
@@ -15,12 +15,11 @@ import (
"github.com/gogf/gf/v2/errors/gcode"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/internal/intlog"
+ "github.com/gogf/gf/v2/internal/utils"
"github.com/gogf/gf/v2/os/gcache"
"github.com/gogf/gf/v2/os/gtime"
"github.com/gogf/gf/v2/text/gregex"
"github.com/gogf/gf/v2/text/gstr"
- "github.com/gogf/gf/v2/util/gconv"
- "github.com/gogf/gf/v2/util/gutil"
)
// SoftTimeType custom defines the soft time field type.
@@ -184,7 +183,7 @@ func (m *softTimeMaintainer) GetFieldNameAndTypeForDelete(
)
}
-// getSoftFieldName retrieves and returns the field name of the table for possible key.
+// getSoftFieldNameAndType retrieves and returns the field name of the table for possible key.
func (m *softTimeMaintainer) getSoftFieldNameAndType(
ctx context.Context,
schema string, table string, checkFiledNames []string,
@@ -206,9 +205,7 @@ func (m *softTimeMaintainer) getSoftFieldNameAndType(
return nil, nil
}
for _, checkFiledName := range checkFiledNames {
- fieldName, _ = gutil.MapPossibleItemByKey(
- gconv.Map(fieldsMap), checkFiledName,
- )
+ fieldName = searchFieldNameFromMap(fieldsMap, checkFiledName)
if fieldName != "" {
fieldType, _ = m.db.CheckLocalTypeForField(
ctx, fieldsMap[fieldName].Type, nil,
@@ -238,6 +235,23 @@ func (m *softTimeMaintainer) getSoftFieldNameAndType(
return
}
+func searchFieldNameFromMap(fieldsMap map[string]*TableField, key string) string {
+ if len(fieldsMap) == 0 {
+ return ""
+ }
+ _, ok := fieldsMap[key]
+ if ok {
+ return key
+ }
+ key = utils.RemoveSymbols(key)
+ for k := range fieldsMap {
+ if strings.EqualFold(utils.RemoveSymbols(k), key) {
+ return k
+ }
+ }
+ return ""
+}
+
// GetWhereConditionForDelete retrieves and returns the condition string for soft deleting.
// It supports multiple tables string like:
// "user u, user_detail ud"
@@ -339,7 +353,7 @@ func (m *softTimeMaintainer) getConditionByFieldNameAndTypeForSoftDeleting(
switch m.softTimeOption.SoftTimeType {
case SoftTimeTypeAuto:
switch fieldType {
- case LocalTypeDate, LocalTypeDatetime:
+ case LocalTypeDate, LocalTypeTime, LocalTypeDatetime:
return fmt.Sprintf(`%s IS NULL`, quotedFieldName)
case LocalTypeInt, LocalTypeUint, LocalTypeInt64, LocalTypeUint64, LocalTypeBool:
return fmt.Sprintf(`%s=0`, quotedFieldName)
@@ -368,7 +382,7 @@ func (m *softTimeMaintainer) GetValueByFieldTypeForCreateOrUpdate(
var value any
if isDeletedField {
switch fieldType {
- case LocalTypeDate, LocalTypeDatetime:
+ case LocalTypeDate, LocalTypeTime, LocalTypeDatetime:
value = nil
default:
value = 0
@@ -378,7 +392,7 @@ func (m *softTimeMaintainer) GetValueByFieldTypeForCreateOrUpdate(
switch m.softTimeOption.SoftTimeType {
case SoftTimeTypeAuto:
switch fieldType {
- case LocalTypeDate, LocalTypeDatetime:
+ case LocalTypeDate, LocalTypeTime, LocalTypeDatetime:
value = gtime.Now()
case LocalTypeInt, LocalTypeUint, LocalTypeInt64, LocalTypeUint64:
value = gtime.Timestamp()
diff --git a/database/gdb/gdb_model_update.go b/database/gdb/gdb_model_update.go
index 2d14e558d..44c04d8e6 100644
--- a/database/gdb/gdb_model_update.go
+++ b/database/gdb/gdb_model_update.go
@@ -54,7 +54,7 @@ func (m *Model) Update(dataAndWhere ...interface{}) (result sql.Result, err erro
ctx, "", m.tablesInit,
)
)
- if m.unscoped {
+ if fieldNameUpdate != "" && (m.unscoped || m.isFieldInFieldsEx(fieldNameUpdate)) {
fieldNameUpdate = ""
}
diff --git a/database/gdb/gdb_model_utility.go b/database/gdb/gdb_model_utility.go
index 9a5da8522..79fe878ac 100644
--- a/database/gdb/gdb_model_utility.go
+++ b/database/gdb/gdb_model_utility.go
@@ -14,6 +14,7 @@ import (
"github.com/gogf/gf/v2/os/gtime"
"github.com/gogf/gf/v2/text/gregex"
"github.com/gogf/gf/v2/text/gstr"
+ "github.com/gogf/gf/v2/util/gconv"
"github.com/gogf/gf/v2/util/gutil"
)
@@ -52,7 +53,7 @@ func (m *Model) getModel() *Model {
// Eg:
// ID -> id
// NICK_Name -> nickname.
-func (m *Model) mappingAndFilterToTableFields(table string, fields []string, filter bool) []string {
+func (m *Model) mappingAndFilterToTableFields(table string, fields []any, filter bool) []any {
var fieldsTable = table
if fieldsTable != "" {
hasTable, _ := m.db.GetCore().HasTable(fieldsTable)
@@ -68,18 +69,24 @@ func (m *Model) mappingAndFilterToTableFields(table string, fields []string, fil
if len(fieldsMap) == 0 {
return fields
}
- var outputFieldsArray = make([]string, 0)
+ var outputFieldsArray = make([]any, 0)
fieldsKeyMap := make(map[string]interface{}, len(fieldsMap))
for k := range fieldsMap {
fieldsKeyMap[k] = nil
}
for _, field := range fields {
- var inputFieldsArray []string
- if gregex.IsMatchString(regularFieldNameWithoutDotRegPattern, field) {
- inputFieldsArray = append(inputFieldsArray, field)
- } else if gregex.IsMatchString(regularFieldNameWithCommaRegPattern, field) {
- inputFieldsArray = gstr.SplitAndTrim(field, ",")
- } else {
+ var (
+ fieldStr = gconv.String(field)
+ inputFieldsArray []string
+ )
+ switch {
+ case gregex.IsMatchString(regularFieldNameWithoutDotRegPattern, fieldStr):
+ inputFieldsArray = append(inputFieldsArray, fieldStr)
+
+ case gregex.IsMatchString(regularFieldNameWithCommaRegPattern, fieldStr):
+ inputFieldsArray = gstr.SplitAndTrim(fieldStr, ",")
+
+ default:
// Example:
// user.id, user.name
// replace(concat_ws(',',lpad(s.id, 6, '0'),s.name),',','') `code`
@@ -186,26 +193,26 @@ func (m *Model) doMappingAndFilterForInsertOrUpdateDataMap(data Map, allowOmitEm
data = tempMap
}
- if len(m.fields) > 0 && m.fields != "*" {
+ if len(m.fields) > 0 {
// Keep specified fields.
var (
- set = gset.NewStrSetFrom(gstr.SplitAndTrim(m.fields, ","))
+ fieldSet = gset.NewStrSetFrom(gconv.Strings(m.fields))
charL, charR = m.db.GetChars()
chars = charL + charR
)
- set.Walk(func(item string) string {
+ fieldSet.Walk(func(item string) string {
return gstr.Trim(item, chars)
})
for k := range data {
k = gstr.Trim(k, chars)
- if !set.Contains(k) {
+ if !fieldSet.Contains(k) {
delete(data, k)
}
}
} else if len(m.fieldsEx) > 0 {
// Filter specified fields.
- for _, v := range gstr.SplitAndTrim(m.fieldsEx, ",") {
- delete(data, v)
+ for _, v := range m.fieldsEx {
+ delete(data, gconv.String(v))
}
}
return data, nil
diff --git a/database/gdb/gdb_model_with.go b/database/gdb/gdb_model_with.go
index e259d1186..1bef5a60f 100644
--- a/database/gdb/gdb_model_with.go
+++ b/database/gdb/gdb_model_with.go
@@ -67,6 +67,9 @@ func (m *Model) WithAll() *Model {
// doWithScanStruct handles model association operations feature for single struct.
func (m *Model) doWithScanStruct(pointer interface{}) error {
+ if len(m.withArray) == 0 && m.withAll == false {
+ return nil
+ }
var (
err error
allowedTypeStrArray = make([]string, 0)
@@ -183,6 +186,9 @@ func (m *Model) doWithScanStruct(pointer interface{}) error {
// doWithScanStructs handles model association operations feature for struct slice.
// Also see doWithScanStruct.
func (m *Model) doWithScanStructs(pointer interface{}) error {
+ if len(m.withArray) == 0 && m.withAll == false {
+ return nil
+ }
if v, ok := pointer.(reflect.Value); ok {
pointer = v.Interface()
}
@@ -312,7 +318,7 @@ func (m *Model) parseWithTagInFieldStruct(field gstructs.Field) (output parseWit
array []string
key string
)
- for _, v := range gstr.SplitAndTrim(ormTag, " ") {
+ for _, v := range gstr.SplitAndTrim(ormTag, ",") {
array = gstr.Split(v, ":")
if len(array) == 2 {
key = array[0]
@@ -321,9 +327,6 @@ func (m *Model) parseWithTagInFieldStruct(field gstructs.Field) (output parseWit
data[key] += " " + gstr.Trim(v)
}
}
- for k, v := range data {
- data[k] = gstr.TrimRight(v, ",")
- }
output.With = data[OrmTagForWith]
output.Where = data[OrmTagForWithWhere]
output.Order = data[OrmTagForWithOrder]
diff --git a/database/gdb/gdb_z_mysql_internal_test.go b/database/gdb/gdb_z_mysql_internal_test.go
index abf82b6a1..a2428dbee 100644
--- a/database/gdb/gdb_z_mysql_internal_test.go
+++ b/database/gdb/gdb_z_mysql_internal_test.go
@@ -232,6 +232,38 @@ func Test_parseConfigNodeLink_WithType(t *testing.T) {
t.Assert(newNode.Charset, defaultCharset)
t.Assert(newNode.Protocol, `tcp`)
})
+ // https://github.com/gogf/gf/issues/3755
+ gtest.C(t, func(t *gtest.T) {
+ node := &ConfigNode{
+ Link: "mysql:user:pwd@tcp(rdsid.mysql.rds.aliyuncs.com)/dbname?charset=utf8&loc=Local",
+ }
+ newNode := parseConfigNodeLink(node)
+ t.Assert(newNode.Type, `mysql`)
+ t.Assert(newNode.User, `user`)
+ t.Assert(newNode.Pass, `pwd`)
+ t.Assert(newNode.Host, `rdsid.mysql.rds.aliyuncs.com`)
+ t.Assert(newNode.Port, ``)
+ t.Assert(newNode.Name, `dbname`)
+ t.Assert(newNode.Extra, `charset=utf8&loc=Local`)
+ t.Assert(newNode.Charset, `utf8`)
+ t.Assert(newNode.Protocol, `tcp`)
+ })
+ // https://github.com/gogf/gf/issues/3862
+ gtest.C(t, func(t *gtest.T) {
+ node := &ConfigNode{
+ Link: "mysql:username:password@unix(/tmp/mysql.sock)/dbname",
+ }
+ newNode := parseConfigNodeLink(node)
+ t.Assert(newNode.Type, `mysql`)
+ t.Assert(newNode.User, `username`)
+ t.Assert(newNode.Pass, `password`)
+ t.Assert(newNode.Host, `/tmp/mysql.sock`)
+ t.Assert(newNode.Port, ``)
+ t.Assert(newNode.Name, `dbname`)
+ t.Assert(newNode.Extra, ``)
+ t.Assert(newNode.Charset, `utf8`)
+ t.Assert(newNode.Protocol, `unix`)
+ })
}
func Test_Func_doQuoteWord(t *testing.T) {
diff --git a/database/gredis/gredis_redis.go b/database/gredis/gredis_redis.go
index 04d72b472..5b24be32d 100644
--- a/database/gredis/gredis_redis.go
+++ b/database/gredis/gredis_redis.go
@@ -12,7 +12,6 @@ import (
"github.com/gogf/gf/v2/container/gvar"
"github.com/gogf/gf/v2/errors/gcode"
"github.com/gogf/gf/v2/errors/gerror"
- "github.com/gogf/gf/v2/text/gstr"
)
// Redis client.
@@ -48,12 +47,7 @@ const (
errorNilRedis = `the Redis object is nil`
)
-var (
- errorNilAdapter = gstr.Trim(gstr.Replace(`
-redis adapter is not set, missing configuration or adapter register?
-possible reference: https://github.com/gogf/gf/tree/master/contrib/nosql/redis
-`, "\n", ""))
-)
+const errorNilAdapter = `redis adapter is not set, missing configuration or adapter register? possible reference: https://github.com/gogf/gf/tree/master/contrib/nosql/redis`
// initGroup initializes the group object of redis.
func (r *Redis) initGroup() *Redis {
diff --git a/debug/gdebug/gdebug_caller.go b/debug/gdebug/gdebug_caller.go
index d02ff4ab8..e5863e25f 100644
--- a/debug/gdebug/gdebug_caller.go
+++ b/debug/gdebug/gdebug_caller.go
@@ -133,16 +133,25 @@ func filterFileByFilters(file string, filters []string) (filtered bool) {
// CallerPackage returns the package name of the caller.
func CallerPackage() string {
function, _, _ := Caller()
+ // it defines a new internal function to retrieve the package name from caller function name,
+ // which is for unit testing purpose for core logic of this function.
+ return getPackageFromCallerFunction(function)
+}
+
+func getPackageFromCallerFunction(function string) string {
indexSplit := strings.LastIndexByte(function, '/')
if indexSplit == -1 {
return function[:strings.IndexByte(function, '.')]
- } else {
- leftPart := function[:indexSplit+1]
- rightPart := function[indexSplit+1:]
- indexDot := strings.IndexByte(function, '.')
- rightPart = rightPart[:indexDot-1]
- return leftPart + rightPart
}
+ var (
+ leftPart = function[:indexSplit+1]
+ rightPart = function[indexSplit+1:]
+ indexDot = strings.IndexByte(rightPart, '.')
+ )
+ if indexDot >= 0 {
+ rightPart = rightPart[:indexDot]
+ }
+ return leftPart + rightPart
}
// CallerFunction returns the function name of the caller.
diff --git a/debug/gdebug/gdebug_z_unit_internal_test.go b/debug/gdebug/gdebug_z_unit_internal_test.go
new file mode 100644
index 000000000..272141479
--- /dev/null
+++ b/debug/gdebug/gdebug_z_unit_internal_test.go
@@ -0,0 +1,26 @@
+// Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
+//
+// This Source Code Form is subject to the terms of the MIT License.
+// If a copy of the MIT was not distributed with this file,
+// You can obtain one at https://github.com/gogf/gf.
+
+package gdebug
+
+import (
+ "testing"
+)
+
+func Test_getPackageFromCallerFunction(t *testing.T) {
+ dataMap := map[string]string{
+ "github.com/gogf/gf/v2/test/a": "github.com/gogf/gf/v2/test/a",
+ "github.com/gogf/gf/v2/test/a.C": "github.com/gogf/gf/v2/test/a",
+ "github.com/gogf/gf/v2/test/aa.C": "github.com/gogf/gf/v2/test/aa",
+ "github.com/gogf/gf/v2/test/gtest.C": "github.com/gogf/gf/v2/test/gtest",
+ }
+ for functionName, packageName := range dataMap {
+ if result := getPackageFromCallerFunction(functionName); result != packageName {
+ t.Logf(`%s != %s`, result, packageName)
+ t.Fail()
+ }
+ }
+}
diff --git a/debug/gdebug/gdebug_z_unit_test.go b/debug/gdebug/gdebug_z_unit_test.go
index 606a9c4c5..0a8b0f84f 100644
--- a/debug/gdebug/gdebug_z_unit_test.go
+++ b/debug/gdebug/gdebug_z_unit_test.go
@@ -1,3 +1,9 @@
+// Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
+//
+// This Source Code Form is subject to the terms of the MIT License.
+// If a copy of the MIT was not distributed with this file,
+// You can obtain one at https://github.com/gogf/gf.
+
package gdebug_test
import (
diff --git a/encoding/ghtml/ghtml.go b/encoding/ghtml/ghtml.go
index da0b798cd..34fa027aa 100644
--- a/encoding/ghtml/ghtml.go
+++ b/encoding/ghtml/ghtml.go
@@ -12,6 +12,8 @@ import (
"reflect"
"strings"
+ "github.com/gogf/gf/v2/errors/gcode"
+ "github.com/gogf/gf/v2/errors/gerror"
strip "github.com/grokify/html-strip-tags-go"
)
@@ -60,15 +62,26 @@ func SpecialCharsDecode(s string) string {
}
// SpecialCharsMapOrStruct automatically encodes string values/attributes for map/struct.
+//
+// Note that, if operation on struct, the given parameter `mapOrStruct` should be type of pointer to struct.
+//
+// For example:
+// var m = map{}
+// var s = struct{}{}
+// OK: SpecialCharsMapOrStruct(m)
+// OK: SpecialCharsMapOrStruct(&s)
+// Error: SpecialCharsMapOrStruct(s)
func SpecialCharsMapOrStruct(mapOrStruct interface{}) error {
var (
reflectValue = reflect.ValueOf(mapOrStruct)
reflectKind = reflectValue.Kind()
+ originalKind = reflectKind
)
for reflectValue.IsValid() && (reflectKind == reflect.Ptr || reflectKind == reflect.Interface) {
reflectValue = reflectValue.Elem()
reflectKind = reflectValue.Kind()
}
+
switch reflectKind {
case reflect.Map:
var (
@@ -82,22 +95,43 @@ func SpecialCharsMapOrStruct(mapOrStruct interface{}) error {
reflectValue.SetMapIndex(key, reflect.ValueOf(SpecialChars(mapValue.String())))
case reflect.Interface:
if mapValue.Elem().Kind() == reflect.String {
- reflectValue.SetMapIndex(key, reflect.ValueOf(SpecialChars(mapValue.Elem().String())))
+ reflectValue.SetMapIndex(
+ key,
+ reflect.ValueOf(SpecialChars(mapValue.Elem().String())),
+ )
}
+ default:
}
}
case reflect.Struct:
- var (
- fieldValue reflect.Value
- )
+ if originalKind != reflect.Ptr {
+ return gerror.NewCodef(
+ gcode.CodeInvalidParameter,
+ `invalid input parameter type "%s", should be type of pointer to struct`,
+ reflect.TypeOf(mapOrStruct).String(),
+ )
+ }
+ var fieldValue reflect.Value
for i := 0; i < reflectValue.NumField(); i++ {
fieldValue = reflectValue.Field(i)
switch fieldValue.Kind() {
case reflect.String:
- fieldValue.Set(reflect.ValueOf(SpecialChars(fieldValue.String())))
+ fieldValue.Set(
+ reflect.ValueOf(
+ SpecialChars(fieldValue.String()),
+ ),
+ )
+ default:
}
}
+
+ default:
+ return gerror.NewCodef(
+ gcode.CodeInvalidParameter,
+ `invalid input parameter type "%s"`,
+ reflect.TypeOf(mapOrStruct).String(),
+ )
}
return nil
}
diff --git a/encoding/ghtml/ghtml_z_unit_test.go b/encoding/ghtml/ghtml_z_unit_test.go
index 8ac444753..41b06912d 100644
--- a/encoding/ghtml/ghtml_z_unit_test.go
+++ b/encoding/ghtml/ghtml_z_unit_test.go
@@ -78,4 +78,14 @@ func Test_SpecialCharsMapOrStruct_Struct(t *testing.T) {
t.Assert(a.Title, `<h1>T</h1>`)
t.Assert(a.Content, `<div>C</div>`)
})
+
+ // should error
+ gtest.C(t, func(t *gtest.T) {
+ a := A{
+ Title: "T
",
+ Content: "C
",
+ }
+ err := ghtml.SpecialCharsMapOrStruct(a)
+ t.AssertNE(err, nil)
+ })
}
diff --git a/encoding/gjson/gjson_api_encoding.go b/encoding/gjson/gjson_api_encoding.go
index 7f08f0ccc..23a0ae86f 100644
--- a/encoding/gjson/gjson_api_encoding.go
+++ b/encoding/gjson/gjson_api_encoding.go
@@ -207,7 +207,7 @@ func (j *Json) ToProperties() ([]byte, error) {
return gproperties.Encode(j.Map())
}
-// TopropertiesString properties to string
+// ToPropertiesString properties to string
func (j *Json) ToPropertiesString() (string, error) {
b, e := j.ToProperties()
return string(b), e
@@ -221,7 +221,7 @@ func (j *Json) MustToProperties() []byte {
return result
}
-// MustTopropertiesString
+// MustToPropertiesString
func (j *Json) MustToPropertiesString() string {
return string(j.MustToProperties())
}
diff --git a/encoding/gjson/gjson_api_new_load.go b/encoding/gjson/gjson_api_new_load.go
index ec45f55df..113e0dc96 100644
--- a/encoding/gjson/gjson_api_new_load.go
+++ b/encoding/gjson/gjson_api_new_load.go
@@ -7,22 +7,10 @@
package gjson
import (
- "bytes"
"reflect"
- "github.com/gogf/gf/v2/encoding/gini"
- "github.com/gogf/gf/v2/encoding/gproperties"
- "github.com/gogf/gf/v2/encoding/gtoml"
- "github.com/gogf/gf/v2/encoding/gxml"
- "github.com/gogf/gf/v2/encoding/gyaml"
- "github.com/gogf/gf/v2/errors/gcode"
- "github.com/gogf/gf/v2/errors/gerror"
- "github.com/gogf/gf/v2/internal/json"
"github.com/gogf/gf/v2/internal/reflection"
"github.com/gogf/gf/v2/internal/rwmutex"
- "github.com/gogf/gf/v2/os/gfile"
- "github.com/gogf/gf/v2/text/gregex"
- "github.com/gogf/gf/v2/text/gstr"
"github.com/gogf/gf/v2/util/gconv"
)
@@ -57,16 +45,26 @@ func NewWithTag(data interface{}, tags string, safe ...bool) *Json {
// or slice for data access reason, or it will make no sense.
func NewWithOptions(data interface{}, options Options) *Json {
var j *Json
- switch data.(type) {
- case string, []byte:
- if r, err := loadContentWithOptions(data, options); err == nil {
+ switch result := data.(type) {
+ case []byte:
+ if r, err := loadContentWithOptions(result, options); err == nil {
j = r
- } else {
- j = &Json{
- p: &data,
- c: byte(defaultSplitChar),
- vc: false,
- }
+ break
+ }
+ j = &Json{
+ p: &data,
+ c: byte(defaultSplitChar),
+ vc: false,
+ }
+ case string:
+ if r, err := loadContentWithOptions([]byte(result), options); err == nil {
+ j = r
+ break
+ }
+ j = &Json{
+ p: &data,
+ c: byte(defaultSplitChar),
+ vc: false,
}
default:
var (
@@ -98,266 +96,3 @@ func NewWithOptions(data interface{}, options Options) *Json {
j.mu = rwmutex.Create(options.Safe)
return j
}
-
-// Load loads content from specified file `path`, and creates a Json object from its content.
-func Load(path string, safe ...bool) (*Json, error) {
- if p, err := gfile.Search(path); err != nil {
- return nil, err
- } else {
- path = p
- }
- options := Options{
- Type: ContentType(gfile.Ext(path)),
- }
- if len(safe) > 0 && safe[0] {
- options.Safe = true
- }
- return doLoadContentWithOptions(gfile.GetBytesWithCache(path), options)
-}
-
-// LoadWithOptions creates a Json object from given JSON format content and options.
-func LoadWithOptions(data interface{}, options Options) (*Json, error) {
- return doLoadContentWithOptions(gconv.Bytes(data), options)
-}
-
-// LoadJson creates a Json object from given JSON format content.
-func LoadJson(data interface{}, safe ...bool) (*Json, error) {
- option := Options{
- Type: ContentTypeJson,
- }
- if len(safe) > 0 && safe[0] {
- option.Safe = true
- }
- return doLoadContentWithOptions(gconv.Bytes(data), option)
-}
-
-// LoadXml creates a Json object from given XML format content.
-func LoadXml(data interface{}, safe ...bool) (*Json, error) {
- option := Options{
- Type: ContentTypeXml,
- }
- if len(safe) > 0 && safe[0] {
- option.Safe = true
- }
- return doLoadContentWithOptions(gconv.Bytes(data), option)
-}
-
-// LoadIni creates a Json object from given INI format content.
-func LoadIni(data interface{}, safe ...bool) (*Json, error) {
- option := Options{
- Type: ContentTypeIni,
- }
- if len(safe) > 0 && safe[0] {
- option.Safe = true
- }
- return doLoadContentWithOptions(gconv.Bytes(data), option)
-}
-
-// LoadYaml creates a Json object from given YAML format content.
-func LoadYaml(data interface{}, safe ...bool) (*Json, error) {
- option := Options{
- Type: ContentTypeYaml,
- }
- if len(safe) > 0 && safe[0] {
- option.Safe = true
- }
- return doLoadContentWithOptions(gconv.Bytes(data), option)
-}
-
-// LoadToml creates a Json object from given TOML format content.
-func LoadToml(data interface{}, safe ...bool) (*Json, error) {
- option := Options{
- Type: ContentTypeToml,
- }
- if len(safe) > 0 && safe[0] {
- option.Safe = true
- }
- return doLoadContentWithOptions(gconv.Bytes(data), option)
-}
-
-// LoadProperties creates a Json object from given TOML format content.
-func LoadProperties(data interface{}, safe ...bool) (*Json, error) {
- option := Options{
- Type: ContentTypeProperties,
- }
- if len(safe) > 0 && safe[0] {
- option.Safe = true
- }
- return doLoadContentWithOptions(gconv.Bytes(data), option)
-}
-
-// LoadContent creates a Json object from given content, it checks the data type of `content`
-// automatically, supporting data content type as follows:
-// JSON, XML, INI, YAML and TOML.
-func LoadContent(data interface{}, safe ...bool) (*Json, error) {
- content := gconv.Bytes(data)
- if len(content) == 0 {
- return New(nil, safe...), nil
- }
- return LoadContentType(checkDataType(content), content, safe...)
-}
-
-// LoadContentType creates a Json object from given type and content,
-// supporting data content type as follows:
-// JSON, XML, INI, YAML and TOML.
-func LoadContentType(dataType ContentType, data interface{}, safe ...bool) (*Json, error) {
- content := gconv.Bytes(data)
- if len(content) == 0 {
- return New(nil, safe...), nil
- }
- // ignore UTF8-BOM
- if content[0] == 0xEF && content[1] == 0xBB && content[2] == 0xBF {
- content = content[3:]
- }
- options := Options{
- Type: dataType,
- StrNumber: true,
- }
- if len(safe) > 0 && safe[0] {
- options.Safe = true
- }
- return doLoadContentWithOptions(content, options)
-}
-
-// IsValidDataType checks and returns whether given `dataType` a valid data type for loading.
-func IsValidDataType(dataType ContentType) bool {
- if dataType == "" {
- return false
- }
- if dataType[0] == '.' {
- dataType = dataType[1:]
- }
- switch dataType {
- case
- ContentTypeJson,
- ContentTypeJs,
- ContentTypeXml,
- ContentTypeYaml,
- ContentTypeYml,
- ContentTypeToml,
- ContentTypeIni,
- ContentTypeProperties:
- return true
- }
- return false
-}
-
-func loadContentWithOptions(data interface{}, options Options) (*Json, error) {
- content := gconv.Bytes(data)
- if len(content) == 0 {
- return NewWithOptions(nil, options), nil
- }
- if options.Type == "" {
- options.Type = checkDataType(content)
- }
- return loadContentTypeWithOptions(content, options)
-}
-
-func loadContentTypeWithOptions(data interface{}, options Options) (*Json, error) {
- content := gconv.Bytes(data)
- if len(content) == 0 {
- return NewWithOptions(nil, options), nil
- }
- // ignore UTF8-BOM
- if content[0] == 0xEF && content[1] == 0xBB && content[2] == 0xBF {
- content = content[3:]
- }
- return doLoadContentWithOptions(content, options)
-}
-
-// doLoadContent creates a Json object from given content.
-// It supports data content type as follows:
-// JSON, XML, INI, YAML and TOML.
-func doLoadContentWithOptions(data []byte, options Options) (*Json, error) {
- var (
- err error
- result interface{}
- )
- if len(data) == 0 {
- return NewWithOptions(nil, options), nil
- }
- if options.Type == "" {
- options.Type = checkDataType(data)
- }
- options.Type = ContentType(gstr.TrimLeft(
- string(options.Type), "."),
- )
- switch options.Type {
- case ContentTypeJson, ContentTypeJs:
-
- case ContentTypeXml:
- if data, err = gxml.ToJson(data); err != nil {
- return nil, err
- }
-
- case ContentTypeYaml, ContentTypeYml:
- if data, err = gyaml.ToJson(data); err != nil {
- return nil, err
- }
-
- case ContentTypeToml:
- if data, err = gtoml.ToJson(data); err != nil {
- return nil, err
- }
-
- case ContentTypeIni:
- if data, err = gini.ToJson(data); err != nil {
- return nil, err
- }
- case ContentTypeProperties:
- if data, err = gproperties.ToJson(data); err != nil {
- return nil, err
- }
-
- default:
- err = gerror.NewCodef(
- gcode.CodeInvalidParameter,
- `unsupported type "%s" for loading`,
- options.Type,
- )
- }
- if err != nil {
- return nil, err
- }
- decoder := json.NewDecoder(bytes.NewReader(data))
- if options.StrNumber {
- decoder.UseNumber()
- }
- if err = decoder.Decode(&result); err != nil {
- return nil, err
- }
- switch result.(type) {
- case string, []byte:
- return nil, gerror.Newf(`json decoding failed for content: %s`, data)
- }
- return NewWithOptions(result, options), nil
-}
-
-// checkDataType automatically checks and returns the data type for `content`.
-// Note that it uses regular expression for loose checking, you can use LoadXXX/LoadContentType
-// functions to load the content for certain content type.
-func checkDataType(content []byte) ContentType {
- if json.Valid(content) {
- return ContentTypeJson
- } else if gregex.IsMatch(`^<.+>[\S\s]+<.+>\s*$`, content) {
- return ContentTypeXml
- } else if !gregex.IsMatch(`[\n\r]*[\s\t\w\-\."]+\s*=\s*"""[\s\S]+"""`, content) &&
- !gregex.IsMatch(`[\n\r]*[\s\t\w\-\."]+\s*=\s*'''[\s\S]+'''`, content) &&
- ((gregex.IsMatch(`^[\n\r]*[\w\-\s\t]+\s*:\s*".+"`, content) || gregex.IsMatch(`^[\n\r]*[\w\-\s\t]+\s*:\s*\w+`, content)) ||
- (gregex.IsMatch(`[\n\r]+[\w\-\s\t]+\s*:\s*".+"`, content) || gregex.IsMatch(`[\n\r]+[\w\-\s\t]+\s*:\s*\w+`, content))) {
- return ContentTypeYaml
- } else if !gregex.IsMatch(`^[\s\t\n\r]*;.+`, content) &&
- !gregex.IsMatch(`[\s\t\n\r]+;.+`, content) &&
- !gregex.IsMatch(`[\n\r]+[\s\t\w\-]+\.[\s\t\w\-]+\s*=\s*.+`, content) &&
- (gregex.IsMatch(`[\n\r]*[\s\t\w\-\."]+\s*=\s*".+"`, content) || gregex.IsMatch(`[\n\r]*[\s\t\w\-\."]+\s*=\s*\w+`, content)) {
- return ContentTypeToml
- } else if gregex.IsMatch(`\[[\w\.]+\]`, content) &&
- (gregex.IsMatch(`[\n\r]*[\s\t\w\-\."]+\s*=\s*".+"`, content) || gregex.IsMatch(`[\n\r]*[\s\t\w\-\."]+\s*=\s*\w+`, content)) {
- // Must contain "[xxx]" section.
- return ContentTypeIni
- } else if gregex.IsMatch(`[\n\r]*[\s\t\w\-\."]+\s*=\s*\w+`, content) {
- return ContentTypeProperties
- } else {
- return ""
- }
-}
diff --git a/encoding/gjson/gjson_api_new_load_content.go b/encoding/gjson/gjson_api_new_load_content.go
new file mode 100644
index 000000000..7ddda24c1
--- /dev/null
+++ b/encoding/gjson/gjson_api_new_load_content.go
@@ -0,0 +1,279 @@
+// Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
+//
+// This Source Code Form is subject to the terms of the MIT License.
+// If a copy of the MIT was not distributed with this file,
+// You can obtain one at https://github.com/gogf/gf.
+
+package gjson
+
+import (
+ "bytes"
+
+ "github.com/gogf/gf/v2/encoding/gini"
+ "github.com/gogf/gf/v2/encoding/gproperties"
+ "github.com/gogf/gf/v2/encoding/gtoml"
+ "github.com/gogf/gf/v2/encoding/gxml"
+ "github.com/gogf/gf/v2/encoding/gyaml"
+ "github.com/gogf/gf/v2/errors/gcode"
+ "github.com/gogf/gf/v2/errors/gerror"
+ "github.com/gogf/gf/v2/internal/json"
+ "github.com/gogf/gf/v2/text/gregex"
+ "github.com/gogf/gf/v2/text/gstr"
+)
+
+// LoadWithOptions creates a Json object from given JSON format content and options.
+func LoadWithOptions(data []byte, options Options) (*Json, error) {
+ return loadContentWithOptions(data, options)
+}
+
+// LoadJson creates a Json object from given JSON format content.
+func LoadJson(data []byte, safe ...bool) (*Json, error) {
+ var option = Options{
+ Type: ContentTypeJson,
+ }
+ if len(safe) > 0 && safe[0] {
+ option.Safe = true
+ }
+ return loadContentWithOptions(data, option)
+}
+
+// LoadXml creates a Json object from given XML format content.
+func LoadXml(data []byte, safe ...bool) (*Json, error) {
+ var option = Options{
+ Type: ContentTypeXml,
+ }
+ if len(safe) > 0 && safe[0] {
+ option.Safe = true
+ }
+ return loadContentWithOptions(data, option)
+}
+
+// LoadIni creates a Json object from given INI format content.
+func LoadIni(data []byte, safe ...bool) (*Json, error) {
+ var option = Options{
+ Type: ContentTypeIni,
+ }
+ if len(safe) > 0 && safe[0] {
+ option.Safe = true
+ }
+ return loadContentWithOptions(data, option)
+}
+
+// LoadYaml creates a Json object from given YAML format content.
+func LoadYaml(data []byte, safe ...bool) (*Json, error) {
+ var option = Options{
+ Type: ContentTypeYaml,
+ }
+ if len(safe) > 0 && safe[0] {
+ option.Safe = true
+ }
+ return loadContentWithOptions(data, option)
+}
+
+// LoadToml creates a Json object from given TOML format content.
+func LoadToml(data []byte, safe ...bool) (*Json, error) {
+ var option = Options{
+ Type: ContentTypeToml,
+ }
+ if len(safe) > 0 && safe[0] {
+ option.Safe = true
+ }
+ return loadContentWithOptions(data, option)
+}
+
+// LoadProperties creates a Json object from given TOML format content.
+func LoadProperties(data []byte, safe ...bool) (*Json, error) {
+ var option = Options{
+ Type: ContentTypeProperties,
+ }
+ if len(safe) > 0 && safe[0] {
+ option.Safe = true
+ }
+ return loadContentWithOptions(data, option)
+}
+
+// LoadContent creates a Json object from given content, it checks the data type of `content`
+// automatically, supporting data content type as follows:
+// JSON, XML, INI, YAML and TOML.
+func LoadContent(data []byte, safe ...bool) (*Json, error) {
+ return LoadContentType("", data, safe...)
+}
+
+// LoadContentType creates a Json object from given type and content,
+// supporting data content type as follows:
+// JSON, XML, INI, YAML and TOML.
+func LoadContentType(dataType ContentType, data []byte, safe ...bool) (*Json, error) {
+ if len(data) == 0 {
+ return New(nil, safe...), nil
+ }
+ var options = Options{
+ Type: dataType,
+ StrNumber: true,
+ }
+ if len(safe) > 0 && safe[0] {
+ options.Safe = true
+ }
+ return loadContentWithOptions(data, options)
+}
+
+// IsValidDataType checks and returns whether given `dataType` a valid data type for loading.
+func IsValidDataType(dataType ContentType) bool {
+ if dataType == "" {
+ return false
+ }
+ if dataType[0] == '.' {
+ dataType = dataType[1:]
+ }
+ switch dataType {
+ case
+ ContentTypeJson,
+ ContentTypeJs,
+ ContentTypeXml,
+ ContentTypeYaml,
+ ContentTypeYml,
+ ContentTypeToml,
+ ContentTypeIni,
+ ContentTypeProperties:
+ return true
+ }
+ return false
+}
+
+func trimBOM(data []byte) []byte {
+ if len(data) < 3 {
+ return data
+ }
+ if data[0] == 0xEF && data[1] == 0xBB && data[2] == 0xBF {
+ data = data[3:]
+ }
+ return data
+}
+
+// loadContentWithOptions creates a Json object from given content.
+// It supports data content type as follows:
+// JSON, XML, INI, YAML and TOML.
+func loadContentWithOptions(data []byte, options Options) (*Json, error) {
+ var (
+ err error
+ result interface{}
+ )
+ data = trimBOM(data)
+ if len(data) == 0 {
+ return NewWithOptions(nil, options), nil
+ }
+ if options.Type == "" {
+ options.Type, err = checkDataType(data)
+ if err != nil {
+ return nil, err
+ }
+ }
+ options.Type = ContentType(gstr.TrimLeft(
+ string(options.Type), "."),
+ )
+ switch options.Type {
+ case ContentTypeJson, ContentTypeJs:
+
+ case ContentTypeXml:
+ data, err = gxml.ToJson(data)
+
+ case ContentTypeYaml, ContentTypeYml:
+ data, err = gyaml.ToJson(data)
+
+ case ContentTypeToml:
+ data, err = gtoml.ToJson(data)
+
+ case ContentTypeIni:
+ data, err = gini.ToJson(data)
+
+ case ContentTypeProperties:
+ data, err = gproperties.ToJson(data)
+
+ default:
+ err = gerror.NewCodef(
+ gcode.CodeInvalidParameter,
+ `unsupported type "%s" for loading`,
+ options.Type,
+ )
+ }
+ if err != nil {
+ return nil, err
+ }
+
+ decoder := json.NewDecoder(bytes.NewReader(data))
+ if options.StrNumber {
+ decoder.UseNumber()
+ }
+ if err = decoder.Decode(&result); err != nil {
+ return nil, err
+ }
+ switch result.(type) {
+ case string, []byte:
+ return nil, gerror.Newf(`json decoding failed for content: %s`, data)
+ }
+ return NewWithOptions(result, options), nil
+}
+
+// checkDataType automatically checks and returns the data type for `content`.
+// Note that it uses regular expression for loose checking, you can use LoadXXX/LoadContentType
+// functions to load the content for certain content type.
+// TODO it is not graceful here automatic judging the data type.
+// TODO it might be removed in the future, which lets the user explicitly specify the data type not automatic checking.
+func checkDataType(data []byte) (ContentType, error) {
+ switch {
+ case json.Valid(data):
+ return ContentTypeJson, nil
+
+ case isXmlContent(data):
+ return ContentTypeXml, nil
+
+ case isYamlContent(data):
+ return ContentTypeYaml, nil
+
+ case isTomlContent(data):
+ return ContentTypeToml, nil
+
+ case isIniContent(data):
+ // Must contain "[xxx]" section.
+ return ContentTypeIni, nil
+
+ case isPropertyContent(data):
+ return ContentTypeProperties, nil
+
+ default:
+ return "", gerror.NewCode(
+ gcode.CodeOperationFailed,
+ `unable auto check the data format type`,
+ )
+ }
+}
+
+func isXmlContent(data []byte) bool {
+ return gregex.IsMatch(`^\s*<.+>[\S\s]+<.+>\s*$`, data)
+}
+
+func isYamlContent(data []byte) bool {
+ return !gregex.IsMatch(`[\n\r]*[\s\t\w\-\."]+\s*=\s*"""[\s\S]+"""`, data) &&
+ !gregex.IsMatch(`[\n\r]*[\s\t\w\-\."]+\s*=\s*'''[\s\S]+'''`, data) &&
+ ((gregex.IsMatch(`^[\n\r]*[\w\-\s\t]+\s*:\s*".+"`, data) ||
+ gregex.IsMatch(`^[\n\r]*[\w\-\s\t]+\s*:\s*\w+`, data)) ||
+ (gregex.IsMatch(`[\n\r]+[\w\-\s\t]+\s*:\s*".+"`, data) ||
+ gregex.IsMatch(`[\n\r]+[\w\-\s\t]+\s*:\s*\w+`, data)))
+}
+
+func isTomlContent(data []byte) bool {
+ return !gregex.IsMatch(`^[\s\t\n\r]*;.+`, data) &&
+ !gregex.IsMatch(`[\s\t\n\r]+;.+`, data) &&
+ !gregex.IsMatch(`[\n\r]+[\s\t\w\-]+\.[\s\t\w\-]+\s*=\s*.+`, data) &&
+ (gregex.IsMatch(`[\n\r]*[\s\t\w\-\."]+\s*=\s*".+"`, data) ||
+ gregex.IsMatch(`[\n\r]*[\s\t\w\-\."]+\s*=\s*\w+`, data))
+}
+
+func isIniContent(data []byte) bool {
+ return gregex.IsMatch(`\[[\w\.]+\]`, data) &&
+ (gregex.IsMatch(`[\n\r]*[\s\t\w\-\."]+\s*=\s*".+"`, data) ||
+ gregex.IsMatch(`[\n\r]*[\s\t\w\-\."]+\s*=\s*\w+`, data))
+}
+
+func isPropertyContent(data []byte) bool {
+ return gregex.IsMatch(`[\n\r]*[\s\t\w\-\."]+\s*=\s*\w+`, data)
+}
diff --git a/encoding/gjson/gjson_api_new_load_path.go b/encoding/gjson/gjson_api_new_load_path.go
new file mode 100644
index 000000000..7cdab5d86
--- /dev/null
+++ b/encoding/gjson/gjson_api_new_load_path.go
@@ -0,0 +1,34 @@
+// Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
+//
+// This Source Code Form is subject to the terms of the MIT License.
+// If a copy of the MIT was not distributed with this file,
+// You can obtain one at https://github.com/gogf/gf.
+
+package gjson
+
+import "github.com/gogf/gf/v2/os/gfile"
+
+// Load loads content from specified file `path`, and creates a Json object from its content.
+// Deprecated: use LoadPath instead.
+func Load(path string, safe ...bool) (*Json, error) {
+ var isSafe bool
+ if len(safe) > 0 {
+ isSafe = safe[0]
+ }
+ return LoadPath(path, Options{
+ Safe: isSafe,
+ })
+}
+
+// LoadPath loads content from specified file `path`, and creates a Json object from its content.
+func LoadPath(path string, options Options) (*Json, error) {
+ if p, err := gfile.Search(path); err != nil {
+ return nil, err
+ } else {
+ path = p
+ }
+ if options.Type == "" {
+ options.Type = ContentType(gfile.Ext(path))
+ }
+ return loadContentWithOptions(gfile.GetBytesWithCache(path), options)
+}
diff --git a/encoding/gjson/gjson_z_example_load_test.go b/encoding/gjson/gjson_z_example_load_test.go
index 102029f6f..812cd2a70 100644
--- a/encoding/gjson/gjson_z_example_load_test.go
+++ b/encoding/gjson/gjson_z_example_load_test.go
@@ -29,7 +29,7 @@ func ExampleLoad() {
}
func ExampleLoadJson() {
- jsonContent := `{"name":"john", "score":"100"}`
+ jsonContent := []byte(`{"name":"john", "score":"100"}`)
j, _ := gjson.LoadJson(jsonContent)
fmt.Println(j.Get("name"))
fmt.Println(j.Get("score"))
@@ -40,11 +40,13 @@ func ExampleLoadJson() {
}
func ExampleLoadXml() {
- xmlContent := `
-
- john
- 100
- `
+ xmlContent := []byte(`
+
+
+ john
+ 100
+
+`)
j, _ := gjson.LoadXml(xmlContent)
fmt.Println(j.Get("base.name"))
fmt.Println(j.Get("base.score"))
@@ -55,11 +57,11 @@ func ExampleLoadXml() {
}
func ExampleLoadIni() {
- iniContent := `
- [base]
- name = john
- score = 100
- `
+ iniContent := []byte(`
+[base]
+name = john
+score = 100
+`)
j, _ := gjson.LoadIni(iniContent)
fmt.Println(j.Get("base.name"))
fmt.Println(j.Get("base.score"))
@@ -70,10 +72,11 @@ func ExampleLoadIni() {
}
func ExampleLoadYaml() {
- yamlContent :=
- `base:
+ yamlContent := []byte(`
+base:
name: john
- score: 100`
+ score: 100
+`)
j, _ := gjson.LoadYaml(yamlContent)
fmt.Println(j.Get("base.name"))
@@ -85,10 +88,11 @@ func ExampleLoadYaml() {
}
func ExampleLoadToml() {
- tomlContent :=
- `[base]
+ tomlContent := []byte(`
+[base]
name = "john"
- score = 100`
+ score = 100
+`)
j, _ := gjson.LoadToml(tomlContent)
fmt.Println(j.Get("base.name"))
@@ -100,7 +104,7 @@ func ExampleLoadToml() {
}
func ExampleLoadContent() {
- jsonContent := `{"name":"john", "score":"100"}`
+ jsonContent := []byte(`{"name":"john", "score":"100"}`)
j, _ := gjson.LoadContent(jsonContent)
@@ -132,11 +136,13 @@ func ExampleLoadContent_UTF8BOM() {
}
func ExampleLoadContent_Xml() {
- xmlContent := `
-
- john
- 100
- `
+ xmlContent := []byte(`
+
+
+ john
+ 100
+
+`)
x, _ := gjson.LoadContent(xmlContent)
@@ -149,16 +155,20 @@ func ExampleLoadContent_Xml() {
}
func ExampleLoadContentType() {
- jsonContent := `{"name":"john", "score":"100"}`
- xmlContent := `
-
- john
- 100
- `
+ var (
+ jsonContent = []byte(`{"name":"john", "score":"100"}`)
+ xmlContent = []byte(`
+
+
+ john
+ 100
+
+`)
+ )
j, _ := gjson.LoadContentType("json", jsonContent)
x, _ := gjson.LoadContentType("xml", xmlContent)
- j1, _ := gjson.LoadContentType("json", "")
+ j1, _ := gjson.LoadContentType("json", []byte(""))
fmt.Println(j.Get("name"))
fmt.Println(j.Get("score"))
diff --git a/encoding/gjson/gjson_z_example_pattern_test.go b/encoding/gjson/gjson_z_example_pattern_test.go
index db5f1308a..020d7bff7 100644
--- a/encoding/gjson/gjson_z_example_pattern_test.go
+++ b/encoding/gjson/gjson_z_example_pattern_test.go
@@ -51,7 +51,7 @@ func ExampleDecodeToJson_PatternViolenceCheck() {
}
func ExampleJson_Get_MapSliceChange() {
- jsonContent := `{"map":{"key":"value"}, "slice":[59,90]}`
+ jsonContent := []byte(`{"map":{"key":"value"}, "slice":[59,90]}`)
j, _ := gjson.LoadJson(jsonContent)
m := j.Get("map").Map()
fmt.Println(m)
diff --git a/encoding/gjson/gjson_z_example_test.go b/encoding/gjson/gjson_z_example_test.go
index d262be3ce..3e6c45f3f 100644
--- a/encoding/gjson/gjson_z_example_test.go
+++ b/encoding/gjson/gjson_z_example_test.go
@@ -871,13 +871,14 @@ func ExampleJson_IsNil() {
}
func ExampleJson_Get() {
- data :=
- `{
- "users" : {
- "count" : 1,
- "array" : ["John", "Ming"]
- }
- }`
+ data := []byte(`
+{
+ "users" : {
+ "count" : 1,
+ "array" : ["John", "Ming"]
+ }
+}
+`)
j, _ := gjson.LoadContent(data)
fmt.Println(j.Get("."))
@@ -896,13 +897,14 @@ func ExampleJson_Get() {
}
func ExampleJson_GetJson() {
- data :=
- `{
- "users" : {
+ data := []byte(`
+{
+ "users" : {
"count" : 1,
"array" : ["John", "Ming"]
}
- }`
+ }
+`)
j, _ := gjson.LoadContent(data)
@@ -913,13 +915,14 @@ func ExampleJson_GetJson() {
}
func ExampleJson_GetJsons() {
- data :=
- `{
- "users" : {
+ data := []byte(`
+{
+ "users" : {
"count" : 3,
"array" : [{"Age":18,"Name":"John"}, {"Age":20,"Name":"Tom"}]
}
- }`
+ }
+`)
j, _ := gjson.LoadContent(data)
@@ -934,16 +937,17 @@ func ExampleJson_GetJsons() {
}
func ExampleJson_GetJsonMap() {
- data :=
- `{
- "users" : {
+ data := []byte(`
+{
+ "users" : {
"count" : 1,
"array" : {
"info" : {"Age":18,"Name":"John"},
"addr" : {"City":"Chengdu","Company":"Tencent"}
}
}
- }`
+ }
+`)
j, _ := gjson.LoadContent(data)
@@ -1056,9 +1060,9 @@ func ExampleJson_Contains() {
}
func ExampleJson_Len() {
- data :=
- `{
- "users" : {
+ data := []byte(`
+{
+ "users" : {
"count" : 1,
"nameArray" : ["Join", "Tom"],
"infoMap" : {
@@ -1067,7 +1071,8 @@ func ExampleJson_Len() {
"addr" : "ChengDu"
}
}
- }`
+ }
+`)
j, _ := gjson.LoadContent(data)
@@ -1080,13 +1085,14 @@ func ExampleJson_Len() {
}
func ExampleJson_Append() {
- data :=
- `{
- "users" : {
+ data := []byte(`
+{
+ "users" : {
"count" : 1,
"array" : ["John", "Ming"]
}
- }`
+ }
+`)
j, _ := gjson.LoadContent(data)
@@ -1099,13 +1105,14 @@ func ExampleJson_Append() {
}
func ExampleJson_MustAppend() {
- data :=
- `{
- "users" : {
+ data := []byte(`
+{
+ "users" : {
"count" : 1,
"array" : ["John", "Ming"]
}
- }`
+ }
+`)
j, _ := gjson.LoadContent(data)
@@ -1118,9 +1125,9 @@ func ExampleJson_MustAppend() {
}
func ExampleJson_Map() {
- data :=
- `{
- "users" : {
+ data := []byte(`
+{
+ "users" : {
"count" : 1,
"info" : {
"name" : "John",
@@ -1128,7 +1135,8 @@ func ExampleJson_Map() {
"addr" : "ChengDu"
}
}
- }`
+ }
+`)
j, _ := gjson.LoadContent(data)
@@ -1139,13 +1147,14 @@ func ExampleJson_Map() {
}
func ExampleJson_Array() {
- data :=
- `{
- "users" : {
+ data := []byte(`
+{
+ "users" : {
"count" : 1,
"array" : ["John", "Ming"]
}
- }`
+ }
+`)
j, _ := gjson.LoadContent(data)
@@ -1156,7 +1165,7 @@ func ExampleJson_Array() {
}
func ExampleJson_Scan() {
- data := `{"name":"john","age":"18"}`
+ data := []byte(`{"name":"john","age":"18"}`)
type BaseInfo struct {
Name string
@@ -1175,7 +1184,7 @@ func ExampleJson_Scan() {
}
func ExampleJson_Dump() {
- data := `{"name":"john","age":"18"}`
+ data := []byte(`{"name":"john","age":"18"}`)
j, _ := gjson.LoadContent(data)
j.Dump()
diff --git a/encoding/gjson/gjson_z_unit_feature_json_test.go b/encoding/gjson/gjson_z_unit_feature_json_test.go
index 5e3cd3024..542b8e795 100644
--- a/encoding/gjson/gjson_z_unit_feature_json_test.go
+++ b/encoding/gjson/gjson_z_unit_feature_json_test.go
@@ -49,11 +49,11 @@ func Test_ToJson(t *testing.T) {
}
func Test_MapAttributeConvert(t *testing.T) {
- var data = `
- {
+ var data = []byte(`
+{
"title": {"l1":"标签1","l2":"标签2"}
}
-`
+`)
gtest.C(t, func(t *gtest.T) {
j, err := gjson.LoadContent(data)
gtest.AssertNil(err)
diff --git a/encoding/gjson/gjson_z_unit_feature_load_test.go b/encoding/gjson/gjson_z_unit_feature_load_test.go
index 51f9a2d8b..4a1f5e098 100644
--- a/encoding/gjson/gjson_z_unit_feature_load_test.go
+++ b/encoding/gjson/gjson_z_unit_feature_load_test.go
@@ -105,7 +105,8 @@ func Test_Load_XML(t *testing.T) {
// XML
gtest.C(t, func(t *gtest.T) {
- xml := `
+ xml := []byte(`
+
`
+
+`)
j, err := gjson.LoadContent(xml)
t.AssertNil(err)
t.Assert(j.Get("Output.ipageIndex"), "2")
@@ -250,10 +252,10 @@ func Test_Load_Basic(t *testing.T) {
t.AssertNil(err)
t.Assert(j.Interface(), nil)
- j, err = gjson.LoadContent(`{"name": "gf"}`)
+ j, err = gjson.LoadContent([]byte(`{"name": "gf"}`))
t.AssertNil(err)
- j, err = gjson.LoadContent(`{"name": "gf"""}`)
+ j, err = gjson.LoadContent([]byte(`{"name": "gf"""}`))
t.AssertNE(err, nil)
j = gjson.New(&g.Map{"name": "gf"})
@@ -263,7 +265,7 @@ func Test_Load_Basic(t *testing.T) {
}
func Test_Load_Ini(t *testing.T) {
- var data = `
+ var data = []byte(`
;注释
@@ -277,7 +279,7 @@ enable=true
user=root
password=password
-`
+`)
gtest.C(t, func(t *gtest.T) {
j, err := gjson.LoadContent(data)
@@ -320,7 +322,7 @@ enable=true
}
func Test_Load_YamlWithV3(t *testing.T) {
- content := `
+ content := []byte(`
# CLI tool, only in development environment.
# https://goframe.org/pages/viewpage.action?pageId=3673173
gfcli:
@@ -355,7 +357,7 @@ gfcli:
noModelComment : true
overwriteDao : true
modelFileForDao : "model_dao.go"
-`
+`)
gtest.C(t, func(t *gtest.T) {
_, err := gjson.LoadContent(content)
t.AssertNil(err)
@@ -363,7 +365,7 @@ gfcli:
}
func Test_Load_Properties(t *testing.T) {
- var data = `
+ var data = []byte(`
#注释
@@ -375,7 +377,7 @@ DBINFO.type=mysql
DBINFO.user=root
DBINFO.password=password
-`
+`)
gtest.C(t, func(t *gtest.T) {
j, err := gjson.LoadContent(data)
diff --git a/encoding/gjson/gjson_z_unit_feature_struct_test.go b/encoding/gjson/gjson_z_unit_feature_struct_test.go
index 49f7c0a4a..df13c1b98 100644
--- a/encoding/gjson/gjson_z_unit_feature_struct_test.go
+++ b/encoding/gjson/gjson_z_unit_feature_struct_test.go
@@ -138,7 +138,7 @@ func Test_Struct1(t *testing.T) {
type UserCollectionAddReq struct {
BaseInfo []BaseInfoItem `db:"_" json:"baseInfo" field:"_"`
}
- jsonContent := `{
+ jsonContent := []byte(`{
"baseInfo": [{
"idCardNumber": "520101199412141111",
"isHouseholder": true,
@@ -195,7 +195,8 @@ func Test_Struct1(t *testing.T) {
"incomeInfo": [],
"liabilityInfo": []
}]
-}`
+}
+`)
data := new(UserCollectionAddReq)
j, err := gjson.LoadJson(jsonContent, true)
t.AssertNil(err)
@@ -218,12 +219,14 @@ func Test_Struct(t *testing.T) {
Items []*Item `json:"items"`
}
- txt := `{
- "id":"88888",
- "me":{"name":"mikey","day":"20009"},
- "txt":"hello",
- "items":null
- }`
+ txt := []byte(`
+{
+ "id":"88888",
+ "me":{"name":"mikey","day":"20009"},
+ "txt":"hello",
+ "items":null
+}
+`)
j, err := gjson.LoadContent(txt)
t.AssertNil(err)
@@ -281,13 +284,15 @@ func Test_Struct_Complicated(t *testing.T) {
}
gtest.C(t, func(t *gtest.T) {
- jsonContent := `{
+ jsonContent := []byte(`
+{
"certList":[
{"certId":"2023313","certInfo":"{\"address\":\"xxxxxxx\",\"phoneNumber\":\"15084890\",\"companyName\":\"dddd\",\"communityCreditCode\":\"91110111MBE1G2B\",\"operateRange\":\"fff\",\"registerNo\":\"91110111MA00G2B\",\"legalPersonName\":\"rrr\"}","srcType":"1","statusCode":"2"},
{"certId":"2023314","certInfo":"{\"identNo\":\"342224196507051\",\"userRealname\":\"xxxx\",\"identType\":\"01\"}","srcType":"8","statusCode":"0"},
{"certId":"2023322","certInfo":"{\"businessLicense\":\"91110111MA00BE1G\",\"companyName\":\"sssss\",\"communityCreditCode\":\"91110111MA00BE1\"}","srcType":"2","statusCode":"0"}
]
-}`
+}
+`)
j, err := gjson.LoadContent(jsonContent)
t.AssertNil(err)
var response = new(Response)
diff --git a/encoding/gjson/gjson_z_unit_internal_test.go b/encoding/gjson/gjson_z_unit_internal_test.go
index 853b839c0..118096823 100644
--- a/encoding/gjson/gjson_z_unit_internal_test.go
+++ b/encoding/gjson/gjson_z_unit_internal_test.go
@@ -18,7 +18,9 @@ func Test_checkDataType(t *testing.T) {
bb = """
dig := dig; END;"""
`)
- t.Assert(checkDataType(data), "toml")
+ dataType, err := checkDataType(data)
+ t.AssertNil(err)
+ t.Assert(dataType, "toml")
})
gtest.C(t, func(t *gtest.T) {
@@ -32,7 +34,9 @@ dd = 11
disk = "127.0.0.1:6379,0"
cache = "127.0.0.1:6379,1"
`)
- t.Assert(checkDataType(data), "toml")
+ dataType, err := checkDataType(data)
+ t.AssertNil(err)
+ t.Assert(dataType, "toml")
})
gtest.C(t, func(t *gtest.T) {
@@ -86,7 +90,9 @@ dd = 11
// fmt.Println(gregex.IsMatch(`[\s\t\n\r]+[\w\-]+\s*:\s*".+"`, data))
// fmt.Println(gregex.IsMatch(`[\n\r]+[\w\-\s\t]+\s*:\s*\w+`, data))
// fmt.Println(gregex.MatchString(`[\n\r]+[\w\-\s\t]+\s*:\s*\w+`, string(data)))
- t.Assert(checkDataType(data), "toml")
+ dataType, err := checkDataType(data)
+ t.AssertNil(err)
+ t.Assert(dataType, "toml")
})
gtest.C(t, func(t *gtest.T) {
@@ -111,7 +117,9 @@ k8s-inner-api = http://127.0.0.1:8081/kube/add
conf_dir = ./config
app_conf = ./config/app.ini
`)
- t.Assert(checkDataType(data), "ini")
+ dataType, err := checkDataType(data)
+ t.AssertNil(err)
+ t.Assert(dataType, "ini")
})
gtest.C(t, func(t *gtest.T) {
@@ -129,6 +137,8 @@ wget http://consul.infra:8500/v1/kv/app_{{.SwimlaneName}}/{{.RepoName}}/.env.qa?
npm run build:qa
"""
`)
- t.Assert(checkDataType(data), "toml")
+ dataType, err := checkDataType(data)
+ t.AssertNil(err)
+ t.Assert(dataType, "toml")
})
}
diff --git a/encoding/gxml/gxml.go b/encoding/gxml/gxml.go
index 2b462de2d..f28d3dbc4 100644
--- a/encoding/gxml/gxml.go
+++ b/encoding/gxml/gxml.go
@@ -49,6 +49,27 @@ func DecodeWithoutRoot(content []byte) (map[string]interface{}, error) {
return m, nil
}
+// XMLEscapeChars forces escaping invalid characters in attribute and element values.
+// NOTE: this is brute force with NO interrogation of '&' being escaped already; if it is
+// then '&' will be re-escaped as '&'.
+//
+/*
+ The values are:
+ " "
+ ' '
+ < <
+ > >
+ & &
+*/
+//
+// Note: if XMLEscapeCharsDecoder(true) has been called - or the default, 'false,' value
+// has been toggled to 'true' - then XMLEscapeChars(true) is ignored. If XMLEscapeChars(true)
+// has already been called before XMLEscapeCharsDecoder(true), XMLEscapeChars(false) is called
+// to turn escape encoding on mv.Xml, etc., to prevent double escaping ampersands, '&'.
+func XMLEscapeChars(b ...bool) {
+ mxj.XMLEscapeChars(b...)
+}
+
// Encode encodes map `m` to an XML format content as bytes.
// The optional parameter `rootTag` is used to specify the XML root tag.
func Encode(m map[string]interface{}, rootTag ...string) ([]byte, error) {
diff --git a/encoding/gxml/gxml_z_unit_test.go b/encoding/gxml/gxml_z_unit_test.go
index 28a8a993f..e519cda81 100644
--- a/encoding/gxml/gxml_z_unit_test.go
+++ b/encoding/gxml/gxml_z_unit_test.go
@@ -206,3 +206,28 @@ func TestErrCase(t *testing.T) {
}
})
}
+
+func Test_Issue3716(t *testing.T) {
+ gtest.C(t, func(t *gtest.T) {
+ var (
+ xml = `I am a software developer & I love coding.john.doe@example.com<>&'"AAA`
+ m = map[string]interface{}{
+ "Person": map[string]interface{}{
+ "Name": "<>&'\"AAA",
+ "Email": "john.doe@example.com",
+ "Bio": "I am a software developer & I love coding.",
+ },
+ }
+ )
+ gxml.XMLEscapeChars(true)
+ defer gxml.XMLEscapeChars(false)
+
+ xb, err := gxml.Encode(m)
+ t.AssertNil(err)
+ t.Assert(string(xb), xml)
+
+ dm, err := gxml.Decode(xb)
+ t.AssertNil(err)
+ t.Assert(dm, m)
+ })
+}
diff --git a/errors/gcode/gcode.go b/errors/gcode/gcode.go
index b3bb1b379..bbbf0e875 100644
--- a/errors/gcode/gcode.go
+++ b/errors/gcode/gcode.go
@@ -46,7 +46,7 @@ var (
CodeNotFound = localCode{65, "Not Found", nil} // Resource does not exist.
CodeInvalidRequest = localCode{66, "Invalid Request", nil} // Invalid request.
CodeNecessaryPackageNotImport = localCode{67, "Necessary Package Not Import", nil} // It needs necessary package import.
- CodeInternalPanic = localCode{68, "Internal Panic", nil} // An panic occurred internally.
+ CodeInternalPanic = localCode{68, "Internal Panic", nil} // A panic occurred internally.
CodeBusinessValidationFailed = localCode{300, "Business Validation Failed", nil} // Business validation failed.
)
diff --git a/errors/gerror/gerror_z_example_test.go b/errors/gerror/gerror_z_example_test.go
index 6d828abbd..a0af3762f 100644
--- a/errors/gerror/gerror_z_example_test.go
+++ b/errors/gerror/gerror_z_example_test.go
@@ -82,3 +82,25 @@ func ExampleIs() {
// true
// false
}
+
+func ExampleCode() {
+ err1 := gerror.NewCode(gcode.CodeInternalError, "permission denied")
+ err2 := gerror.Wrap(err1, "operation failed")
+ fmt.Println(gerror.Code(err1))
+ fmt.Println(gerror.Code(err2))
+
+ // Output:
+ // 50:Internal Error
+ // 50:Internal Error
+}
+
+func ExampleHasCode() {
+ err1 := gerror.NewCode(gcode.CodeInternalError, "permission denied")
+ err2 := gerror.Wrap(err1, "operation failed")
+ fmt.Println(gerror.HasCode(err1, gcode.CodeOK))
+ fmt.Println(gerror.HasCode(err2, gcode.CodeInternalError))
+
+ // Output:
+ // false
+ // true
+}
diff --git a/example/go.mod b/example/go.mod
index 4e530f7d0..7a992faf2 100644
--- a/example/go.mod
+++ b/example/go.mod
@@ -1,61 +1,72 @@
module github.com/gogf/gf/example
-go 1.18
+go 1.21
require (
- github.com/gogf/gf/contrib/config/apollo/v2 v2.7.2
- github.com/gogf/gf/contrib/config/consul/v2 v2.7.2
- github.com/gogf/gf/contrib/config/kubecm/v2 v2.7.2
- github.com/gogf/gf/contrib/config/nacos/v2 v2.7.2
- github.com/gogf/gf/contrib/config/polaris/v2 v2.7.2
- github.com/gogf/gf/contrib/drivers/mysql/v2 v2.7.2
- github.com/gogf/gf/contrib/metric/otelmetric/v2 v2.7.2
- github.com/gogf/gf/contrib/nosql/redis/v2 v2.7.2
- github.com/gogf/gf/contrib/registry/etcd/v2 v2.7.2
- github.com/gogf/gf/contrib/registry/file/v2 v2.7.2
- github.com/gogf/gf/contrib/registry/nacos/v2 v2.7.2
- github.com/gogf/gf/contrib/registry/polaris/v2 v2.7.2
- github.com/gogf/gf/contrib/rpc/grpcx/v2 v2.7.2
- github.com/gogf/gf/contrib/trace/otlpgrpc/v2 v2.7.2
- github.com/gogf/gf/contrib/trace/otlphttp/v2 v2.7.2
- github.com/gogf/gf/v2 v2.7.2
+ github.com/gogf/gf/contrib/config/apollo/v2 v2.8.1
+ github.com/gogf/gf/contrib/config/consul/v2 v2.8.1
+ github.com/gogf/gf/contrib/config/kubecm/v2 v2.8.1
+ github.com/gogf/gf/contrib/config/nacos/v2 v2.8.1
+ github.com/gogf/gf/contrib/config/polaris/v2 v2.8.1
+ github.com/gogf/gf/contrib/drivers/mysql/v2 v2.8.1
+ github.com/gogf/gf/contrib/metric/otelmetric/v2 v2.8.1
+ github.com/gogf/gf/contrib/nosql/redis/v2 v2.8.1
+ github.com/gogf/gf/contrib/registry/etcd/v2 v2.8.1
+ github.com/gogf/gf/contrib/registry/file/v2 v2.8.1
+ github.com/gogf/gf/contrib/registry/nacos/v2 v2.8.1
+ github.com/gogf/gf/contrib/registry/polaris/v2 v2.8.1
+ github.com/gogf/gf/contrib/rpc/grpcx/v2 v2.8.1
+ github.com/gogf/gf/contrib/trace/otlpgrpc/v2 v2.8.1
+ github.com/gogf/gf/contrib/trace/otlphttp/v2 v2.8.1
+ github.com/gogf/gf/v2 v2.8.1
github.com/hashicorp/consul/api v1.24.0
github.com/hashicorp/go-cleanhttp v0.5.2
- github.com/nacos-group/nacos-sdk-go/v2 v2.2.5
- github.com/polarismesh/polaris-go v1.5.5
- github.com/prometheus/client_golang v1.19.0
+ github.com/nacos-group/nacos-sdk-go/v2 v2.2.7
+ github.com/polarismesh/polaris-go v1.5.8
+ github.com/prometheus/client_golang v1.20.2
+ go.opentelemetry.io/otel v1.29.0
+ go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0
+ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0
+ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0
go.opentelemetry.io/otel/exporters/prometheus v0.46.0
- golang.org/x/time v0.5.0
- google.golang.org/grpc v1.60.1
- google.golang.org/protobuf v1.32.0
+ go.opentelemetry.io/otel/sdk v1.29.0
+ golang.org/x/time v0.6.0
+ google.golang.org/grpc v1.67.1
+ google.golang.org/protobuf v1.34.2
k8s.io/client-go v0.27.4
)
require (
- github.com/BurntSushi/toml v1.3.2 // indirect
- github.com/alibabacloud-go/debug v0.0.0-20190504072949-9472017b5c68 // indirect
- github.com/alibabacloud-go/tea v1.1.17 // indirect
+ github.com/BurntSushi/toml v1.4.0 // indirect
+ github.com/alibabacloud-go/darabonba-array v0.1.0 // indirect
+ github.com/alibabacloud-go/darabonba-encode-util v0.0.2 // indirect
+ github.com/alibabacloud-go/darabonba-map v0.0.2 // indirect
+ github.com/alibabacloud-go/darabonba-string v1.0.2 // indirect
+ github.com/alibabacloud-go/debug v1.0.1 // indirect
+ github.com/alibabacloud-go/openapi-util v0.1.0 // indirect
+ github.com/alibabacloud-go/tea v1.2.2 // indirect
github.com/alibabacloud-go/tea-utils v1.4.4 // indirect
- github.com/aliyun/alibaba-cloud-sdk-go v1.62.719 // indirect
- github.com/aliyun/alibabacloud-dkms-gcs-go-sdk v0.2.2 // indirect
- github.com/aliyun/alibabacloud-dkms-transfer-go-sdk v0.1.7 // indirect
+ github.com/alibabacloud-go/tea-utils/v2 v2.0.3 // indirect
+ github.com/aliyun/alibaba-cloud-sdk-go v1.63.7 // indirect
+ github.com/aliyun/alibabacloud-dkms-gcs-go-sdk v0.5.1 // indirect
+ github.com/aliyun/alibabacloud-dkms-transfer-go-sdk v0.1.9 // indirect
github.com/apolloconfig/agollo/v4 v4.3.1 // indirect
github.com/armon/go-metrics v0.4.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/buger/jsonparser v1.1.1 // indirect
- github.com/cenkalti/backoff/v4 v4.2.1 // indirect
- github.com/cespare/xxhash/v2 v2.2.0 // indirect
+ github.com/cenkalti/backoff/v4 v4.3.0 // indirect
+ github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/clbanning/mxj/v2 v2.7.0 // indirect
github.com/coreos/go-semver v0.3.0 // indirect
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
- github.com/dlclark/regexp2 v1.7.0 // indirect
+ github.com/dlclark/regexp2 v1.11.2 // indirect
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
- github.com/fatih/color v1.16.0 // indirect
+ github.com/fatih/color v1.17.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
- github.com/go-logr/logr v1.4.1 // indirect
+ github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.1 // indirect
@@ -63,14 +74,14 @@ require (
github.com/go-sql-driver/mysql v1.7.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/mock v1.6.0 // indirect
- github.com/golang/protobuf v1.5.3 // indirect
+ github.com/golang/protobuf v1.5.4 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.1.0 // indirect
- github.com/google/uuid v1.3.1 // indirect
- github.com/gorilla/websocket v1.5.1 // indirect
+ github.com/google/uuid v1.6.0 // indirect
+ github.com/gorilla/websocket v1.5.3 // indirect
github.com/grokify/html-strip-tags-go v0.1.0 // indirect
- github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 // indirect
+ github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-hclog v1.5.0 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
@@ -82,13 +93,13 @@ require (
github.com/imdario/mergo v0.3.6 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
- github.com/joy999/nacos-sdk-go v0.0.0-20231120071639-10a34b3e7288 // indirect
github.com/json-iterator/go v1.1.12 // indirect
+ github.com/klauspost/compress v1.17.9 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
- github.com/mattn/go-runewidth v0.0.15 // indirect
+ github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
@@ -99,12 +110,12 @@ require (
github.com/opentracing/opentracing-go v1.2.1-0.20220228012449-10b1cf09e00b // indirect
github.com/pelletier/go-toml v1.9.3 // indirect
github.com/pkg/errors v0.9.1 // indirect
- github.com/polarismesh/specification v1.4.1 // indirect
- github.com/prometheus/client_model v0.6.0 // indirect
- github.com/prometheus/common v0.48.0 // indirect
- github.com/prometheus/procfs v0.12.0 // indirect
+ github.com/polarismesh/specification v1.5.1 // indirect
+ github.com/prometheus/client_model v0.6.1 // indirect
+ github.com/prometheus/common v0.55.0 // indirect
+ github.com/prometheus/procfs v0.15.1 // indirect
github.com/redis/go-redis/v9 v9.2.1 // indirect
- github.com/rivo/uniseg v0.4.4 // indirect
+ github.com/rivo/uniseg v0.4.7 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/spf13/afero v1.6.0 // indirect
github.com/spf13/cast v1.3.1 // indirect
@@ -112,34 +123,27 @@ require (
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.8.1 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
+ github.com/tjfoc/gmsm v1.4.1 // indirect
go.etcd.io/etcd/api/v3 v3.5.7 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.7 // indirect
go.etcd.io/etcd/client/v3 v3.5.7 // indirect
go.opentelemetry.io/contrib/instrumentation/runtime v0.49.0 // indirect
- go.opentelemetry.io/otel v1.24.0 // indirect
- go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0 // indirect
- go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.22.0 // indirect
- go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.22.0 // indirect
- go.opentelemetry.io/otel/metric v1.24.0 // indirect
- go.opentelemetry.io/otel/sdk v1.24.0 // indirect
+ go.opentelemetry.io/otel/metric v1.29.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.24.0 // indirect
- go.opentelemetry.io/otel/trace v1.24.0 // indirect
- go.opentelemetry.io/proto/otlp v1.1.0 // indirect
- go.uber.org/atomic v1.11.0 // indirect
- go.uber.org/multierr v1.11.0 // indirect
+ go.opentelemetry.io/otel/trace v1.29.0 // indirect
+ go.opentelemetry.io/proto/otlp v1.3.1 // indirect
+ go.uber.org/multierr v1.10.0 // indirect
go.uber.org/zap v1.26.0 // indirect
- golang.org/x/crypto v0.22.0 // indirect
+ golang.org/x/crypto v0.27.0 // indirect
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
- golang.org/x/net v0.24.0 // indirect
- golang.org/x/oauth2 v0.16.0 // indirect
- golang.org/x/sync v0.6.0 // indirect
- golang.org/x/sys v0.19.0 // indirect
- golang.org/x/term v0.19.0 // indirect
- golang.org/x/text v0.14.0 // indirect
- google.golang.org/appengine v1.6.8 // indirect
- google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917 // indirect
- google.golang.org/genproto/googleapis/api v0.0.0-20240116215550-a9fa1716bcac // indirect
- google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac // indirect
+ golang.org/x/net v0.29.0 // indirect
+ golang.org/x/oauth2 v0.22.0 // indirect
+ golang.org/x/sync v0.8.0 // indirect
+ golang.org/x/sys v0.25.0 // indirect
+ golang.org/x/term v0.24.0 // indirect
+ golang.org/x/text v0.18.0 // indirect
+ google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
diff --git a/example/go.sum b/example/go.sum
index 7e6a37b3a..ccada6a1c 100644
--- a/example/go.sum
+++ b/example/go.sum
@@ -169,8 +169,8 @@ cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1V
cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
-github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
-github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
+github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
+github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo=
@@ -183,20 +183,39 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
-github.com/alibabacloud-go/debug v0.0.0-20190504072949-9472017b5c68 h1:NqugFkGxx1TXSh/pBcU00Y6bljgDPaFdh5MUSeJ7e50=
+github.com/alibabacloud-go/darabonba-array v0.1.0 h1:vR8s7b1fWAQIjEjWnuF0JiKsCvclSRTfDzZHTYqfufY=
+github.com/alibabacloud-go/darabonba-array v0.1.0/go.mod h1:BLKxr0brnggqOJPqT09DFJ8g3fsDshapUD3C3aOEFaI=
+github.com/alibabacloud-go/darabonba-encode-util v0.0.2 h1:1uJGrbsGEVqWcWxrS9MyC2NG0Ax+GpOM5gtupki31XE=
+github.com/alibabacloud-go/darabonba-encode-util v0.0.2/go.mod h1:JiW9higWHYXm7F4PKuMgEUETNZasrDM6vqVr/Can7H8=
+github.com/alibabacloud-go/darabonba-map v0.0.2 h1:qvPnGB4+dJbJIxOOfawxzF3hzMnIpjmafa0qOTp6udc=
+github.com/alibabacloud-go/darabonba-map v0.0.2/go.mod h1:28AJaX8FOE/ym8OUFWga+MtEzBunJwQGceGQlvaPGPc=
+github.com/alibabacloud-go/darabonba-string v1.0.2 h1:E714wms5ibdzCqGeYJ9JCFywE5nDyvIXIIQbZVFkkqo=
+github.com/alibabacloud-go/darabonba-string v1.0.2/go.mod h1:93cTfV3vuPhhEwGGpKKqhVW4jLe7tDpo3LUM0i0g6mA=
github.com/alibabacloud-go/debug v0.0.0-20190504072949-9472017b5c68/go.mod h1:6pb/Qy8c+lqua8cFpEy7g39NRRqOWc3rOwAy8m5Y2BY=
+github.com/alibabacloud-go/debug v1.0.0/go.mod h1:8gfgZCCAC3+SCzjWtY053FrOcd4/qlH6IHTI4QyICOc=
+github.com/alibabacloud-go/debug v1.0.1 h1:MsW9SmUtbb1Fnt3ieC6NNZi6aEwrXfDksD4QA6GSbPg=
+github.com/alibabacloud-go/debug v1.0.1/go.mod h1:8gfgZCCAC3+SCzjWtY053FrOcd4/qlH6IHTI4QyICOc=
+github.com/alibabacloud-go/openapi-util v0.1.0 h1:0z75cIULkDrdEhkLWgi9tnLe+KhAFE/r5Pb3312/eAY=
+github.com/alibabacloud-go/openapi-util v0.1.0/go.mod h1:sQuElr4ywwFRlCCberQwKRFhRzIyG4QTP/P4y1CJ6Ws=
github.com/alibabacloud-go/tea v1.1.0/go.mod h1:IkGyUSX4Ba1V+k4pCtJUc6jDpZLFph9QMy2VUPTwukg=
-github.com/alibabacloud-go/tea v1.1.17 h1:05R5DnaJXe9sCNIe8KUgWHC/z6w/VZIwczgUwzRnul8=
+github.com/alibabacloud-go/tea v1.1.7/go.mod h1:/tmnEaQMyb4Ky1/5D+SE1BAsa5zj/KeGOFfwYm3N/p4=
+github.com/alibabacloud-go/tea v1.1.11/go.mod h1:/tmnEaQMyb4Ky1/5D+SE1BAsa5zj/KeGOFfwYm3N/p4=
github.com/alibabacloud-go/tea v1.1.17/go.mod h1:nXxjm6CIFkBhwW4FQkNrolwbfon8Svy6cujmKFUq98A=
+github.com/alibabacloud-go/tea v1.2.1/go.mod h1:qbzof29bM/IFhLMtJPrgTGK3eauV5J2wSyEUo4OEmnA=
+github.com/alibabacloud-go/tea v1.2.2 h1:aTsR6Rl3ANWPfqeQugPglfurloyBJY85eFy7Gc1+8oU=
+github.com/alibabacloud-go/tea v1.2.2/go.mod h1:CF3vOzEMAG+bR4WOql8gc2G9H3EkH3ZLAQdpmpXMgwk=
+github.com/alibabacloud-go/tea-utils v1.3.1/go.mod h1:EI/o33aBfj3hETm4RLiAxF/ThQdSngxrpF8rKUDJjPE=
github.com/alibabacloud-go/tea-utils v1.4.4 h1:lxCDvNCdTo9FaXKKq45+4vGETQUKNOW/qKTcX9Sk53o=
github.com/alibabacloud-go/tea-utils v1.4.4/go.mod h1:KNcT0oXlZZxOXINnZBs6YvgOd5aYp9U67G+E3R8fcQw=
+github.com/alibabacloud-go/tea-utils/v2 v2.0.3 h1:6OM8vm/6pjQg1a7zc3QNMviaoumnhImRi5V84CnuFkc=
+github.com/alibabacloud-go/tea-utils/v2 v2.0.3/go.mod h1:sj1PbjPodAVTqGTA3olprfeeqqmwD0A5OQz94o9EuXQ=
github.com/aliyun/alibaba-cloud-sdk-go v1.61.1800/go.mod h1:RcDobYh8k5VP6TNybz9m++gL3ijVI5wueVr0EM10VsU=
-github.com/aliyun/alibaba-cloud-sdk-go v1.62.719 h1:ZYBHflrrLzobuUZ7RE1MZYskFFVx0JtpkIURmOJFCG8=
-github.com/aliyun/alibaba-cloud-sdk-go v1.62.719/go.mod h1:SOSDHfe1kX91v3W5QiBsWSLqeLxImobbMX1mxrFHsVQ=
-github.com/aliyun/alibabacloud-dkms-gcs-go-sdk v0.2.2 h1:rWkH6D2XlXb/Y+tNAQROxBzp3a0p92ni+pXcaHBe/WI=
-github.com/aliyun/alibabacloud-dkms-gcs-go-sdk v0.2.2/go.mod h1:GDtq+Kw+v0fO+j5BrrWiUHbBq7L+hfpzpPfXKOZMFE0=
-github.com/aliyun/alibabacloud-dkms-transfer-go-sdk v0.1.7 h1:olLiPI2iM8Hqq6vKnSxpM3awCrm9/BeOgHpzQkOYnI4=
-github.com/aliyun/alibabacloud-dkms-transfer-go-sdk v0.1.7/go.mod h1:oDg1j4kFxnhgftaiLJABkGeSvuEvSF5Lo6UmRAMruX4=
+github.com/aliyun/alibaba-cloud-sdk-go v1.63.7 h1:MOFLOVlBI1MvP4I0cwb9cXf83GNcMss1btQqjbp11CM=
+github.com/aliyun/alibaba-cloud-sdk-go v1.63.7/go.mod h1:SOSDHfe1kX91v3W5QiBsWSLqeLxImobbMX1mxrFHsVQ=
+github.com/aliyun/alibabacloud-dkms-gcs-go-sdk v0.5.1 h1:nJYyoFP+aqGKgPs9JeZgS1rWQ4NndNR0Zfhh161ZltU=
+github.com/aliyun/alibabacloud-dkms-gcs-go-sdk v0.5.1/go.mod h1:WzGOmFFTlUzXM03CJnHWMQ85UN6QGpOXZocCjwkiyOg=
+github.com/aliyun/alibabacloud-dkms-transfer-go-sdk v0.1.9 h1:GCzdF5XjQ6LED6wdvEq2MKSlBQmQDkvYRw2S8Qnbo4Y=
+github.com/aliyun/alibabacloud-dkms-transfer-go-sdk v0.1.9/go.mod h1:xP0KIZry6i7oGPF24vhAPr1Q8vLZRcMcxtft5xDKwCU=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/apolloconfig/agollo/v4 v4.3.1 h1:NHjd7KqOPmTvYwJidISc9MPBRO8m9UNrH3tijcEVNAY=
github.com/apolloconfig/agollo/v4 v4.3.1/go.mod h1:n/7qxpKOTbegygLmO5OKmFWCdy3T+S/zioBGlo457Dk=
@@ -214,17 +233,19 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM=
github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs=
+github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c=
github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA=
+github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0=
github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs=
github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0=
-github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
-github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
+github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
+github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
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/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
-github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
-github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
+github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
+github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
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=
@@ -253,8 +274,9 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
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/dlclark/regexp2 v1.7.0 h1:7lJfhqlPssTb1WQx4yvTHN0uElPEv52sbaECrAQxjAo=
github.com/dlclark/regexp2 v1.7.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
+github.com/dlclark/regexp2 v1.11.2 h1:/u628IuisSTwri5/UKloiIsH8+qF2Pu7xEQX+yIKg68=
+github.com/dlclark/regexp2 v1.11.2/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE=
github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
@@ -273,8 +295,8 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
-github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
-github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
+github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
+github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
@@ -291,8 +313,8 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
github.com/go-logr/logr v1.2.0/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.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
-github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
+github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
+github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE=
@@ -305,6 +327,7 @@ github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrt
github.com/go-sql-driver/mysql v1.7.1/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 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I=
+github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
@@ -342,8 +365,8 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw
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/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/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
+github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/gonum/blas v0.0.0-20181208220705-f22b278b28ac/go.mod h1:P32wAyui1PQ58Oce/KYkOqQv8cVw1zAapXOl+dRFGbc=
github.com/gonum/floats v0.0.0-20181209220543-c233463c7e82/go.mod h1:PxC8OnwL11+aosOB5+iEPoV3picfs8tUpkVd0pDo+Kg=
@@ -355,6 +378,7 @@ github.com/gonum/stat v0.0.0-20181125101827-41a0da705a5b/go.mod h1:Z4GIJBJO3Wa4g
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 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4=
+github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA=
github.com/google/gnostic v0.5.7-v3refs h1:FhTMOKj2VhjpouxvWJAV1TL304uMlb9zcDqkl6cEI54=
github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
@@ -398,8 +422,8 @@ github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLe
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
-github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4=
-github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
+github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8=
github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
@@ -413,18 +437,19 @@ github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqE
github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
-github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
-github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
+github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
+github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grokify/html-strip-tags-go v0.1.0 h1:03UrQLjAny8xci+R+qjCce/MYnpNXCtgzltlQbOBae4=
github.com/grokify/html-strip-tags-go v0.1.0/go.mod h1:ZdzgfHEzAfz9X6Xe5eBLVblWIxXfYSQ40S/VKrAOGpc=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
-github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 h1:Wqo399gCIufwto+VfwCSvsnfGpF/w5E9CNxSwbpD6No=
-github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0/go.mod h1:qmOFXW2epJhM0qSnUUYpldc7gVz2KMQwJ/QYCDIa7XU=
+github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 h1:asbCHRVmodnJTuQ3qamDwqVOIjwqUPTYmYuemVOx+Ys=
+github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0/go.mod h1:ggCgvZ2r7uOoQjOyu2Y1NhHmEPPzzuhWgcza5M1Ji1I=
github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q=
github.com/hashicorp/consul/api v1.24.0 h1:u2XyStA2j0jnCiVUU7Qyrt8idjRn4ORhK6DlvZ3bWhA=
github.com/hashicorp/consul/api v1.24.0/go.mod h1:NZJGRFYruc/80wYowkPFCp1LbGmJC9L8izrwfyVx/Wg=
github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8=
github.com/hashicorp/consul/sdk v0.14.1 h1:ZiwE2bKb+zro68sWzZ1SgHF3kRMBZ94TwOCFRF4ylPs=
+github.com/hashicorp/consul/sdk v0.14.1/go.mod h1:vFt03juSzocLRFo59NkeQHHmQa6+g7oU0pfzdI1mUhg=
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=
@@ -439,6 +464,7 @@ github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJ
github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=
github.com/hashicorp/go-msgpack v0.5.5 h1:i9R9JSrqIz0QVLz3sz+i3YJdT7TTSLcfLLzJi9aZTuI=
+github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA=
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
@@ -449,11 +475,14 @@ github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5O
github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8=
github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU=
github.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0SyteCQc=
+github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A=
github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4=
github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8=
+github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-version v1.2.1 h1:zEfKbn2+PDgroKdiOzqiE8rsmLqU2uwi5PB5pBJ3TkI=
+github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
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=
@@ -481,8 +510,6 @@ github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGw
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
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/joy999/nacos-sdk-go v0.0.0-20231120071639-10a34b3e7288 h1:GuL6co0J2oMb2Rd/hbxZfJz1QlZr+DpIsz3Wcvok65o=
-github.com/joy999/nacos-sdk-go v0.0.0-20231120071639-10a34b3e7288/go.mod h1:xF3RcNkFUEIik3RCihkvgORtZXZXlp+OeGK0aUALVYU=
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
@@ -500,6 +527,8 @@ github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8
github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes=
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/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=
+github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
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.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
@@ -508,10 +537,13 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN
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.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/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/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
+github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60=
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
@@ -533,8 +565,8 @@ github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
-github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U=
-github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
+github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc=
+github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso=
@@ -564,15 +596,17 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
-github.com/nacos-group/nacos-sdk-go/v2 v2.2.5 h1:r0wwT7PayEjvEHzWXwr1ROi/JSqzujM4w+1L5ikThzQ=
-github.com/nacos-group/nacos-sdk-go/v2 v2.2.5/go.mod h1:OObBon0prVJVPoIbSZxpEkFiBfL0d1LcBtuAMiNn+8c=
+github.com/nacos-group/nacos-sdk-go/v2 v2.2.7 h1:wCC1f3/VzIR1WD30YKeJGZAOchYCK/35mLC8qWt6Q6o=
+github.com/nacos-group/nacos-sdk-go/v2 v2.2.7/go.mod h1:VYlyDPlQchPC31PmfBustu81vsOkdpCuO5k0dRdQcFc=
github.com/natefinch/lumberjack v2.0.0+incompatible h1:4QJd3OLAMgj7ph+yZTuX13Ld4UpgHp07nNdFX7mqFfM=
github.com/natefinch/lumberjack v2.0.0+incompatible/go.mod h1:Wi9p2TTF5DG5oU+6YfsmYQpsTIOm0B1VNzQg9Mw6nPk=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
github.com/onsi/ginkgo/v2 v2.9.1 h1:zie5Ly042PD3bsCvsSOPvRnFwyo3rKe64TJlD6nu0mk=
+github.com/onsi/ginkgo/v2 v2.9.1/go.mod h1:FEcmzVcCHl+4o9bQZVab+4dC9+j+91t2FHSzmGAPfuo=
github.com/onsi/gomega v1.27.4 h1:Z2AnStgsdSayCMDiCU42qIz+HLqEPcgiOCXjAU/w+8E=
+github.com/onsi/gomega v1.27.4/go.mod h1:riYq/GJKh8hhoM01HN6Vmuy93AarCXCBGpvFDK3q3fQ=
github.com/opentracing/opentracing-go v1.2.1-0.20220228012449-10b1cf09e00b h1:FfH+VrHHk6Lxt9HdVS0PXzSXFyS2NbZKXv33FYPol0A=
github.com/opentracing/opentracing-go v1.2.1-0.20220228012449-10b1cf09e00b/go.mod h1:AC62GU6hc0BrNm+9RK9VSiwa/EUe1bkIeFORAMcHvJU=
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
@@ -587,10 +621,12 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
-github.com/polarismesh/polaris-go v1.5.5 h1:TUxgla21J9Zb3zSynoAA9og0+sYJZ7TpZ2aFwzH7woI=
-github.com/polarismesh/polaris-go v1.5.5/go.mod h1:CuXO9bhHGjSoOIMWr4NXf3bJAkRBp5YoM7ibBzENC+c=
-github.com/polarismesh/specification v1.4.1 h1:lTZqeyUhhWuKyr6NDKBwmUrNfcUDvKLxWT/uOq71T5A=
+github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/polarismesh/polaris-go v1.5.8 h1:zBZkZBa4wVxsG5Y/6U4PmY9dY/mddXdfNI65edVu6U8=
+github.com/polarismesh/polaris-go v1.5.8/go.mod h1:CuXO9bhHGjSoOIMWr4NXf3bJAkRBp5YoM7ibBzENC+c=
github.com/polarismesh/specification v1.4.1/go.mod h1:rDvMMtl5qebPmqiBLNa5Ps0XtwkP31ZLirbH4kXA0YU=
+github.com/polarismesh/specification v1.5.1 h1:cJ2m0RBepdopGo/e3UpKdsab3NpDZnw5IsVTB1sFc5I=
+github.com/polarismesh/specification v1.5.1/go.mod h1:rDvMMtl5qebPmqiBLNa5Ps0XtwkP31ZLirbH4kXA0YU=
github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
@@ -599,37 +635,38 @@ github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3O
github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0=
github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY=
-github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU=
-github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k=
+github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg=
+github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
-github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos=
-github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8=
+github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
+github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4=
github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc=
github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls=
-github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE=
-github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc=
+github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc=
+github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
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/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
-github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
+github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
+github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
github.com/redis/go-redis/v9 v9.2.1 h1:WlYJg71ODF0dVspZZCpYmoF1+U1Jjk9Rwd7pq6QmlCg=
github.com/redis/go-redis/v9 v9.2.1/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
-github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
-github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
+github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
+github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
+github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
@@ -672,11 +709,15 @@ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1F
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
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.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/tevid/gohamcrest v1.1.1 h1:ou+xSqlIw1xfGTg1uq1nif/htZ2S3EzRqLm2BP+tYU0=
github.com/tevid/gohamcrest v1.1.1/go.mod h1:3UvtWlqm8j5JbwYZh80D/PVBt0mJ1eJiYgZMibh0H/k=
+github.com/tjfoc/gmsm v1.3.2/go.mod h1:HaUcFuY0auTiaHB9MHFGCPx5IaLhTUd2atbCFBQXn9w=
+github.com/tjfoc/gmsm v1.4.1 h1:aMe1GlZb+0bLjn+cKTPEvvn9oUEBlJitaZiiBwsbgho=
+github.com/tjfoc/gmsm v1.4.1/go.mod h1:j4INPkHWMrhJb38G+J6W4Tw0AbuN8Thu3PbdVYhVcTE=
github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM=
github.com/uber/jaeger-client-go v2.30.0+incompatible h1:D6wyKGCecFaSRUpo8lCVbaOOb6ThwMmTEbhRwtKR97o=
github.com/uber/jaeger-client-go v2.30.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk=
@@ -684,6 +725,7 @@ github.com/uber/jaeger-lib v2.4.1+incompatible h1:td4jdvLcExb4cBISKIpHuGoVXh+dVK
github.com/uber/jaeger-lib v2.4.1+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
+github.com/yuin/goldmark v1.1.30/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
@@ -706,36 +748,37 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
go.opentelemetry.io/contrib/instrumentation/runtime v0.49.0 h1:dg9y+7ArpumB6zwImJv47RHfdgOGQ1EMkzP5vLkEnTU=
go.opentelemetry.io/contrib/instrumentation/runtime v0.49.0/go.mod h1:Ul4MtXqu/hJBM+v7a6dCF0nHwckPMLpIpLeCi4+zfdw=
-go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
-go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0 h1:9M3+rhx7kZCIQQhQRYaZCdNu1V73tm4TvXs2ntl98C4=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0/go.mod h1:noq80iT8rrHP1SfybmPiRGc9dc5M8RPmGvtwo7Oo7tc=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.22.0 h1:H2JFgRcGiyHg7H7bwcwaQJYrNFqCqrbTQ8K4p1OvDu8=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.22.0/go.mod h1:WfCWp1bGoYK8MeULtI15MmQVczfR+bFkk0DF3h06QmQ=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.22.0 h1:FyjCyI9jVEfqhUh2MoSkmolPjfh5fp2hnV0b0irxH4Q=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.22.0/go.mod h1:hYwym2nDEeZfG/motx0p7L7J1N1vyzIThemQsb4g2qY=
+go.opentelemetry.io/otel v1.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw=
+go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0 h1:dIIDULZJpgdiHz5tXrTgKIMLkus6jEFa7x5SOKcyR7E=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0/go.mod h1:jlRVBe7+Z1wyxFSUs48L6OBQZ5JwH2Hg/Vbl+t9rAgI=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0 h1:nSiV3s7wiCam610XcLbYOmMfJxB9gO4uK3Xgv5gmTgg=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0/go.mod h1:hKn/e/Nmd19/x1gvIHwtOwVWM+VhuITSWip3JUDghj0=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0 h1:JAv0Jwtl01UFiyWZEMiJZBiTlv5A50zNs8lsthXqIio=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0/go.mod h1:QNKLmUEAq2QUbPQUfvw4fmv0bgbK7UlOSFCnXyfvSNc=
go.opentelemetry.io/otel/exporters/prometheus v0.46.0 h1:I8WIFXR351FoLJYuloU4EgXbtNX2URfU/85pUPheIEQ=
go.opentelemetry.io/otel/exporters/prometheus v0.46.0/go.mod h1:ztwVUHe5DTR/1v7PeuGRnU5Bbd4QKYwApWmuutKsJSs=
-go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
-go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
-go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
-go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
+go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc=
+go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8=
+go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo=
+go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok=
go.opentelemetry.io/otel/sdk/metric v1.24.0 h1:yyMQrPzF+k88/DbH7o4FMAs80puqd+9osbiBrJrz/w8=
go.opentelemetry.io/otel/sdk/metric v1.24.0/go.mod h1:I6Y5FjH6rvEnTTAYQz3Mmv2kl6Ek5IIrmwTLqMrrOE0=
-go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
-go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
+go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4=
+go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ=
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
-go.opentelemetry.io/proto/otlp v1.1.0 h1:2Di21piLrCqJ3U3eXGCTPHE9R8Nh+0uglSnOyxikMeI=
-go.opentelemetry.io/proto/otlp v1.1.0/go.mod h1:GpBHCBWiqvVLDqmHZsoMM3C5ySeKTC7ej/RNTae6MdY=
+go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0=
+go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
-go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=
-go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
+go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ=
+go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
+go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
-go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
-go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
+go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ=
+go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo=
go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw=
go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo=
@@ -748,11 +791,15 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
+golang.org/x/crypto v0.0.0-20191219195013-becbf705a915/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-20201012173705-84dcc777aaee/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
-golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30=
-golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M=
+golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I=
+golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg=
+golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A=
+golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70=
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=
@@ -795,6 +842,7 @@ 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.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
+golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
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-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -826,6 +874,7 @@ golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/
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-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
+golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
@@ -848,8 +897,13 @@ golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
-golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
-golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
+golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
+golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
+golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
+golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ=
+golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=
+golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo=
+golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -874,8 +928,8 @@ golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7Lm
golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE=
golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg=
golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg=
-golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ=
-golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o=
+golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA=
+golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -889,8 +943,9 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ=
-golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
+golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
+golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
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=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -924,6 +979,7 @@ golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200509044756-6aff5f38e54f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -975,14 +1031,22 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.2.0/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.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
-golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=
+golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
-golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q=
-golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk=
+golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
+golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
+golang.org/x/term v0.9.0/go.mod h1:M6DEAAIenWoTxdKrOltXcmDY3rSplQUkrvaDU5FcQyo=
+golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY=
+golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM=
+golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -992,15 +1056,18 @@ 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.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
-golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
+golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
+golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
+golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
+golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224=
+golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
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.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
-golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
+golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U=
+golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
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=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
@@ -1040,6 +1107,7 @@ golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjs
golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
+golang.org/x/tools v0.0.0-20200509030707-2212a7e161a5/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
@@ -1060,7 +1128,9 @@ 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/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
-golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc=
+golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
+golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg=
+golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
@@ -1126,8 +1196,6 @@ google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
-google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM=
-google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
@@ -1227,12 +1295,10 @@ google.golang.org/genproto v0.0.0-20220920201722-2b89144ce006/go.mod h1:ht8XFiar
google.golang.org/genproto v0.0.0-20220926165614-551eb538f295/go.mod h1:woMGP53BroOrRY3xTxlbr8Y3eB/nzAvvFM83q7kG2OI=
google.golang.org/genproto v0.0.0-20220926220553-6981cbe3cfce/go.mod h1:woMGP53BroOrRY3xTxlbr8Y3eB/nzAvvFM83q7kG2OI=
google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM=
-google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917 h1:nz5NESFLZbJGPFxDT/HCn+V1mZ8JGNoY4nUpmW/Y2eg=
-google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917/go.mod h1:pZqR+glSb11aJ+JQcczCvgf47+duRuzNSKqE8YAQnV0=
-google.golang.org/genproto/googleapis/api v0.0.0-20240116215550-a9fa1716bcac h1:OZkkudMUu9LVQMCoRUbI/1p5VCo9BOrlvkqMvWtqa6s=
-google.golang.org/genproto/googleapis/api v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:B5xPO//w8qmBDjGReYLpR6UJPnkldGkCSMoH/2vxJeg=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac h1:nUQEQmH/csSvFECKYRv6HWEyypysidKl2I6Qpsglq/0=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:daQN87bsDqDoe316QbbvX60nMoJQa4r6Ds0ZuoAe5yA=
+google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 h1:hjSy6tcFQZ171igDaN5QHOw2n6vx40juYbC/x67CEhc=
+google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:qpvKtACPCQhAdu3PyQgV4l3LMXZEtft7y8QcarRsp9I=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
@@ -1268,8 +1334,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu
google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI=
google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI=
google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww=
-google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU=
-google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM=
+google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E=
+google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA=
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=
@@ -1286,8 +1352,9 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
-google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
-google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
+google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
+google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
+google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
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=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
diff --git a/example/trace/README.MD b/example/trace/README.MD
new file mode 100644
index 000000000..3fc728b3d
--- /dev/null
+++ b/example/trace/README.MD
@@ -0,0 +1,80 @@
+# OpenTelemetry Protocol (stable)
+
+Since v1.35, the Jaeger backend can receive trace data from the OpenTelemetry SDKs in their native OpenTelemetry Protocol (OTLP) . It is no longer necessary to configure the OpenTelemetry SDKs with Jaeger exporters, nor deploy the OpenTelemetry Collector between the OpenTelemetry SDKs and the Jaeger backend.
+
+The OTLP data is accepted in these formats: (1) binary gRPC, (2) Protobuf over HTTP, (3) JSON over HTTP. For more details on the OTLP receiver see the official documentation . Note that not all configuration options are supported in jaeger-collector (see --collector.otlp.* CLI Flags ), and only tracing data is accepted, since Jaeger does not store other telemetry types.
+
+|Port |Protocol |Endpoint |Format|
+|---|---|---|---|
+|4317 |gRPC |n/a |Protobuf|
+|4318 |HTTP |/v1/traces |Protobuf or JSON|
+
+Two ports, 4317 and 4318, have also been added to the export list, which are used by OTLP receivers to listen for gRPC and HTTP connections.
+
+## All in One
+all-in-one is an executable designed for quick local testing. It includes the Jaeger UI, jaeger-collector, jaeger-query, and jaeger-agent, with an in memory storage component.
+
+The simplest way to start the all-in-one is to use the pre-built image published to DockerHub (a single command line).
+
+```shell
+docker run --rm --name jaeger \
+ -e COLLECTOR_ZIPKIN_HOST_PORT=:9411 \
+ -p 6831:6831/udp \
+ -p 6832:6832/udp \
+ -p 5778:5778 \
+ -p 16686:16686 \
+ -p 4317:4317 \
+ -p 4318:4318 \
+ -p 14250:14250 \
+ -p 14268:14268 \
+ -p 14269:14269 \
+ -p 9411:9411 \
+ jaegertracing/all-in-one:1.55
+
+```
+
+Or run the `jaeger-all-in-one(.exe)` executable from the [binary distribution archives][download]:
+
+```bash
+jaeger-all-in-one --collector.zipkin.host-port=:9411
+```
+
+You can then navigate to `http://localhost:16686` to access the Jaeger UI.
+
+The container exposes the following ports:
+
+Port | Protocol | Component | Function
+----- | ------- | --------- | ---
+6831 | UDP | agent | accept `jaeger.thrift` over Thrift-compact protocol (used by most SDKs)
+6832 | UDP | agent | accept `jaeger.thrift` over Thrift-binary protocol (used by Node.js SDK)
+5775 | UDP | agent | (deprecated) accept `zipkin.thrift` over compact Thrift protocol (used by legacy clients only)
+5778 | HTTP | agent | serve configs (sampling, etc.)
+16686 | HTTP | query | serve frontend
+4317 | HTTP | collector | accept OpenTelemetry Protocol (OTLP) over gRPC
+4318 | HTTP | collector | accept OpenTelemetry Protocol (OTLP) over HTTP
+14268 | HTTP | collector | accept `jaeger.thrift` directly from clients
+14250 | HTTP | collector | accept `model.proto`
+9411 | HTTP | collector | Zipkin compatible endpoint (optional)
+
+https://www.jaegertracing.io/docs/1.55/apis/#opentelemetry-protocol-stable
+
+Read more details:
+
+Introducing native support for OpenTelemetry in Jaeger
+
+https://medium.com/jaegertracing/introducing-native-support-for-opentelemetry-in-jaeger-eb661be8183c
+
+Better alignment with OpenTelemetry by focusing on OTLP
+
+https://medium.com/jaegertracing/better-alignment-with-opentelemetry-by-focusing-on-otlp-f3688939073f
+
+
+
+# Jaeger
+
+Open Source, End-to-End Distributed Tracing. Hosted by Cloud Native Computing Foundation.
+
+https://medium.com/jaegertracing
+
+
+## For more information on distributed tracing initialization, please refer to the content in the [provider](./provider) directory
\ No newline at end of file
diff --git a/example/trace/grpc-with-db/client/client.go b/example/trace/grpc-with-db/client/client.go
index ea0b754f5..22823eca9 100644
--- a/example/trace/grpc-with-db/client/client.go
+++ b/example/trace/grpc-with-db/client/client.go
@@ -25,12 +25,15 @@ const (
func main() {
grpcx.Resolver.Register(etcd.New("127.0.0.1:2379"))
- var ctx = gctx.New()
- shutdown, err := otlpgrpc.Init(serviceName, endpoint, traceToken)
+ var (
+ ctx = gctx.New()
+ shutdown, err = otlpgrpc.Init(serviceName, endpoint, traceToken)
+ )
+
if err != nil {
g.Log().Fatal(ctx, err)
}
- defer shutdown()
+ defer shutdown(ctx)
StartRequests()
}
diff --git a/example/trace/grpc-with-db/server/server.go b/example/trace/grpc-with-db/server/server.go
index 286890d55..6ef4d3a3c 100644
--- a/example/trace/grpc-with-db/server/server.go
+++ b/example/trace/grpc-with-db/server/server.go
@@ -38,12 +38,15 @@ const (
func main() {
grpcx.Resolver.Register(etcd.New("127.0.0.1:2379"))
- var ctx = gctx.New()
- shutdown, err := otlpgrpc.Init(serviceName, endpoint, traceToken)
+ var (
+ ctx = gctx.New()
+ shutdown, err = otlpgrpc.Init(serviceName, endpoint, traceToken)
+ )
+
if err != nil {
g.Log().Fatal(ctx, err)
}
- defer shutdown()
+ defer shutdown(ctx)
// Set ORM cache adapter with redis.
g.DB().GetCache().SetAdapter(gcache.NewAdapterRedis(g.Redis()))
diff --git a/example/trace/http-with-db/client/client.go b/example/trace/http-with-db/client/client.go
index c4f4ec5ae..24afdcc70 100644
--- a/example/trace/http-with-db/client/client.go
+++ b/example/trace/http-with-db/client/client.go
@@ -22,12 +22,15 @@ const (
)
func main() {
- var ctx = gctx.New()
- shutdown, err := otlphttp.Init(serviceName, endpoint, path)
+ var (
+ ctx = gctx.New()
+ shutdown, err = otlphttp.Init(serviceName, endpoint, path)
+ )
+
if err != nil {
g.Log().Fatal(ctx, err)
}
- defer shutdown()
+ defer shutdown(ctx)
StartRequests()
}
diff --git a/example/trace/http-with-db/server/server.go b/example/trace/http-with-db/server/server.go
index f754f0ea5..fd31dba16 100644
--- a/example/trace/http-with-db/server/server.go
+++ b/example/trace/http-with-db/server/server.go
@@ -29,12 +29,15 @@ const (
)
func main() {
- var ctx = gctx.New()
- shutdown, err := otlphttp.Init(serviceName, endpoint, path)
+ var (
+ ctx = gctx.New()
+ shutdown, err = otlphttp.Init(serviceName, endpoint, path)
+ )
+
if err != nil {
g.Log().Fatal(ctx, err)
}
- defer shutdown()
+ defer shutdown(ctx)
// Set ORM cache adapter with redis.
g.DB().GetCache().SetAdapter(gcache.NewAdapterRedis(g.Redis()))
diff --git a/example/trace/http/client/client.go b/example/trace/http/client/client.go
index 84abb05fd..d09226075 100644
--- a/example/trace/http/client/client.go
+++ b/example/trace/http/client/client.go
@@ -20,12 +20,14 @@ const (
)
func main() {
- var ctx = gctx.New()
- shutdown, err := otlphttp.Init(serviceName, endpoint, path)
+ var (
+ ctx = gctx.New()
+ shutdown, err = otlphttp.Init(serviceName, endpoint, path)
+ )
if err != nil {
g.Log().Fatal(ctx, err)
}
- defer shutdown()
+ defer shutdown(ctx)
StartRequests()
}
diff --git a/example/trace/http/server/server.go b/example/trace/http/server/server.go
index 975dc27e7..2616df9cd 100644
--- a/example/trace/http/server/server.go
+++ b/example/trace/http/server/server.go
@@ -21,12 +21,15 @@ const (
)
func main() {
- var ctx = gctx.New()
- shutdown, err := otlphttp.Init(serviceName, endpoint, path)
+ var (
+ ctx = gctx.New()
+ shutdown, err = otlphttp.Init(serviceName, endpoint, path)
+ )
+
if err != nil {
g.Log().Fatal(ctx, err)
}
- defer shutdown()
+ defer shutdown(ctx)
s := g.Server()
s.Group("/", func(group *ghttp.RouterGroup) {
diff --git a/example/trace/inprocess-grpc/main.go b/example/trace/inprocess-grpc/main.go
index 67640ffc5..bf8052ab6 100644
--- a/example/trace/inprocess-grpc/main.go
+++ b/example/trace/inprocess-grpc/main.go
@@ -23,12 +23,15 @@ const (
)
func main() {
- var ctx = gctx.New()
- shutdown, err := otlpgrpc.Init(serviceName, endpoint, traceToken)
+ var (
+ ctx = gctx.New()
+ shutdown, err = otlpgrpc.Init(serviceName, endpoint, traceToken)
+ )
+
if err != nil {
g.Log().Fatal(ctx, err)
}
- defer shutdown()
+ defer shutdown(ctx)
ctx, span := gtrace.NewSpan(ctx, "main")
defer span.End()
diff --git a/example/trace/inprocess/main.go b/example/trace/inprocess/main.go
index a6b3849f0..3e603e037 100644
--- a/example/trace/inprocess/main.go
+++ b/example/trace/inprocess/main.go
@@ -23,12 +23,15 @@ const (
)
func main() {
- var ctx = gctx.New()
- shutdown, err := otlphttp.Init(serviceName, endpoint, path)
+ var (
+ ctx = gctx.New()
+ shutdown, err = otlphttp.Init(serviceName, endpoint, path)
+ )
+
if err != nil {
g.Log().Fatal(ctx, err)
}
- defer shutdown()
+ defer shutdown(ctx)
ctx, span := gtrace.NewSpan(ctx, "main")
defer span.End()
diff --git a/example/trace/otlp/grpc/main.go b/example/trace/otlp/grpc/main.go
index 224ee5fdc..8703d04b9 100644
--- a/example/trace/otlp/grpc/main.go
+++ b/example/trace/otlp/grpc/main.go
@@ -21,12 +21,15 @@ const (
)
func main() {
- var ctx = gctx.New()
- shutdown, err := otlpgrpc.Init(serviceName, endpoint, traceToken)
+ var (
+ ctx = gctx.New()
+ shutdown, err = otlpgrpc.Init(serviceName, endpoint, traceToken)
+ )
+
if err != nil {
g.Log().Fatal(ctx, err)
}
- defer shutdown()
+ defer shutdown(ctx)
StartRequests()
}
diff --git a/example/trace/otlp/http/main.go b/example/trace/otlp/http/main.go
index b1ad9e5fc..4994f882e 100644
--- a/example/trace/otlp/http/main.go
+++ b/example/trace/otlp/http/main.go
@@ -20,12 +20,15 @@ const (
)
func main() {
- var ctx = gctx.New()
- shutdown, err := otlphttp.Init(serviceName, endpoint, path)
+ var (
+ ctx = gctx.New()
+ shutdown, err = otlphttp.Init(serviceName, endpoint, path)
+ )
+
if err != nil {
g.Log().Fatal(ctx, err)
}
- defer shutdown()
+ defer shutdown(ctx)
StartRequests()
}
diff --git a/example/trace/provider/grpc/main.go b/example/trace/provider/grpc/main.go
new file mode 100644
index 000000000..7d5606f1d
--- /dev/null
+++ b/example/trace/provider/grpc/main.go
@@ -0,0 +1,114 @@
+// Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
+//
+// This Source Code Form is subject to the terms of the MIT License.
+// If a copy of the MIT was not distributed with this file,
+// You can obtain one at https://github.com/gogf/gf.
+
+// Package main provides a simple example for OTLP tracing with gRPC client.
+package main
+
+import (
+ "context"
+
+ "go.opentelemetry.io/otel/attribute"
+ "go.opentelemetry.io/otel/exporters/otlp/otlptrace"
+ "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc"
+ "go.opentelemetry.io/otel/sdk/resource"
+ "go.opentelemetry.io/otel/sdk/trace"
+ semconv "go.opentelemetry.io/otel/semconv/v1.24.0"
+ "google.golang.org/grpc/encoding/gzip"
+
+ "github.com/gogf/gf/example/trace/provider/internal"
+
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/os/gctx"
+)
+
+func main() {
+ var (
+ serverIP, err = internal.GetLocalIP()
+ ctx = gctx.New()
+ )
+ if err != nil {
+ g.Log().Fatal(ctx, err)
+ }
+ var res *resource.Resource
+ if res, err = resource.New(ctx,
+ // WithFromEnv returns a resource option that sets the resource attributes from the environment.
+ resource.WithFromEnv(),
+ // WithProcess returns a resource option that sets the process attributes.
+ resource.WithProcess(),
+ // WithTelemetrySDK returns a resource option that sets the telemetry SDK attributes.
+ resource.WithTelemetrySDK(),
+ // WithHost returns a resource option that sets the host attributes.
+ resource.WithHost(),
+ // WithAttributes returns a resource option that sets the resource attributes.
+ resource.WithAttributes(
+ // The name of the service displayed on the traceback end。
+ semconv.ServiceNameKey.String(internal.GRPCServiceName),
+ // The IP address of the server.
+ semconv.HostNameKey.String(serverIP),
+ // The IP address of the server.
+ attribute.String(internal.TracerHostnameTagKey, serverIP),
+ ),
+ // WithOS returns a resource option that sets the OS attributes.
+ resource.WithOS(),
+ // WithProcessPID returns a resource option that sets the process PID attribute.
+ resource.WithProcessPID(),
+ // For more parameters, please customize the selection
+ ); err != nil {
+ g.Log().Fatal(ctx, err)
+ }
+
+ var exporter *otlptrace.Exporter
+ if exporter, err = otlptrace.New(ctx, otlptracegrpc.NewClient(
+ // WithInsecure returns an otlptracegrpc.Option that disables transport security for the connection.
+ otlptracegrpc.WithInsecure(),
+ // WithEndpoint returns an otlptracegrpc.Option that sets the endpoint to which the exporter is going to send the spans.
+ otlptracegrpc.WithEndpoint(internal.Endpoint), // Replace the otel Agent Addr with the access point obtained in the prerequisite。
+ // WithHeaders returns an otlptracegrpc.Option that sets the headers to be sent with gRPC requests.
+ otlptracegrpc.WithHeaders(map[string]string{"Authentication": internal.TraceToken}),
+ // WithCompressor returns an otlptracegrpc.Option that sets the compressor to be used for gRPC requests.
+ otlptracegrpc.WithCompressor(gzip.Name))); err != nil {
+ g.Log().Fatal(ctx, err)
+ }
+ var shutdown func(ctx context.Context)
+ // WithSampler sets the sampler for the trace provider.
+ // 1. AlwaysSample: AlwaysSample is a sampler that samples every trace.
+ // 2. NeverSample: NeverSample is a sampler that samples no traces.
+ // 3. ParentBased: ParentBased is a sampler that samples a trace based on the parent span.
+ // 4. TraceIDRatioBased: TraceIDRatioBased is a sampler that samples a trace based on the TraceID.
+ // WithResource sets the resource for the trace provider.
+ // WithSpanProcessor sets the span processor for the trace provider.
+ // 1. NewSimpleSpanProcessor: NewSimpleSpanProcessor returns a new SimpleSpanProcessor.
+ // 2. NewBatchSpanProcessor: NewBatchSpanProcessor returns a new BatchSpanProcessor.
+ // WithRawSpanLimits sets the raw span limits for the trace provider.
+ if shutdown, err = internal.InitTracer(
+ // WithSampler returns a trace option that sets the sampler for the trace provider.
+ // trace.WithSampler(trace.AlwaysSample()),
+ // trace.WithSampler(trace.NeverSample()),
+ // trace.WithSampler(trace.ParentBased(trace.AlwaysSample())),
+ // WithSampler returns a trace option that sets the sampler for the trace provider.
+ // 1. AlwaysSample: AlwaysSample is a sampler that samples every trace.
+ // 2. NeverSample: NeverSample is a sampler that samples no traces.
+ // 3. ParentBased: ParentBased is a sampler that samples a trace based on the parent span.
+ // 4. TraceIDRatioBased: TraceIDRatioBased is a sampler that samples a trace based on the TraceID.
+ trace.WithSampler(trace.TraceIDRatioBased(0.1)),
+ // WithResource returns a trace option that sets the resource for the trace provider.
+ trace.WithResource(res),
+ // WithSpanProcessor returns a trace option that sets the span processor for the trace provider.
+ // trace.WithSpanProcessor(trace.NewSimpleSpanProcessor(exporter)),
+ // trace.WithSpanProcessor(trace.NewBatchSpanProcessor(exporter)),
+ // 1. NewSimpleSpanProcessor: NewSimpleSpanProcessor returns a new SimpleSpanProcessor.
+ // 2. NewBatchSpanProcessor: NewBatchSpanProcessor returns a new BatchSpanProcessor.
+ trace.WithSpanProcessor(trace.NewBatchSpanProcessor(exporter)),
+ // WithRawSpanLimits returns a trace option that sets the raw span limits for the trace provider.
+ trace.WithRawSpanLimits(trace.NewSpanLimits()),
+ ); err != nil {
+ g.Log().Fatal(ctx, err)
+ }
+
+ defer shutdown(ctx)
+
+ internal.StartRequests()
+}
diff --git a/example/trace/provider/http/main.go b/example/trace/provider/http/main.go
new file mode 100644
index 000000000..6f66c7eb9
--- /dev/null
+++ b/example/trace/provider/http/main.go
@@ -0,0 +1,110 @@
+// Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
+//
+// This Source Code Form is subject to the terms of the MIT License.
+// If a copy of the MIT was not distributed with this file,
+// You can obtain one at https://github.com/gogf/gf.
+
+package main
+
+import (
+ "context"
+
+ "go.opentelemetry.io/otel/attribute"
+ "go.opentelemetry.io/otel/exporters/otlp/otlptrace"
+ "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp"
+ "go.opentelemetry.io/otel/sdk/resource"
+ "go.opentelemetry.io/otel/sdk/trace"
+ semconv "go.opentelemetry.io/otel/semconv/v1.24.0"
+
+ "github.com/gogf/gf/example/trace/provider/internal"
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/os/gctx"
+)
+
+func main() {
+ var (
+ serverIP, err = internal.GetLocalIP()
+ ctx = gctx.New()
+ )
+ if err != nil {
+ g.Log().Fatal(ctx, err)
+ }
+ var res *resource.Resource
+ if res, err = resource.New(ctx,
+ // WithFromEnv returns a resource option that sets the resource attributes from the environment.
+ resource.WithFromEnv(),
+ // WithProcess returns a resource option that sets the process attributes.
+ resource.WithProcess(),
+ // WithTelemetrySDK returns a resource option that sets the telemetry SDK attributes.
+ resource.WithTelemetrySDK(),
+ // WithHost returns a resource option that sets the host attributes.
+ resource.WithHost(),
+ // WithAttributes returns a resource option that sets the resource attributes.
+ resource.WithAttributes(
+ // The name of the service displayed on the traceback end。
+ semconv.ServiceNameKey.String(internal.HTTPServiceName),
+ // The IP address of the server.
+ semconv.HostNameKey.String(serverIP),
+ // The IP address of the server.
+ attribute.String(internal.TracerHostnameTagKey, serverIP),
+ ),
+ // WithOS returns a resource option that sets the OS attributes.
+ resource.WithOS(),
+ // WithProcessPID returns a resource option that sets the process PID attribute.
+ resource.WithProcessPID(),
+ // For more parameters, please customize the selection
+ ); err != nil {
+ g.Log().Fatal(ctx, err)
+ }
+
+ var exporter *otlptrace.Exporter
+ if exporter, err = otlptrace.New(ctx, otlptracehttp.NewClient(
+ // WithEndpoint returns an otlptracehttp.Option that sets the endpoint to which the exporter is going to send the spans.
+ otlptracehttp.WithEndpoint(internal.HTTPEndpoint),
+ // WithHeaders returns an otlptracehttp.Option that sets the headers to be sent with HTTP requests.
+ otlptracehttp.WithURLPath(internal.HTTPPath),
+ // WithInsecure returns an otlptracehttp.Option that disables secure connection to the collector.
+ otlptracehttp.WithInsecure(),
+ // WithCompression returns an otlptracehttp.Option that sets the compression level for the exporter.
+ otlptracehttp.WithCompression(1))); err != nil {
+ g.Log().Fatal(ctx, err)
+ }
+ var shutdown func(ctx context.Context)
+ // WithSampler sets the sampler for the trace provider.
+ // 1. AlwaysSample: AlwaysSample is a sampler that samples every trace.
+ // 2. NeverSample: NeverSample is a sampler that samples no traces.
+ // 3. ParentBased: ParentBased is a sampler that samples a trace based on the parent span.
+ // 4. TraceIDRatioBased: TraceIDRatioBased is a sampler that samples a trace based on the TraceID.
+ // WithResource sets the resource for the trace provider.
+ // WithSpanProcessor sets the span processor for the trace provider.
+ // 1. NewSimpleSpanProcessor: NewSimpleSpanProcessor returns a new SimpleSpanProcessor.
+ // 2. NewBatchSpanProcessor: NewBatchSpanProcessor returns a new BatchSpanProcessor.
+ // WithRawSpanLimits sets the raw span limits for the trace provider.
+ if shutdown, err = internal.InitTracer(
+ // WithSampler returns a trace option that sets the sampler for the trace provider.
+ // trace.WithSampler(trace.AlwaysSample()),
+ // trace.WithSampler(trace.NeverSample()),
+ // trace.WithSampler(trace.ParentBased(trace.AlwaysSample())),
+ // WithSampler returns a trace option that sets the sampler for the trace provider.
+ // 1. AlwaysSample: AlwaysSample is a sampler that samples every trace.
+ // 2. NeverSample: NeverSample is a sampler that samples no traces.
+ // 3. ParentBased: ParentBased is a sampler that samples a trace based on the parent span.
+ // 4. TraceIDRatioBased: TraceIDRatioBased is a sampler that samples a trace based on the TraceID.
+ trace.WithSampler(trace.TraceIDRatioBased(0.1)),
+ // WithResource returns a trace option that sets the resource for the trace provider.
+ trace.WithResource(res),
+ // WithSpanProcessor returns a trace option that sets the span processor for the trace provider.
+ // trace.WithSpanProcessor(trace.NewSimpleSpanProcessor(exporter)),
+ // trace.WithSpanProcessor(trace.NewBatchSpanProcessor(exporter)),
+ // 1. NewSimpleSpanProcessor: NewSimpleSpanProcessor returns a new SimpleSpanProcessor.
+ // 2. NewBatchSpanProcessor: NewBatchSpanProcessor returns a new BatchSpanProcessor.
+ trace.WithSpanProcessor(trace.NewBatchSpanProcessor(exporter)),
+ // WithRawSpanLimits returns a trace option that sets the raw span limits for the trace provider.
+ trace.WithRawSpanLimits(trace.NewSpanLimits()),
+ ); err != nil {
+ g.Log().Fatal(ctx, err)
+ }
+ defer shutdown(ctx)
+
+ internal.StartRequests()
+}
diff --git a/example/trace/provider/internal/consts.go b/example/trace/provider/internal/consts.go
new file mode 100644
index 000000000..153c0720c
--- /dev/null
+++ b/example/trace/provider/internal/consts.go
@@ -0,0 +1,17 @@
+// Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
+//
+// This Source Code Form is subject to the terms of the MIT License.
+// If a copy of the MIT was not distributed with this file,
+// You can obtain one at https://github.com/gogf/gf.
+
+package internal
+
+const (
+ GRPCServiceName = "otlp-grpc-client"
+ Endpoint = "tracing-analysis-dc-bj.aliyuncs.com:8090"
+ TraceToken = "******_******"
+ HTTPServiceName = "otlp-http-client"
+ HTTPEndpoint = "tracing-analysis-dc-hz.aliyuncs.com"
+ HTTPPath = "adapt_******_******/api/otlp/traces"
+ TracerHostnameTagKey = "hostname"
+)
diff --git a/example/trace/provider/internal/provider.go b/example/trace/provider/internal/provider.go
new file mode 100644
index 000000000..f456d8028
--- /dev/null
+++ b/example/trace/provider/internal/provider.go
@@ -0,0 +1,57 @@
+// Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
+//
+// This Source Code Form is subject to the terms of the MIT License.
+// If a copy of the MIT was not distributed with this file,
+// You can obtain one at https://github.com/gogf/gf.
+
+package internal
+
+import (
+ "context"
+ "time"
+
+ "go.opentelemetry.io/otel"
+ "go.opentelemetry.io/otel/propagation"
+ "go.opentelemetry.io/otel/sdk/trace"
+
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/gipv4"
+)
+
+// InitTracer initializes and registers `otlpgrpc` or `otlphttp` to global TracerProvider.
+func InitTracer(opts ...trace.TracerProviderOption) (func(ctx context.Context), error) {
+ tracerProvider := trace.NewTracerProvider(opts...)
+ // Set the global propagator to traceContext (not set by default).
+ otel.SetTextMapPropagator(propagation.NewCompositeTextMapPropagator(propagation.TraceContext{}, propagation.Baggage{}))
+ otel.SetTracerProvider(tracerProvider)
+
+ return func(ctx context.Context) {
+ ctx, cancel := context.WithTimeout(ctx, time.Second)
+ defer cancel()
+ // Shutdown waits for exported trace spans to be uploaded.
+ if err := tracerProvider.Shutdown(ctx); err != nil {
+ g.Log().Errorf(ctx, "Shutdown tracerProvider failed err:%+v", err)
+ } else {
+ g.Log().Debug(ctx, "Shutdown tracerProvider success")
+ }
+ }, nil
+}
+
+// GetLocalIP returns the IP address of the server.
+func GetLocalIP() (string, error) {
+ var intranetIPArray, err = gipv4.GetIntranetIpArray()
+ if err != nil {
+ return "", err
+ }
+
+ if len(intranetIPArray) == 0 {
+ if intranetIPArray, err = gipv4.GetIpArray(); err != nil {
+ return "", err
+ }
+ }
+ var hostIP = "NoHostIpFound"
+ if len(intranetIPArray) > 0 {
+ hostIP = intranetIPArray[0]
+ }
+ return hostIP, nil
+}
diff --git a/example/trace/provider/internal/request.go b/example/trace/provider/internal/request.go
new file mode 100644
index 000000000..d90f72457
--- /dev/null
+++ b/example/trace/provider/internal/request.go
@@ -0,0 +1,24 @@
+// Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
+//
+// This Source Code Form is subject to the terms of the MIT License.
+// If a copy of the MIT was not distributed with this file,
+// You can obtain one at https://github.com/gogf/gf.
+
+package internal
+
+import (
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/gtrace"
+ "github.com/gogf/gf/v2/os/gctx"
+)
+
+// StartRequests starts requests.
+func StartRequests() {
+ ctx, span := gtrace.NewSpan(gctx.New(), "StartRequests")
+ defer span.End()
+
+ ctx = gtrace.SetBaggageValue(ctx, "name", "john")
+
+ content := g.Client().GetContent(ctx, "http://127.0.0.1:8199/hello")
+ g.Log().Print(ctx, content)
+}
diff --git a/frame/g/g.go b/frame/g/g.go
index 20bf37205..5c196c5cb 100644
--- a/frame/g/g.go
+++ b/frame/g/g.go
@@ -4,7 +4,10 @@
// If a copy of the MIT was not distributed with this file,
// You can obtain one at https://github.com/gogf/gf.
-// Package g provides commonly used type/function defines and coupled calling for creating commonly used objects.
+// Package g provides commonly used type/function defines and coupled calling for creating commonly-used objects.
+//
+// Note that, using package g might make the compiled binary a little bit bigger, as it imports a few frequently-used
+// packages whatever you use them or not.
package g
import (
diff --git a/go.mod b/go.mod
index 650a4fdae..c03407db6 100644
--- a/go.mod
+++ b/go.mod
@@ -1,22 +1,22 @@
module github.com/gogf/gf/v2
-go 1.21
+go 1.22
require (
github.com/BurntSushi/toml v1.4.0
github.com/clbanning/mxj/v2 v2.7.0
github.com/emirpasic/gods v1.18.1
- github.com/fatih/color v1.17.0
+ github.com/fatih/color v1.18.0
github.com/fsnotify/fsnotify v1.7.0
github.com/gorilla/websocket v1.5.3
github.com/grokify/html-strip-tags-go v0.1.0
github.com/magiconair/properties v1.8.7
github.com/olekukonko/tablewriter v0.0.5
- go.opentelemetry.io/otel v1.28.0
- go.opentelemetry.io/otel/sdk v1.28.0
- go.opentelemetry.io/otel/trace v1.28.0
- golang.org/x/net v0.27.0
- golang.org/x/text v0.16.0
+ go.opentelemetry.io/otel v1.32.0
+ go.opentelemetry.io/otel/sdk v1.32.0
+ go.opentelemetry.io/otel/trace v1.32.0
+ golang.org/x/net v0.31.0
+ golang.org/x/text v0.20.0
gopkg.in/yaml.v3 v3.0.1
)
@@ -26,8 +26,8 @@ require (
github.com/google/uuid v1.6.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
- github.com/mattn/go-runewidth v0.0.15 // indirect
+ github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
- go.opentelemetry.io/otel/metric v1.28.0 // indirect
- golang.org/x/sys v0.22.0 // indirect
+ go.opentelemetry.io/otel/metric v1.32.0 // indirect
+ golang.org/x/sys v0.27.0 // indirect
)
diff --git a/go.sum b/go.sum
index ac69af362..e9ed755b6 100644
--- a/go.sum
+++ b/go.sum
@@ -6,8 +6,8 @@ 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/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
-github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
-github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
+github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
+github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
@@ -31,8 +31,8 @@ github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
-github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U=
-github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
+github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc=
+github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
@@ -42,22 +42,22 @@ github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
-go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo=
-go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4=
-go.opentelemetry.io/otel/metric v1.28.0 h1:f0HGvSl1KRAU1DLgLGFjrwVyismPlnuU6JD6bOeuA5Q=
-go.opentelemetry.io/otel/metric v1.28.0/go.mod h1:Fb1eVBFZmLVTMb6PPohq3TO9IIhUisDsbJoL/+uQW4s=
-go.opentelemetry.io/otel/sdk v1.28.0 h1:b9d7hIry8yZsgtbmM0DKyPWMMUMlK9NEKuIG4aBqWyE=
-go.opentelemetry.io/otel/sdk v1.28.0/go.mod h1:oYj7ClPUA7Iw3m+r7GeEjz0qckQRJK2B8zjcZEfu7Pg=
-go.opentelemetry.io/otel/trace v1.28.0 h1:GhQ9cUuQGmNDd5BTCP2dAvv75RdMxEfTmYejp+lkx9g=
-go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI=
-golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
-golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
+go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U=
+go.opentelemetry.io/otel v1.32.0/go.mod h1:00DCVSB0RQcnzlwyTfqtxSm+DRr9hpYrHjNGiBHVQIg=
+go.opentelemetry.io/otel/metric v1.32.0 h1:xV2umtmNcThh2/a/aCP+h64Xx5wsj8qqnkYZktzNa0M=
+go.opentelemetry.io/otel/metric v1.32.0/go.mod h1:jH7CIbbK6SH2V2wE16W05BHCtIDzauciCRLoc/SyMv8=
+go.opentelemetry.io/otel/sdk v1.32.0 h1:RNxepc9vK59A8XsgZQouW8ue8Gkb4jpWtJm9ge5lEG4=
+go.opentelemetry.io/otel/sdk v1.32.0/go.mod h1:LqgegDBjKMmb2GC6/PrTnteJG39I8/vJCAP9LlJXEjU=
+go.opentelemetry.io/otel/trace v1.32.0 h1:WIC9mYrXf8TmY/EXuULKc8hR17vE+Hjv2cssQDe03fM=
+go.opentelemetry.io/otel/trace v1.32.0/go.mod h1:+i4rkvCraA+tG6AzwloGaCtkx53Fa+L+V8e9a7YvhT8=
+golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo=
+golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
-golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
-golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
+golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s=
+golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug=
+golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
diff --git a/internal/deepcopy/deepcopy_test.go b/internal/deepcopy/deepcopy_test.go
index 060001ed7..fa3e4a187 100644
--- a/internal/deepcopy/deepcopy_test.go
+++ b/internal/deepcopy/deepcopy_test.go
@@ -908,7 +908,7 @@ func TestPointerToStruct(t *testing.T) {
}
}
-func TestIssue9(t *testing.T) {
+func Test_Issue9(t *testing.T) {
// simple pointer copy
x := 42
testA := map[string]*int{
diff --git a/internal/utils/utils_str.go b/internal/utils/utils_str.go
index d22245733..9f1089d50 100644
--- a/internal/utils/utils_str.go
+++ b/internal/utils/utils_str.go
@@ -58,7 +58,10 @@ func IsNumeric(s string) bool {
return false
}
for i := 0; i < length; i++ {
- if s[i] == '-' && i == 0 {
+ if (s[i] == '-' || s[i] == '+') && i == 0 {
+ if length == 1 {
+ return false
+ }
continue
}
if s[i] == '.' {
diff --git a/internal/utils/utils_z_unit_test.go b/internal/utils/utils_z_unit_test.go
index 259091d5f..8c73eeac1 100644
--- a/internal/utils/utils_z_unit_test.go
+++ b/internal/utils/utils_z_unit_test.go
@@ -95,3 +95,34 @@ func Test_CanCallIsNil(t *testing.T) {
t.Assert(utils.CanCallIsNil(reflect.ValueOf(iUnsafePointer)), true)
})
}
+
+func Test_IsNumeric(t *testing.T) {
+ gtest.C(t, func(t *gtest.T) {
+ t.Assert(utils.IsNumeric("12345"), true)
+ t.Assert(utils.IsNumeric("-12345"), true)
+ t.Assert(utils.IsNumeric("+12345"), true)
+ t.Assert(utils.IsNumeric("123.45"), true)
+ t.Assert(utils.IsNumeric("-123.45"), true)
+ t.Assert(utils.IsNumeric("+123.45"), true)
+ t.Assert(utils.IsNumeric("1+23"), false)
+ t.Assert(utils.IsNumeric("123a45"), false)
+ t.Assert(utils.IsNumeric("123.45.67"), false)
+ t.Assert(utils.IsNumeric(""), false)
+ t.Assert(utils.IsNumeric("1e10"), false)
+ t.Assert(utils.IsNumeric("123 45"), false)
+ t.Assert(utils.IsNumeric("!!!"), false)
+ t.Assert(utils.IsNumeric("-a23"), false)
+ t.Assert(utils.IsNumeric("+a23"), false)
+ t.Assert(utils.IsNumeric("1+23"), false)
+ t.Assert(utils.IsNumeric("1-23"), false)
+ t.Assert(utils.IsNumeric("123."), false)
+ t.Assert(utils.IsNumeric(".123"), false)
+ t.Assert(utils.IsNumeric("123.a"), false)
+ t.Assert(utils.IsNumeric("a.123"), false)
+ t.Assert(utils.IsNumeric("+"), false)
+ t.Assert(utils.IsNumeric("-"), false)
+ t.Assert(utils.IsNumeric("."), false)
+ t.Assert(utils.IsNumeric("-."), false)
+ t.Assert(utils.IsNumeric("+."), false)
+ })
+}
diff --git a/net/gclient/gclient.go b/net/gclient/gclient.go
index 44b99e2a3..f15880843 100644
--- a/net/gclient/gclient.go
+++ b/net/gclient/gclient.go
@@ -84,17 +84,13 @@ func New() *Client {
func (c *Client) Clone() *Client {
newClient := New()
*newClient = *c
- if len(c.header) > 0 {
- newClient.header = make(map[string]string)
- for k, v := range c.header {
- newClient.header[k] = v
- }
+ newClient.header = make(map[string]string, len(c.header))
+ for k, v := range c.header {
+ newClient.header[k] = v
}
- if len(c.cookies) > 0 {
- newClient.cookies = make(map[string]string)
- for k, v := range c.cookies {
- newClient.cookies[k] = v
- }
+ newClient.cookies = make(map[string]string, len(c.cookies))
+ for k, v := range c.cookies {
+ newClient.cookies[k] = v
}
return newClient
}
diff --git a/net/gclient/gclient_observability.go b/net/gclient/gclient_observability.go
index 6b0323f18..f45efaa8b 100644
--- a/net/gclient/gclient_observability.go
+++ b/net/gclient/gclient_observability.go
@@ -9,7 +9,6 @@ package gclient
import (
"context"
"fmt"
- "io"
"net/http"
"net/http/httptrace"
@@ -21,7 +20,6 @@ import (
"github.com/gogf/gf/v2"
"github.com/gogf/gf/v2/internal/httputil"
- "github.com/gogf/gf/v2/internal/utils"
"github.com/gogf/gf/v2/net/gtrace"
"github.com/gogf/gf/v2/os/gctx"
"github.com/gogf/gf/v2/os/gmetric"
@@ -39,10 +37,8 @@ const (
tracingEventHttpRequest = "http.request"
tracingEventHttpRequestHeaders = "http.request.headers"
tracingEventHttpRequestBaggage = "http.request.baggage"
- tracingEventHttpRequestBody = "http.request.body"
tracingEventHttpResponse = "http.response"
tracingEventHttpResponseHeaders = "http.response.headers"
- tracingEventHttpResponseBody = "http.response.body"
tracingMiddlewareHandled gctx.StrKey = `MiddlewareClientTracingHandled`
)
@@ -102,17 +98,11 @@ func internalMiddlewareObservability(c *Client, r *http.Request) (response *Resp
return
}
- reqBodyContentBytes, _ := io.ReadAll(response.Body)
- response.Body = utils.NewReadCloser(reqBodyContentBytes, false)
-
- resBodyContent, err := gtrace.SafeContentForHttp(reqBodyContentBytes, response.Header)
- if err != nil {
- span.SetStatus(codes.Error, fmt.Sprintf(`converting safe content failed: %s`, err.Error()))
- }
-
span.AddEvent(tracingEventHttpResponse, trace.WithAttributes(
- attribute.String(tracingEventHttpResponseHeaders, gconv.String(httputil.HeaderToMap(response.Header))),
- attribute.String(tracingEventHttpResponseBody, resBodyContent),
+ attribute.String(
+ tracingEventHttpResponseHeaders,
+ gconv.String(httputil.HeaderToMap(response.Header)),
+ ),
))
return
}
diff --git a/net/gclient/gclient_request.go b/net/gclient/gclient_request.go
index 53aa744c1..be1c2ad0f 100644
--- a/net/gclient/gclient_request.go
+++ b/net/gclient/gclient_request.go
@@ -167,7 +167,10 @@ func (c *Client) prepareRequest(ctx context.Context, method, url string, data ..
if !gstr.ContainsI(url, httpProtocolName) {
url = httpProtocolName + `://` + url
}
- var params string
+ var (
+ params string
+ allowFileUploading = true
+ )
if len(data) > 0 {
switch c.header[httpHeaderContentType] {
case httpHeaderContentTypeJson:
@@ -181,6 +184,7 @@ func (c *Client) prepareRequest(ctx context.Context, method, url string, data ..
params = string(b)
}
}
+ allowFileUploading = false
case httpHeaderContentTypeXml:
switch data[0].(type) {
@@ -193,6 +197,8 @@ func (c *Client) prepareRequest(ctx context.Context, method, url string, data ..
params = string(b)
}
}
+ allowFileUploading = false
+
default:
params = httputil.BuildParams(data[0], c.noUrlEncode)
}
@@ -223,14 +229,18 @@ func (c *Client) prepareRequest(ctx context.Context, method, url string, data ..
return nil, err
}
} else {
- if strings.Contains(params, httpParamFileHolder) {
+ if allowFileUploading && strings.Contains(params, httpParamFileHolder) {
// File uploading request.
var (
- buffer = bytes.NewBuffer(nil)
- writer = multipart.NewWriter(buffer)
+ buffer = bytes.NewBuffer(nil)
+ writer = multipart.NewWriter(buffer)
+ isFileUploading = false
)
for _, item := range strings.Split(params, "&") {
array := strings.Split(item, "=")
+ if len(array) < 2 {
+ continue
+ }
if len(array[1]) > 6 && strings.Compare(array[1][0:6], httpParamFileHolder) == 0 {
path := array[1][6:]
if !gfile.Exists(path) {
@@ -241,43 +251,50 @@ func (c *Client) prepareRequest(ctx context.Context, method, url string, data ..
formFileName = gfile.Basename(path)
formFieldName = array[0]
)
+ // it sets post content type as `application/octet-stream`
if file, err = writer.CreateFormFile(formFieldName, formFileName); err != nil {
- err = gerror.Wrapf(err, `CreateFormFile failed with "%s", "%s"`, formFieldName, formFileName)
- return nil, err
- } else {
- var f *os.File
- if f, err = gfile.Open(path); err != nil {
- return nil, err
- }
- if _, err = io.Copy(file, f); err != nil {
- err = gerror.Wrapf(err, `io.Copy failed from "%s" to form "%s"`, path, formFieldName)
- _ = f.Close()
- return nil, err
- }
- _ = f.Close()
+ return nil, gerror.Wrapf(
+ err, `CreateFormFile failed with "%s", "%s"`, formFieldName, formFileName,
+ )
}
+ var f *os.File
+ if f, err = gfile.Open(path); err != nil {
+ return nil, err
+ }
+ if _, err = io.Copy(file, f); err != nil {
+ _ = f.Close()
+ return nil, gerror.Wrapf(
+ err, `io.Copy failed from "%s" to form "%s"`, path, formFieldName,
+ )
+ }
+ if err = f.Close(); err != nil {
+ return nil, gerror.Wrapf(err, `close file descriptor failed for "%s"`, path)
+ }
+ isFileUploading = true
} else {
var (
fieldName = array[0]
fieldValue = array[1]
)
if err = writer.WriteField(fieldName, fieldValue); err != nil {
- err = gerror.Wrapf(err, `write form field failed with "%s", "%s"`, fieldName, fieldValue)
- return nil, err
+ return nil, gerror.Wrapf(
+ err, `write form field failed with "%s", "%s"`, fieldName, fieldValue,
+ )
}
}
}
// Close finishes the multipart message and writes the trailing
// boundary end line to the output.
if err = writer.Close(); err != nil {
- err = gerror.Wrapf(err, `form writer close failed`)
- return nil, err
+ return nil, gerror.Wrapf(err, `form writer close failed`)
}
if req, err = http.NewRequest(method, url, buffer); err != nil {
- err = gerror.Wrapf(err, `http.NewRequest failed for method "%s" and URL "%s"`, method, url)
- return nil, err
- } else {
+ return nil, gerror.Wrapf(
+ err, `http.NewRequest failed for method "%s" and URL "%s"`, method, url,
+ )
+ }
+ if isFileUploading {
req.Header.Set(httpHeaderContentType, writer.FormDataContentType())
}
} else {
@@ -286,18 +303,17 @@ func (c *Client) prepareRequest(ctx context.Context, method, url string, data ..
if req, err = http.NewRequest(method, url, bytes.NewReader(paramBytes)); err != nil {
err = gerror.Wrapf(err, `http.NewRequest failed for method "%s" and URL "%s"`, method, url)
return nil, err
- } else {
- if v, ok := c.header[httpHeaderContentType]; ok {
- // Custom Content-Type.
- req.Header.Set(httpHeaderContentType, v)
- } else if len(paramBytes) > 0 {
- if (paramBytes[0] == '[' || paramBytes[0] == '{') && json.Valid(paramBytes) {
- // Auto-detecting and setting the post content format: JSON.
- req.Header.Set(httpHeaderContentType, httpHeaderContentTypeJson)
- } else if gregex.IsMatchString(httpRegexParamJson, params) {
- // If the parameters passed like "name=value", it then uses form type.
- req.Header.Set(httpHeaderContentType, httpHeaderContentTypeForm)
- }
+ }
+ if v, ok := c.header[httpHeaderContentType]; ok {
+ // Custom Content-Type.
+ req.Header.Set(httpHeaderContentType, v)
+ } else if len(paramBytes) > 0 {
+ if (paramBytes[0] == '[' || paramBytes[0] == '{') && json.Valid(paramBytes) {
+ // Auto-detecting and setting the post content format: JSON.
+ req.Header.Set(httpHeaderContentType, httpHeaderContentTypeJson)
+ } else if gregex.IsMatchString(httpRegexParamJson, params) {
+ // If the parameters passed like "name=value", it then uses form type.
+ req.Header.Set(httpHeaderContentType, httpHeaderContentTypeForm)
}
}
}
diff --git a/net/gclient/gclient_tracer_tracing.go b/net/gclient/gclient_tracer_tracing.go
index 6c61ebe69..566138bdb 100644
--- a/net/gclient/gclient_tracer_tracing.go
+++ b/net/gclient/gclient_tracer_tracing.go
@@ -218,14 +218,8 @@ func (ct *clientTracerTracing) WroteRequest(info httptrace.WroteRequestInfo) {
ct.span.SetStatus(codes.Error, fmt.Sprintf(`%+v`, info.Err))
}
- reqBodyContent, err := gtrace.SafeContentForHttp(ct.requestBody, ct.request.Header)
- if err != nil {
- ct.span.SetStatus(codes.Error, fmt.Sprintf(`converting safe content failed: %s`, err.Error()))
- }
-
ct.span.AddEvent(tracingEventHttpRequest, trace.WithAttributes(
attribute.String(tracingEventHttpRequestHeaders, gconv.String(ct.headers)),
attribute.String(tracingEventHttpRequestBaggage, gtrace.GetBaggageMap(ct.Context).String()),
- attribute.String(tracingEventHttpRequestBody, reqBodyContent),
))
}
diff --git a/net/gclient/gclient_z_unit_issue_test.go b/net/gclient/gclient_z_unit_issue_test.go
new file mode 100644
index 000000000..e3203f3e1
--- /dev/null
+++ b/net/gclient/gclient_z_unit_issue_test.go
@@ -0,0 +1,82 @@
+// Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
+//
+// This Source Code Form is subject to the terms of the MIT License.
+// If a copy of the MIT was not distributed with this file,
+// You can obtain one at https://github.com/gogf/gf.
+
+package gclient_test
+
+import (
+ "fmt"
+ "strings"
+ "testing"
+ "time"
+
+ "github.com/gogf/gf/v2/frame/g"
+ "github.com/gogf/gf/v2/net/gclient"
+ "github.com/gogf/gf/v2/net/ghttp"
+ "github.com/gogf/gf/v2/test/gtest"
+ "github.com/gogf/gf/v2/util/guid"
+)
+
+func Test_Issue3748(t *testing.T) {
+ s := g.Server(guid.S())
+ s.BindHandler("/", func(r *ghttp.Request) {
+ r.Response.Write(
+ r.GetBody(),
+ )
+ })
+ s.SetDumpRouterMap(false)
+ s.Start()
+ defer s.Shutdown()
+
+ clientHost := fmt.Sprintf("http://127.0.0.1:%d", s.GetListenedPort())
+ time.Sleep(100 * time.Millisecond)
+
+ gtest.C(t, func(t *gtest.T) {
+ client := gclient.New()
+ client.SetHeader("Content-Type", "application/json")
+ data := map[string]interface{}{
+ "name": "@file:",
+ "value": "json",
+ }
+ client.SetPrefix(clientHost)
+ content := client.PostContent(ctx, "/", data)
+ t.Assert(content, `{"name":"@file:","value":"json"}`)
+ })
+
+ gtest.C(t, func(t *gtest.T) {
+ client := gclient.New()
+ client.SetHeader("Content-Type", "application/xml")
+ data := map[string]interface{}{
+ "name": "@file:",
+ "value": "xml",
+ }
+ client.SetPrefix(clientHost)
+ content := client.PostContent(ctx, "/", data)
+ t.Assert(content, `@file:xml`)
+ })
+
+ gtest.C(t, func(t *gtest.T) {
+ client := gclient.New()
+ client.SetHeader("Content-Type", "application/x-www-form-urlencoded")
+ data := map[string]interface{}{
+ "name": "@file:",
+ "value": "x-www-form-urlencoded",
+ }
+ client.SetPrefix(clientHost)
+ content := client.PostContent(ctx, "/", data)
+ t.Assert(strings.Contains(content, `Content-Disposition: form-data; name="value"`), true)
+ t.Assert(strings.Contains(content, `Content-Disposition: form-data; name="name"`), true)
+ t.Assert(strings.Contains(content, "\r\n@file:"), true)
+ t.Assert(strings.Contains(content, "\r\nx-www-form-urlencoded"), true)
+ })
+
+ gtest.C(t, func(t *gtest.T) {
+ client := gclient.New()
+ data := "@file:"
+ client.SetPrefix(clientHost)
+ _, err := client.Post(ctx, "/", data)
+ t.AssertNil(err)
+ })
+}
diff --git a/net/gclient/gclient_z_unit_test.go b/net/gclient/gclient_z_unit_test.go
index 64c48dd48..d6e8c6f2f 100644
--- a/net/gclient/gclient_z_unit_test.go
+++ b/net/gclient/gclient_z_unit_test.go
@@ -177,6 +177,40 @@ func Test_Client_Chain_Header(t *testing.T) {
t.Assert(c.HeaderRaw("test1: 1234567890\ntest2: abcdefg").GetContent(ctx, "/header1"), "1234567890")
t.Assert(c.HeaderRaw("test1: 1234567890\ntest2: abcdefg").GetContent(ctx, "/header2"), "abcdefg")
})
+ gtest.C(t, func(t *gtest.T) {
+ c := g.Client()
+ c.SetPrefix(fmt.Sprintf("http://127.0.0.1:%d", s.GetListenedPort()))
+
+ t.Assert(c.GetContent(ctx, "/header1"), "")
+
+ copyWithHeader := c.Header(g.MapStrStr{"test1": "1234567890"})
+ t.Assert(copyWithHeader.GetContent(ctx, "/header1"), "1234567890")
+
+ t.Assert(c.GetContent(ctx, "/header1"), "")
+ })
+}
+
+func Test_Client_Chain_Cookie(t *testing.T) {
+ s := g.Server(guid.S())
+ s.BindHandler("/cookie", func(r *ghttp.Request) {
+ r.Response.Write(r.Cookie.Get("test", "def"))
+ })
+ s.SetDumpRouterMap(false)
+ s.Start()
+ defer s.Shutdown()
+
+ time.Sleep(100 * time.Millisecond)
+ gtest.C(t, func(t *gtest.T) {
+ c := g.Client()
+ c.SetPrefix(fmt.Sprintf("http://127.0.0.1:%d", s.GetListenedPort()))
+
+ t.Assert(c.GetContent(ctx, "/cookie"), "def")
+
+ copyWithCookie := c.Cookie(g.MapStrStr{"test": "1234567890"})
+ t.Assert(copyWithCookie.GetContent(ctx, "/cookie"), "1234567890")
+
+ t.Assert(c.GetContent(ctx, "/cookie"), "def")
+ })
}
func Test_Client_Chain_Context(t *testing.T) {
diff --git a/net/ghttp/ghttp_middleware_handler_response.go b/net/ghttp/ghttp_middleware_handler_response.go
index d78b4c194..574db5081 100644
--- a/net/ghttp/ghttp_middleware_handler_response.go
+++ b/net/ghttp/ghttp_middleware_handler_response.go
@@ -7,6 +7,7 @@
package ghttp
import (
+ "mime"
"net/http"
"github.com/gogf/gf/v2/errors/gcode"
@@ -20,6 +21,17 @@ type DefaultHandlerResponse struct {
Data interface{} `json:"data" dc:"Result data for certain request according API definition"`
}
+const (
+ contentTypeEventStream = "text/event-stream"
+ contentTypeOctetStream = "application/octet-stream"
+ contentTypeMixedReplace = "multipart/x-mixed-replace"
+)
+
+var (
+ // streamContentType is the content types for stream response.
+ streamContentType = []string{contentTypeEventStream, contentTypeOctetStream, contentTypeMixedReplace}
+)
+
// MiddlewareHandlerResponse is the default middleware handling handler response object and its error.
func MiddlewareHandlerResponse(r *Request) {
r.Middleware.Next()
@@ -29,6 +41,14 @@ func MiddlewareHandlerResponse(r *Request) {
return
}
+ // It does not output common response content if it is stream response.
+ mediaType, _, _ := mime.ParseMediaType(r.Response.Header().Get("Content-Type"))
+ for _, ct := range streamContentType {
+ if mediaType == ct {
+ return
+ }
+ }
+
var (
msg string
err = r.GetError()
diff --git a/net/ghttp/ghttp_middleware_tracing.go b/net/ghttp/ghttp_middleware_tracing.go
index f5d125183..8e1559153 100644
--- a/net/ghttp/ghttp_middleware_tracing.go
+++ b/net/ghttp/ghttp_middleware_tracing.go
@@ -9,7 +9,6 @@ package ghttp
import (
"context"
"fmt"
- "io"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
@@ -18,9 +17,7 @@ import (
"go.opentelemetry.io/otel/trace"
"github.com/gogf/gf/v2"
- "github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/internal/httputil"
- "github.com/gogf/gf/v2/internal/utils"
"github.com/gogf/gf/v2/net/gtrace"
"github.com/gogf/gf/v2/os/gctx"
"github.com/gogf/gf/v2/util/gconv"
@@ -31,10 +28,8 @@ const (
tracingEventHttpRequest = "http.request"
tracingEventHttpRequestHeaders = "http.request.headers"
tracingEventHttpRequestBaggage = "http.request.baggage"
- tracingEventHttpRequestBody = "http.request.body"
tracingEventHttpResponse = "http.response"
tracingEventHttpResponseHeaders = "http.response.headers"
- tracingEventHttpResponseBody = "http.response.body"
tracingEventHttpRequestUrl = "http.request.url"
tracingMiddlewareHandled gctx.StrKey = `MiddlewareServerTracingHandled`
)
@@ -80,24 +75,10 @@ func internalMiddlewareServerTracing(r *Request) {
return
}
- // Request content logging.
- reqBodyContentBytes, err := io.ReadAll(r.Body)
- if err != nil {
- r.SetError(gerror.Wrap(err, `read request body failed`))
- span.SetStatus(codes.Error, fmt.Sprintf(`%+v`, err))
- return
- }
- r.Body = utils.NewReadCloser(reqBodyContentBytes, false)
- reqBodyContent, err := gtrace.SafeContentForHttp(reqBodyContentBytes, r.Header)
- if err != nil {
- span.SetStatus(codes.Error, fmt.Sprintf(`converting safe content failed: %s`, err.Error()))
- }
-
span.AddEvent(tracingEventHttpRequest, trace.WithAttributes(
attribute.String(tracingEventHttpRequestUrl, r.URL.String()),
attribute.String(tracingEventHttpRequestHeaders, gconv.String(httputil.HeaderToMap(r.Header))),
attribute.String(tracingEventHttpRequestBaggage, gtrace.GetBaggageMap(ctx).String()),
- attribute.String(tracingEventHttpRequestBody, reqBodyContent),
))
// Continue executing.
@@ -109,18 +90,14 @@ func internalMiddlewareServerTracing(r *Request) {
}
// Error logging.
- if err = r.GetError(); err != nil {
+ if err := r.GetError(); err != nil {
span.SetStatus(codes.Error, fmt.Sprintf(`%+v`, err))
}
- // Response content logging.
- resBodyContent, err := gtrace.SafeContentForHttp(r.Response.Buffer(), r.Response.Header())
- if err != nil {
- span.SetStatus(codes.Error, fmt.Sprintf(`converting safe content failed: %s`, err.Error()))
- }
-
span.AddEvent(tracingEventHttpResponse, trace.WithAttributes(
- attribute.String(tracingEventHttpResponseHeaders, gconv.String(httputil.HeaderToMap(r.Response.Header()))),
- attribute.String(tracingEventHttpResponseBody, resBodyContent),
+ attribute.String(
+ tracingEventHttpResponseHeaders,
+ gconv.String(httputil.HeaderToMap(r.Response.Header())),
+ ),
))
}
diff --git a/net/ghttp/ghttp_response_cors.go b/net/ghttp/ghttp_response_cors.go
index 59772f552..7a80fe647 100644
--- a/net/ghttp/ghttp_response_cors.go
+++ b/net/ghttp/ghttp_response_cors.go
@@ -64,8 +64,8 @@ func (r *Response) DefaultCORSOptions() CORSOptions {
if origin := r.Request.Header.Get("Origin"); origin != "" {
options.AllowOrigin = origin
} else if referer := r.Request.Referer(); referer != "" {
- if p := gstr.PosR(referer, "/", 6); p != -1 {
- options.AllowOrigin = referer[:p]
+ if ref, err := url.Parse(referer); err == nil {
+ options.AllowOrigin = ref.Scheme + "://" + ref.Host
} else {
options.AllowOrigin = referer
}
diff --git a/net/ghttp/ghttp_server.go b/net/ghttp/ghttp_server.go
index 75944a489..80976ee97 100644
--- a/net/ghttp/ghttp_server.go
+++ b/net/ghttp/ghttp_server.go
@@ -247,7 +247,13 @@ func (s *Server) Start() error {
// If this is a child process, it then notifies its parent exit.
if gproc.IsChild() {
- gtimer.SetTimeout(ctx, time.Duration(s.config.GracefulTimeout)*time.Second, func(ctx context.Context) {
+ var gracefulTimeout = time.Duration(s.config.GracefulTimeout) * time.Second
+ gtimer.SetTimeout(ctx, gracefulTimeout, func(ctx context.Context) {
+ intlog.Printf(
+ ctx,
+ `pid[%d]: notice parent server graceful shuttingdown, ppid: %d`,
+ gproc.Pid(), gproc.PPid(),
+ )
if err := gproc.Send(gproc.PPid(), []byte("exit"), adminGProcCommGroup); err != nil {
intlog.Errorf(ctx, `server error in process communication: %+v`, err)
}
diff --git a/net/ghttp/ghttp_server_admin.go b/net/ghttp/ghttp_server_admin.go
index 2928493a4..109cacb13 100644
--- a/net/ghttp/ghttp_server_admin.go
+++ b/net/ghttp/ghttp_server_admin.go
@@ -36,8 +36,14 @@ func (p *utilAdmin) Index(r *Request) {
Pid: {{.pid}}
File Path: {{.path}}
- Restart
- Shutdown
+
+Restart
+please make sure it is running using standalone binary not from IDE or "go run"
+
+
+Shutdown
+graceful shutdown the server
+