This is an automated email from the ASF dual-hosted git repository.
alexstocks pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/dubbo-go-pixiu.git
The following commit(s) were added to refs/heads/develop by this push:
new 7b05e6ec feat: update Go version to 1.25 in GitHub Actions and module
files & update integrate test files & fix cl lint related problem (#752)
7b05e6ec is described below
commit 7b05e6ec4f9cca49de881eeb6cf1edee95c4946c
Author: Xuetao Li <[email protected]>
AuthorDate: Sun Sep 21 22:53:02 2025 +0800
feat: update Go version to 1.25 in GitHub Actions and module files & update
integrate test files & fix cl lint related problem (#752)
* feat: update Go version to 1.25 in GitHub Actions and module files
* chore: update dependencies in go.mod and go.sum
* chore: update golangci-lint configuration and GitHub Actions to use
version 2.4.0
* chore: update golangci-lint configuration and GitHub Actions to use
version 2.4.0
* chore: update golangci-lint configuration and GitHub Actions to use
version 2.4.0
* fix ci lint
* fix ci lint
* fix ci lint
* fix ci lint
* fix ci lint
* fix ci lint
* refactor GitHub Actions workflow for improved CI/CD process
* add .txt files to license exclusions
* refactor GitHub Actions workflow to streamline license header check
* update GitHub Actions workflows for clarity and version consistency
* update GitHub Actions workflows for clarity and version consistency
* fix data race
* fix prometheus.go data race
* fix data race
* fix intergate test
* fix intergate test
* fix unit test
* fix unit test
* update GitHub Actions workflows for improved release process and linting
* add NOSONAR
* update on condition
* go mod tidy
* go mod tidy
* fix ci
* update ci to cache test files
* update ci to cache test files
* update ci to cache test files
* update ci to cache test files
* update ci to cache test files
---------
Co-authored-by: Xuetao Li <[email protected]>
---
.github/workflows/github-actions.yml | 323 ++++++++-------------
.github/workflows/release.yml | 26 +-
.github/workflows/reviewdog.yml | 35 ---
.golangci.yaml | 125 ++++----
.licenserc.yaml | 1 +
admin/controller/auth/auth.go | 2 +-
admin/core/viper.go | 2 +-
admin/core/xds.go | 3 +-
admin/core/zap.go | 12 +-
admin/logic/logic.go | 4 +-
before_ut.sh | 25 --
before_validate_license.sh | 26 --
go.mod | 32 +-
go.sum | 66 +++--
integrate_test.sh | 46 ---
.../registry/zookeeper/service_listener.go | 2 +-
pkg/adapter/dubboregistry/registrycenter.go | 6 +-
pkg/client/dubbo/dubbo.go | 10 +-
pkg/client/dubbo/dubbo_test.go | 36 +--
pkg/client/dubbo/mapper_test.go | 46 +--
pkg/client/dubbo/option.go | 12 +-
pkg/client/http/http.go | 12 +-
pkg/client/http/http_test.go | 14 +-
pkg/client/http/mapper_test.go | 34 +--
pkg/client/proxy/proxy.go | 2 +-
pkg/client/request.go | 4 +-
pkg/client/triple/triple.go | 4 +-
pkg/common/router/trie/trie.go | 2 +-
.../http/apiconfig/api/discovery_service_test.go | 4 +-
pkg/filter/http/apiconfig/api_config.go | 2 +-
pkg/filter/http/loadbalancer/loadbalancer.go | 4 +-
pkg/filter/http/remote/call.go | 2 +-
.../resolver/dubboresolver/dubbo_resolver_test.go | 4 +-
pkg/filter/http/remote/resolver/resolver_test.go | 14 +-
pkg/filter/mcp/mcpserver/context.go | 10 +-
pkg/filter/mcp/mcpserver/handlers.go | 49 ++--
.../grpcproxy/filter/proxy/grpc_proxy_filter.go | 29 +-
pkg/filter/network/grpcproxy/grpc_manager.go | 4 +-
pkg/filter/opa/opa.go | 2 +-
pkg/filter/traffic/traffic.go | 2 +-
pkg/router/api.go | 4 +-
pkg/router/api_test.go | 6 +-
pkg/router/route.go | 18 +-
pkg/server/cluster_manager.go | 1 -
pkg/server/listener_manager.go | 2 +-
pkg/tracing/driver.go | 2 +-
quick_start_for_windows.md | 57 ----
start_integrate_test.sh | 50 ++--
48 files changed, 462 insertions(+), 716 deletions(-)
diff --git a/.github/workflows/github-actions.yml
b/.github/workflows/github-actions.yml
index bef1a1df..9a9e9aa8 100644
--- a/.github/workflows/github-actions.yml
+++ b/.github/workflows/github-actions.yml
@@ -23,241 +23,150 @@ on:
pull_request:
pull_request_target:
-jobs:
+# cancel in-progress runs for the same branch or PR
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number ||
github.ref }}
+ cancel-in-progress: true
- license-check:
- name: License Check - Go ${{ matrix.go_version }}
+jobs:
+ license-check-and-import-format:
+ name: License Check and Import Format
runs-on: ubuntu-latest
- strategy:
- matrix:
- go_version:
- - 1.23
steps:
- - name: Set up Go 1.x
- uses: actions/setup-go@v5
- with:
- go-version: ${{ matrix.go_version }}
- id: go
-
- - name: Check out code into the Go module directory
- uses: actions/checkout@v4
-
- - name: Check License Header
- uses:
apache/skywalking-eyes/header@501a28d2fb4a9b962661987e50cf0219631b32ff
-
-
- format:
- name: Format Code ${{ matrix.os }} - Go ${{ matrix.go_version }}
- runs-on: ${{ matrix.os }}
- strategy:
- # If you want to matrix build , you can append the following list.
- matrix:
- go_version:
- - 1.23
- os:
- - ubuntu-latest
- steps:
- - name: Set up Go 1.x
- uses: actions/setup-go@v5
- with:
- go-version: ${{ matrix.go_version }}
- id: go
- - name: Check out code into the Go module directory
- uses: actions/checkout@v4
- - name: Cache dependencies
+ - uses: actions/checkout@v5
+ - name: Cache imports-formatter
+ id: cache-go-bin
uses: actions/cache@v4
with:
- # Cache
- path: ~/go/pkg/mod
- # Cache key
- key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- # An ordered list of keys to use for restoring the cache if no cache
hit occurred for key
+ path: ~/go/bin
+ key: ${{ runner.os }}-go-imports-formatter-${{
hashFiles('**/go.sum') }}
restore-keys: |
- ${{ runner.os }}-go-
- - name: Merge base
- if: ${{ github.event_name == 'pull_request' }}
- run: |
- git fetch origin develop
- git checkout -b develop origin/develop
- git remote add devrepo
https://github.com/${{github.event.pull_request.head.repo.full_name}}.git
- git fetch devrepo ${{github.event.pull_request.head.sha}}
- git config --global user.email "[email protected]"
- git config --global user.name "robot"
- git merge ${{github.event.pull_request.head.sha}}
- - name: Get dependencies
+ ${{ runner.os }}-go-imports-formatter-
+
+ - name: Download imports-formatter if not cached
+ if: steps.cache-go-bin.outputs.cache-hit != 'true'
run: |
- if [ -f Gopkg.toml ]; then
- curl
https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
- dep ensure
- else
- go get -v -t -d ./...
- fi
go install github.com/dubbogo/tools/cmd/imports-formatter@latest
- - name: Format Code
+
+ - name: Check License Header
+ uses: apache/skywalking-eyes/header@main # NOSONAR
+
+ - name: Check Golang fmt
run: |
- go fmt ./... && GOROOT=$(go env GOROOT) imports-formatter && git
status && [[ -z `git status -s` ]]
- # diff -u <(echo -n) <(gofmt -d -s .)
+ gofmt -s -w .
+ git diff --exit-code
- lint:
- name: Lint ${{ matrix.os }} - Go ${{ matrix.go_version }}
- runs-on: ${{ matrix.os }}
- strategy:
- # If you want to matrix build , you can append the following list.
- matrix:
- go_version:
- - 1.23
- os:
- - ubuntu-latest
+ - name: Check Import Formatting
+ run: |
+ imports-formatter
+ git diff --exit-code
+ golangci:
+ needs: license-check-and-import-format
+ name: Golang Lint
+ runs-on: ubuntu-latest
steps:
- - name: Set up Go 1.x
- uses: actions/setup-go@v5
+ - uses: actions/checkout@v5
+ - uses: actions/setup-go@v6
with:
- go-version: ${{ matrix.go_version }}
- id: go
- - name: Check out code into the Go module directory
- uses: actions/checkout@v4
- - name: Cache dependencies
- uses: actions/cache@v4
+ go-version-file: 'go.mod'
+ cache: true
+ - name: golangci-lint
+ uses: golangci/golangci-lint-action@v8 # NOSONAR
with:
- # Cache
- path: ~/go/pkg/mod
- # Cache key
- key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- # An ordered list of keys to use for restoring the cache if no cache
hit occurred for key
- restore-keys: |
- ${{ runner.os }}-go-
- - name: Merge base
- if: ${{ github.event_name == 'pull_request' }}
- run: |
- git fetch origin develop
- git checkout -b develop origin/develop
- git remote add devrepo
https://github.com/${{github.event.pull_request.head.repo.full_name}}.git
- git fetch devrepo ${{github.event.pull_request.head.sha}}
- git config --global user.email "[email protected]"
- git config --global user.name "robot"
- git merge ${{github.event.pull_request.head.sha}}
- - name: Get dependencies
- run: |
- if [ -f Gopkg.toml ]; then
- curl
https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
- dep ensure
- else
- go get -v -t -d ./...
- fi
- - name: Install go ci lint
- run: curl -sSfL
https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh
-s -- -b $(go env GOPATH)/bin v1.64.8
- - name: Run Linter
- run: GO111MODULE=on golangci-lint run --timeout=30m -v --disable-all
--enable=govet --enable=staticcheck --enable=ineffassign --enable=misspell
+ version: v2.4.0
- go-test:
- name: Go Test ${{ matrix.os }} - Go ${{ matrix.go_version }}
- runs-on: ${{ matrix.os }}
- strategy:
- # If you want to matrix build , you can append the following list.
- matrix:
- go_version:
- - 1.23
- os:
- - ubuntu-latest
+ unit-test:
+ needs: golangci
+ name: Unit Test
+ runs-on: ubuntu-latest
steps:
- - name: Set up Go 1.x
- uses: actions/setup-go@v5
+ - uses: actions/checkout@v5
+ - uses: actions/setup-go@v6
with:
- go-version: ${{ matrix.go_version }}
- id: go
- - name: Check out code into the Go module directory
- uses: actions/checkout@v4
- - name: Cache dependencies
+ go-version-file: 'go.mod'
+ cache: true
+
+ - name: Cache Zookeeper JAR
+ id: cache-zk-jar
uses: actions/cache@v4
with:
- # Cache
- path: ~/go/pkg/mod
- # Cache key
- key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- # An ordered list of keys to use for restoring the cache if no cache
hit occurred for key
- restore-keys: |
- ${{ runner.os }}-go-
- - name: Merge base
- if: ${{ github.event_name == 'pull_request' }}
- run: |
- git fetch origin develop
- git checkout -b develop origin/develop
- git remote add devrepo
https://github.com/${{github.event.pull_request.head.repo.full_name}}.git
- git fetch devrepo ${{github.event.pull_request.head.sha}}
- git config --global user.email "[email protected]"
- git config --global user.name "robot"
- git merge ${{github.event.pull_request.head.sha}}
- - name: Get dependencies
+ path: pkg/registry/zookeeper-4unittest/contrib/fatjar
+ key: ${{ runner.os }}-zookeeper-jar-3.4.9
+
+ - name: Download Zookeeper JAR if not cached
+ if: steps.cache-zk-jar.outputs.cache-hit != 'true'
run: |
- if [ -f Gopkg.toml ]; then
- curl
https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
- dep ensure
- else
- go get -v -t -d ./...
- fi
- - name: Go Test
+ echo "Cache miss. Downloading Zookeeper JAR..."
+ zkJarName="zookeeper-3.4.9-fatjar.jar"
+
remoteJarUrl="https://github.com/dubbogo/resources/raw/master/zookeeper-4unitest/contrib/fatjar/${zkJarName}"
+ zkJarPath="pkg/registry/zookeeper-4unittest/contrib/fatjar"
+ mkdir -p ${zkJarPath}
+ wget -P "${zkJarPath}" ${remoteJarUrl}
+
+ - name: Run Tests and Generate Coverage
run: |
- chmod u+x before_ut.sh && ./before_ut.sh
- go mod vendor && go test ./... -gcflags=-l
-coverprofile=coverage.txt -covermode=atomic
- - name: Coverage
- run: bash <(curl -s https://codecov.io/bash)
+ go mod download
+ go test ./... -gcflags=-l -race -coverprofile=coverage.txt
-covermode=atomic
+ - name: Upload coverage to Codecov
+ uses: codecov/codecov-action@v4 # NOSONAR
+ with:
+ token: ${{ secrets.CODECOV_TOKEN }}
+ file: ./coverage.txt
+ flags: unittests
- integrate-test:
- name: Integrate Test - ${{ matrix.os }} - Go ${{ matrix.go_version }}
- runs-on: ${{ matrix.os }}
- strategy:
- # If you want to matrix build , you can append the following list.
- matrix:
- go_version:
- - 1.23
- os:
- - ubuntu-latest
+ integration-test:
+ needs: unit-test
+ name: Integration Test
+ runs-on: ubuntu-latest
+ outputs:
+ output1: ${{ steps.samples_head.outputs.sha }}
+ env:
+ SAMPLES_BRANCH: main
+ SAMPLES_REPO_URL: https://github.com/apache/dubbo-go-pixiu-samples.git
+ SAMPLES_CLONE_DIR: integrate_samples
steps:
- - name: Set up Go 1.x
- uses: actions/setup-go@v5
+ - uses: actions/checkout@v5
+ - uses: actions/setup-go@v6
with:
- go-version: ${{ matrix.go_version }}
- id: go
- - name: Check out code into the Go module directory
- uses: actions/checkout@v4
- - name: Cache dependencies
+ go-version-file: 'go.mod'
+ cache: true
+
+ - name: Resolve samples HEAD
+ id: samples_head
+ shell: bash
+ run: |
+ set -euo pipefail
+ head_sha="$(git ls-remote --heads "$SAMPLES_REPO_URL"
"$SAMPLES_BRANCH" | awk '{print $1}')"
+ if [ -z "$head_sha" ]; then
+ echo "Failed to resolve HEAD of $SAMPLES_REPO_URL $SAMPLES_BRANCH"
>&2
+ exit 1
+ fi
+ echo "sha=$head_sha" >> "$GITHUB_OUTPUT"
+
+ - name: Cache dubbo-go-pixiu-samples
+ id: cache_samples
uses: actions/cache@v4
with:
- # Cache
- path: ~/go/pkg/mod
- # Cache key
- key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- # An ordered list of keys to use for restoring the cache if no cache
hit occurred for key
+ path: ${{ env.SAMPLES_CLONE_DIR }}
+ key: ${{ runner.os }}-samples-${{ steps.samples_head.outputs.sha }}
restore-keys: |
- ${{ runner.os }}-go-
- - name: Merge base
- if: ${{ github.event_name == 'pull_request' }}
- run: |
- git fetch origin develop
- git checkout -b develop origin/develop
- git remote add devrepo
https://github.com/${{github.event.pull_request.head.repo.full_name}}.git
- git fetch devrepo ${{github.event.pull_request.head.sha}}
- git config --global user.email "[email protected]"
- git config --global user.name "robot"
- git merge ${{github.event.pull_request.head.sha}}
- - name: Get dependencies
+ ${{ runner.os }}-samples-
+
+ - name: Clone dubbo-go-pixiu-samples if not cached
+ if: steps.cache_samples.outputs.cache-hit != 'true'
+ shell: bash
run: |
- if [ -f Gopkg.toml ]; then
- curl
https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
- dep ensure
- else
- go get -v -t -d ./...
- fi
- # integration test
- # This step only runs when the event type is a pull_request
- - name: Integrate Test
- if: ${{ github.event_name == 'pull_request' }}
+ git clone --depth 1 -b "$SAMPLES_BRANCH" "$SAMPLES_REPO_URL"
"$SAMPLES_CLONE_DIR"
+
+ - name: Wire samples to local pixiu
+ working-directory: ${{ env.SAMPLES_CLONE_DIR }}
run: |
- chmod +x start_integrate_test.sh && [[ -n
"${{github.event.pull_request.head.repo.full_name}}" ]] && [[ -n
"${{github.event.pull_request.head.sha}}" ]] && [[ -n "${{github.base_ref}}" ]]
&& ./start_integrate_test.sh ${{github.event.pull_request.head.repo.full_name}}
${{github.event.pull_request.head.sha}} ${{github.base_ref}}
- # This step only runs when the event type is a push
- - name: Integrate Test
- if: ${{ github.event_name == 'push' }}
+ go mod edit -replace=github.com/apache/dubbo-go-pixiu=${{
github.workspace }}
+ go mod tidy
+
+ - name: Run Integration Tests
run: |
- chmod +x start_integrate_test.sh && ./start_integrate_test.sh
$GITHUB_REPOSITORY $GITHUB_SHA $GITHUB_BASE_REF
+ chmod +x start_integrate_test.sh
+ ./start_integrate_test.sh
\ No newline at end of file
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 36f93c8f..77db0317 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -16,10 +16,15 @@
# specific language governing permissions and limitations
# under the License.
#
+
name: Release
on:
release:
- types: [created]
+ types: [ created ]
+
+permissions:
+ contents: write
+ packages: write
jobs:
releases-matrix:
@@ -27,20 +32,23 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
- # build and publish in parallel: linux/386, linux/amd64, windows/386,
windows/amd64, darwin/amd64
- goos: [linux, windows]
- goarch: ["386", amd64, arm]
- exclude:
- - goarch: "arm"
+ # build and publish in parallel: linux/386, linux/amd64, linux/arm64,
windows/386, windows/amd64, darwin/amd64, darwin/arm64
+ goos: [ linux, windows, darwin ]
+ goarch: [ "386", amd64, arm64 ]
+ exclude:
+ - goarch: "386"
+ goos: darwin
+ - goarch: arm64
goos: windows
steps:
- - uses: actions/checkout@v4
- - uses: wangyoucao577/go-release-action@v1
+ - uses: actions/checkout@v5
+ - uses: wangyoucao577/go-release-action@v1 # NOSONAR
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
- goversion: "https://golang.org/dl/go1.23.4.linux-amd64.tar.gz"
+ goversion: "https://golang.org/dl/go1.25.0.linux-amd64.tar.gz"
project_path: "./cmd/pixiu"
binary_name: "dubbo-go-pixiu"
+ extra_files: LICENSE README.md
\ No newline at end of file
diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml
deleted file mode 100644
index b054929d..00000000
--- a/.github/workflows/reviewdog.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# 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.
-#
-name: reviewdog
-on: [ pull_request ]
-jobs:
- golangci-lint:
- name: review
- runs-on: ubuntu-latest
- steps:
- - name: Check out code into the Go module directory
- uses: actions/checkout@v4
- with:
- persist-credentials: false
- submodules: true
-
- - name: golangci-lint
- uses: golangci/golangci-lint-action@v6
- with:
- args: --timeout=10m
\ No newline at end of file
diff --git a/.golangci.yaml b/.golangci.yaml
index e176e876..7417bdde 100644
--- a/.golangci.yaml
+++ b/.golangci.yaml
@@ -1,56 +1,79 @@
-linters-settings:
- gocyclo:
- min-complexity: 10
- dupl:
- threshold: 100
- goconst:
- min-len: 2
- min-occurrences: 2
- depguard:
- rules:
- main:
- deny:
- - pkg: "github.com/sirupsen/logrus"
- desc: logging is allowed only by logutils.Log, logrus is allowed
to use only in logutils package
- misspell:
- locale: US
- ignore-words:
- - nto
- lll:
- line-length: 140
- gofmt:
- # simplify code: gofmt with `-s` option, true by default
- simplify: true
- rewrite-rules:
- - pattern: interface{}
- replacement: any
- goimports:
- local-prefixes: github.com/golangci/golangci-lint
- gocritic:
- enabled-tags:
- - performance
- - style
- - experimental
- disabled-checks:
- - wrapperFunc
-
+version: "2"
+run:
+ timeout: 20m
+issues:
+ new: true
linters:
- disable-all: true
+ default: none
enable:
- govet
- - staticcheck
- ineffassign
- - gofmt
- misspell
-
-issues:
- exclude-rules:
- - text: "weak cryptographic primitive"
- linters:
- - gosec
- - linters:
- - staticcheck
- text: "SA1019:"
- exclude-dirs:
- - test/testdata_etc
- - pkg/golinters/goanalysis/(checker|passes)
+ - staticcheck
+ settings:
+ depguard:
+ rules:
+ main:
+ deny:
+ - pkg: github.com/sirupsen/logrus
+ desc: logging is allowed only by logutils.Log, logrus is allowed
to use only in logutils package
+ dupl:
+ threshold: 100
+ goconst:
+ min-len: 2
+ min-occurrences: 2
+ gocritic:
+ disabled-checks:
+ - wrapperFunc
+ enabled-tags:
+ - performance
+ - style
+ - experimental
+ gocyclo:
+ min-complexity: 10
+ lll:
+ line-length: 140
+ misspell:
+ locale: US
+ ignore-rules:
+ - nto
+ exclusions:
+ generated: lax
+ presets:
+ - comments
+ - common-false-positives
+ - legacy
+ - std-error-handling
+ rules:
+ - linters:
+ - gosec
+ text: weak cryptographic primitive
+ - linters:
+ - staticcheck
+ text: 'SA1019:'
+ paths:
+ - test/testdata_etc
+ - pkg/golinters/goanalysis/(checker|passes)
+ - third_party$
+ - builtin$
+ - examples$
+formatters:
+ enable:
+ - gofmt
+ settings:
+ gofmt:
+ simplify: true
+ rewrite-rules:
+ - pattern: interface{}
+ replacement: any
+ goimports:
+ local-prefixes:
+ - github.com/golangci/golangci-lint
+ exclusions:
+ generated: lax
+ paths:
+ - test/testdata_etc
+ - pkg/golinters/goanalysis/(checker|passes)
+ - third_party$
+ - builtin$
+ - examples$
diff --git a/.licenserc.yaml b/.licenserc.yaml
index f01cd52b..d6f83cf8 100644
--- a/.licenserc.yaml
+++ b/.licenserc.yaml
@@ -29,6 +29,7 @@ header:
- '**/*.tmpl'
- '**/*.tpl'
- '**/*.ttf'
+ - '**/*.txt'
- '**/*.woff'
- '**/*.woff2'
- '**/*.yaml'
diff --git a/admin/controller/auth/auth.go b/admin/controller/auth/auth.go
index 098578b9..880912e8 100644
--- a/admin/controller/auth/auth.go
+++ b/admin/controller/auth/auth.go
@@ -148,7 +148,7 @@ func (j *JWT) RefreshToken(tokenString string) (string,
error) {
if claims, ok := token.Claims.(*CustomClaims); ok && token.Valid {
jwt.TimeFunc = time.Now
// Set token expiration time
- claims.StandardClaims.ExpiresAt = time.Now().Add(1 *
time.Hour).Unix()
+ claims.ExpiresAt = time.Now().Add(1 * time.Hour).Unix()
return j.CreateToken(*claims)
}
return "", TokenInvalid
diff --git a/admin/core/viper.go b/admin/core/viper.go
index b2d3cd30..276b8200 100644
--- a/admin/core/viper.go
+++ b/admin/core/viper.go
@@ -56,7 +56,7 @@ func Viper(path ...string) *viper.Viper {
v.SetConfigType("yaml")
err := v.ReadInConfig()
if err != nil {
- panic(fmt.Errorf("Fatal error config file: %s \n", err))
+ panic(fmt.Errorf("fatal error config file: %s", err))
}
v.WatchConfig()
diff --git a/admin/core/xds.go b/admin/core/xds.go
index d5354068..b3fde955 100644
--- a/admin/core/xds.go
+++ b/admin/core/xds.go
@@ -50,7 +50,6 @@ import (
"google.golang.org/protobuf/types/known/anypb"
"google.golang.org/protobuf/types/known/structpb"
- structpb2 "google.golang.org/protobuf/types/known/structpb"
)
import (
@@ -200,7 +199,7 @@ func makeHTTPFilter(listener fc.Listener)
*pixiupb.FilterChain {
Name: constant.HTTPConnectManagerFilter,
Config: &pixiupb.NetworkFilter_Struct{
Struct: func() *structpb.Struct {
- v, err :=
structpb2.NewStruct(map[string]any{
+ v, err :=
structpb.NewStruct(map[string]any{
"route_config":
map[string]any{
"routes":
routes,
},
diff --git a/admin/core/zap.go b/admin/core/zap.go
index ae365cbc..99fe8982 100644
--- a/admin/core/zap.go
+++ b/admin/core/zap.go
@@ -85,15 +85,15 @@ func getEncoderConfig() (config zapcore.EncoderConfig) {
EncodeDuration: zapcore.SecondsDurationEncoder,
EncodeCaller: zapcore.FullCallerEncoder,
}
- switch {
- case global.CONFIG.Zap.EncodeLevel == "LowercaseLevelEncoder": //
lowercase encoder (default)
+ switch global.CONFIG.Zap.EncodeLevel {
+ case "LowercaseLevelEncoder": // lowercase encoder (default)
config.EncodeLevel = zapcore.LowercaseLevelEncoder
- case global.CONFIG.Zap.EncodeLevel == "LowercaseColorLevelEncoder": //
lowercase encoder with color
+ case "LowercaseColorLevelEncoder": // lowercase encoder with color
// Uppercase encoder
config.EncodeLevel = zapcore.LowercaseColorLevelEncoder
- case global.CONFIG.Zap.EncodeLevel == "CapitalLevelEncoder": //
uppercase encoder
+ case "CapitalLevelEncoder": // uppercase encoder
config.EncodeLevel = zapcore.CapitalLevelEncoder
- case global.CONFIG.Zap.EncodeLevel == "CapitalColorLevelEncoder": //
uppercase encoder with color
+ case "CapitalColorLevelEncoder": // uppercase encoder with color
config.EncodeLevel = zapcore.CapitalColorLevelEncoder
default:
config.EncodeLevel = zapcore.LowercaseLevelEncoder
@@ -111,7 +111,7 @@ func getEncoder() zapcore.Encoder {
func getEncoderCore() (core zapcore.Core) {
writer, err := utils.GetWriteSyncer()
if err != nil {
- fmt.Printf("Get Write Syncer Failed err:%v", err.Error())
+ fmt.Printf("Get Write Syncer Failed err: %v", err.Error())
return
}
return zapcore.NewCore(getEncoder(), writer, level)
diff --git a/admin/logic/logic.go b/admin/logic/logic.go
index f80aa986..e2cfd753 100644
--- a/admin/logic/logic.go
+++ b/admin/logic/logic.go
@@ -570,8 +570,7 @@ func getMethodId() int {
}
func loopGetId(k string) int {
-
- for true {
+ for {
rawClient := config.Client.GetRawClient()
if rawClient == nil {
@@ -617,7 +616,6 @@ func loopGetId(k string) int {
return id
}
}
- return ErrID
}
func getRootPath(key string) string {
diff --git a/before_ut.sh b/before_ut.sh
deleted file mode 100755
index 02bef2d9..00000000
--- a/before_ut.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# 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.
-
-zkJarName="zookeeper-3.4.9-fatjar.jar"
-remoteJarUrl="https://github.com/dubbogo/resources/raw/master/zookeeper-4unitest/contrib/fatjar/${zkJarName}"
-zkJarPath="pkg/registry/zookeeper-4unittest/contrib/fatjar"
-zkJar="${zkJarPath}/${zkJarName}"
-
-if [ ! -f "${zkJar}" ]; then
- mkdir -p ${zkJarPath}
- wget -P "${zkJarPath}" ${remoteJarUrl}
-fi
\ No newline at end of file
diff --git a/before_validate_license.sh b/before_validate_license.sh
deleted file mode 100644
index 8fa6e381..00000000
--- a/before_validate_license.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# 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.
-
-remoteLicenseCheckerPath="https://github.com/dubbogo/resources/raw/master/tools/license"
-remoteLicenseCheckerName="license-header-checker"
-remoteLicenseCheckerURL="${remoteLicenseCheckerPath}/${remoteLicenseCheckerName}"
-remoteLicenseName="license.txt"
-remoteLicenseURL="${remoteLicenseCheckerPath}/${remoteLicenseName}"
-
-licensePath="/tmp/tools/license"
-mkdir -p ${licensePath}
-wget -P "${licensePath}" ${remoteLicenseCheckerURL}
-wget -P "${licensePath}" ${remoteLicenseURL}
diff --git a/go.mod b/go.mod
index 342188f7..d5dc8cfe 100644
--- a/go.mod
+++ b/go.mod
@@ -1,8 +1,6 @@
module github.com/apache/dubbo-go-pixiu
-go 1.23.0
-
-toolchain go1.23.4
+go 1.25
require (
dario.cat/mergo v1.0.1
@@ -37,8 +35,8 @@ require (
github.com/nacos-group/nacos-sdk-go v1.1.3
github.com/open-policy-agent/opa v0.45.0
github.com/pkg/errors v0.9.1
- github.com/prometheus/client_golang v1.14.0
- github.com/prometheus/common v0.37.0
+ github.com/prometheus/client_golang v1.23.0
+ github.com/prometheus/common v0.65.0
github.com/smartystreets/goconvey v1.7.2
github.com/spf13/cast v1.7.1
github.com/spf13/cobra v1.5.0
@@ -59,8 +57,8 @@ require (
go.opentelemetry.io/otel/sdk/metric v0.32.1
go.opentelemetry.io/otel/trace v1.10.0
go.uber.org/zap v1.21.0
- golang.org/x/crypto v0.40.0
- golang.org/x/net v0.42.0
+ golang.org/x/crypto v0.41.0
+ golang.org/x/net v0.43.0
google.golang.org/grpc v1.66.2
google.golang.org/protobuf v1.36.6
gopkg.in/yaml.v3 v3.0.1
@@ -150,7 +148,7 @@ require (
github.com/json-iterator/go v1.1.12 // indirect
github.com/jtolds/gls v4.20.0+incompatible // indirect
github.com/k0kubun/pp v3.0.1+incompatible // indirect
- github.com/klauspost/compress v1.17.11 // indirect
+ github.com/klauspost/compress v1.18.0 // indirect
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/knadh/koanf v1.5.0 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
@@ -160,13 +158,13 @@ require (
github.com/mailru/easyjson v0.7.6 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
- github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd //
indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/mschoch/smat v0.2.0 // indirect
+ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 //
indirect
github.com/nacos-group/nacos-sdk-go/v2 v2.2.2 // indirect
github.com/natefinch/lumberjack v2.0.0+incompatible // indirect
github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 //
indirect
@@ -180,8 +178,8 @@ require (
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/polarismesh/polaris-go v1.3.0 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c //
indirect
- github.com/prometheus/client_model v0.6.0 // indirect
- github.com/prometheus/procfs v0.8.0 // indirect
+ github.com/prometheus/client_model v0.6.2 // indirect
+ github.com/prometheus/procfs v0.16.1 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 //
indirect
github.com/robfig/cron/v3 v3.0.1 // indirect
github.com/shirou/gopsutil/v3 v3.22.2 // indirect
@@ -213,13 +211,13 @@ require (
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
- golang.org/x/arch v0.8.0 // indirect
- golang.org/x/oauth2 v0.21.0 // indirect
+ golang.org/x/arch v0.20.0 // indirect
+ golang.org/x/oauth2 v0.30.0 // indirect
golang.org/x/sync v0.16.0 // indirect
- golang.org/x/sys v0.34.0 // indirect
- golang.org/x/text v0.27.0 // indirect
- golang.org/x/time v0.1.0 // indirect
- golang.org/x/tools v0.34.0 // indirect
+ golang.org/x/sys v0.35.0 // indirect
+ golang.org/x/text v0.28.0 // indirect
+ golang.org/x/time v0.12.0 // indirect
+ golang.org/x/tools v0.36.0 // indirect
google.golang.org/genproto/googleapis/api
v0.0.0-20240604185151-ef581f913117 // indirect
google.golang.org/genproto/googleapis/rpc
v0.0.0-20240604185151-ef581f913117 // indirect
gopkg.in/ini.v1 v1.66.2 // indirect
diff --git a/go.sum b/go.sum
index 2e36f143..ce3d42db 100644
--- a/go.sum
+++ b/go.sum
@@ -816,8 +816,8 @@ github.com/google/go-cmp v0.5.6/go.mod
h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
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/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/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
+github.com/google/go-cmp v0.7.0/go.mod
h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
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=
@@ -1033,8 +1033,8 @@ github.com/kisielk/errcheck v1.2.0/go.mod
h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQL
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.13.6/go.mod
h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
-github.com/klauspost/compress v1.17.11
h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc=
-github.com/klauspost/compress v1.17.11/go.mod
h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0=
+github.com/klauspost/compress v1.18.0
h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
+github.com/klauspost/compress v1.18.0/go.mod
h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
github.com/klauspost/cpuid/v2 v2.0.9/go.mod
h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
github.com/klauspost/cpuid/v2 v2.2.7
h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM=
github.com/klauspost/cpuid/v2 v2.2.7/go.mod
h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
@@ -1056,6 +1056,8 @@ 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/leodido/go-urn v1.2.2/go.mod
h1:kUaIbLZWttglzwNuG0pgsh5vuV6u2YcGBYz1hIPjtOQ=
github.com/leodido/go-urn v1.4.0
h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
github.com/leodido/go-urn v1.4.0/go.mod
h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
@@ -1102,7 +1104,6 @@ github.com/mattn/go-isatty v0.0.20
h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE
github.com/mattn/go-isatty v0.0.20/go.mod
h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-runewidth v0.0.2/go.mod
h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod
h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
-github.com/matttproud/golang_protobuf_extensions v1.0.4
h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo=
github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod
h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
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=
@@ -1140,6 +1141,8 @@ github.com/modern-go/reflect2 v1.0.2/go.mod
h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjY
github.com/montanaflynn/stats v0.6.6/go.mod
h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow=
github.com/mschoch/smat v0.2.0 h1:8imxQsjDm8yFEAVBe7azKmKSgzSkZXDuKkSq9374khM=
github.com/mschoch/smat v0.2.0/go.mod
h1:kc9mz7DoBKqDyiRL7VZN8KvXQMWeTaVnttLRXOlotKw=
+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/nacos-group/nacos-sdk-go v1.0.8/go.mod
h1:hlAPn3UdzlxIlSILAyOXKxjFSvDJ9oLzTJ9hLAK1KzA=
@@ -1242,8 +1245,8 @@ github.com/prometheus/client_golang v1.11.1/go.mod
h1:Z6t4BnS23TR94PD6BsDNk8yVqr
github.com/prometheus/client_golang v1.12.1/go.mod
h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY=
github.com/prometheus/client_golang v1.12.2/go.mod
h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY=
github.com/prometheus/client_golang v1.13.0/go.mod
h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ=
-github.com/prometheus/client_golang v1.14.0
h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw=
-github.com/prometheus/client_golang v1.14.0/go.mod
h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y=
+github.com/prometheus/client_golang v1.23.0
h1:ust4zpdl9r4trLY/gSjlm07PuiBq2ynaXXlptpfy8Uc=
+github.com/prometheus/client_golang v1.23.0/go.mod
h1:i/o0R9ByOnHX0McrTMTyhYvKE4haaf2mW08I+jGAjEE=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod
h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod
h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod
h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
@@ -1251,8 +1254,8 @@ github.com/prometheus/client_model
v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:
github.com/prometheus/client_model v0.1.0/go.mod
h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.2.0/go.mod
h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.3.0/go.mod
h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w=
-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.2
h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk=
+github.com/prometheus/client_model v0.6.2/go.mod
h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE=
github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod
h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
github.com/prometheus/common v0.2.0/go.mod
h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.4.0/go.mod
h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
@@ -1263,8 +1266,9 @@ github.com/prometheus/common v0.10.0/go.mod
h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB8
github.com/prometheus/common v0.15.0/go.mod
h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s=
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.37.0
h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE=
github.com/prometheus/common v0.37.0/go.mod
h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA=
+github.com/prometheus/common v0.65.0
h1:QDwzd+G1twt//Kwj/Ww6E9FQq1iVMmODnILtW1t2VzE=
+github.com/prometheus/common v0.65.0/go.mod
h1:0gZns+BLRQ3V6NdaerOhMbwwRbNh9hkGINtQAsP5GS8=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod
h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod
h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod
h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
@@ -1274,8 +1278,9 @@ github.com/prometheus/procfs v0.1.3/go.mod
h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O
github.com/prometheus/procfs v0.2.0/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.8.0
h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo=
github.com/prometheus/procfs v0.8.0/go.mod
h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4=
+github.com/prometheus/procfs v0.16.1
h1:hZ15bTNuirocR6u0JZ6BAHHmwS1p8B4P6MRqxtzMyRg=
+github.com/prometheus/procfs v0.16.1/go.mod
h1:teAbpZRB1iIAJYREa1LsoWUXykVXA1KlTmWl8x/U+Is=
github.com/prometheus/tsdb v0.7.1/go.mod
h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
github.com/rabbitmq/amqp091-go v1.1.0/go.mod
h1:ogQDLSOACsLPsIq0NpbtiifNZi2YOz0VTJ0kHRghqbM=
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod
h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
@@ -1289,8 +1294,8 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod
h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L
github.com/rogpeppe/go-internal v1.3.0/go.mod
h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.6.1/go.mod
h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rogpeppe/go-internal v1.8.0/go.mod
h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE=
-github.com/rogpeppe/go-internal v1.9.0
h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
-github.com/rogpeppe/go-internal v1.9.0/go.mod
h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
+github.com/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/russross/blackfriday/v2 v2.0.1/go.mod
h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/russross/blackfriday/v2 v2.1.0/go.mod
h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/rwtodd/Go.Sed v0.0.0-20210816025313-55464686f9ef/go.mod
h1:8AEUvGVi2uQ5b24BIhcr0GCcpd/RNAFWaN2CJFrWIIQ=
@@ -1530,8 +1535,8 @@ go.uber.org/zap v1.21.0
h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8=
go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw=
golang.org/x/arch v0.0.0-20200826200359-b19915210f00/go.mod
h1:flIaEI6LNU6xOCD5PaJvn9wGP0agmIOqjrtsKGRguv4=
golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod
h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
-golang.org/x/arch v0.8.0 h1:3wRIsP3pM4yUptoR96otTUOXI367OS0+c9eeRi9doIc=
-golang.org/x/arch v0.8.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys=
+golang.org/x/arch v0.20.0 h1:dx1zTU0MAE98U+TQ8BLl7XsJbgze2WnNKF/8tGp/Q6c=
+golang.org/x/arch v0.20.0/go.mod
h1:bdwinDaKcfZUGpH09BB7ZmOfhalA8lQdzl62l8gGWsk=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod
h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod
h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod
h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
@@ -1552,8 +1557,8 @@ golang.org/x/crypto
v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5y
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod
h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.6.0/go.mod
h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=
golang.org/x/crypto v0.7.0/go.mod
h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
-golang.org/x/crypto v0.40.0 h1:r4x+VvoG5Fm+eJcxMaY8CQM7Lb0l1lsmjGBQ6s8BfKM=
-golang.org/x/crypto v0.40.0/go.mod
h1:Qr1vMER5WyS2dfPHAlsOj01wgLbsyWtFn/aY+5+ZdxY=
+golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4=
+golang.org/x/crypto v0.41.0/go.mod
h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc=
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=
@@ -1599,8 +1604,8 @@ golang.org/x/mod
v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91
golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
-golang.org/x/mod v0.25.0 h1:n7a+ZbQKQA/Ysbyb0/6IbB1H/X41mKgbhfv7AfG/44w=
-golang.org/x/mod v0.25.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
+golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ=
+golang.org/x/mod v0.27.0/go.mod h1:rWI627Fq0DEoudcK+MBkNkCe0EetEaDSwJJkCcjpazc=
golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod
h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod
h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod
h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -1676,8 +1681,8 @@ golang.org/x/net v0.4.0/go.mod
h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE=
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.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
-golang.org/x/net v0.42.0 h1:jzkYrhi3YQWD6MLBJcsklgQsoAcw89EcZbJw8Z614hs=
-golang.org/x/net v0.42.0/go.mod h1:FF1RA5d3u7nAYA4z2TkclSCKh68eSXtiFwcWQpPXdt8=
+golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE=
+golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg=
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=
@@ -1704,8 +1709,8 @@ golang.org/x/oauth2
v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri
golang.org/x/oauth2 v0.0.0-20221006150949-b44042a4b9c1/go.mod
h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg=
golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod
h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg=
golang.org/x/oauth2 v0.6.0/go.mod
h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw=
-golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs=
-golang.org/x/oauth2 v0.21.0/go.mod
h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
+golang.org/x/oauth2 v0.30.0 h1:dnDm7JmhM45NNpd8FDDeLhK6FwqbOf4MLCM9zb1BOHI=
+golang.org/x/oauth2 v0.30.0/go.mod
h1:B++QgG3ZKulg6sRPGD/mqlHQs5rB3Ml9erfeDY7xKlU=
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=
@@ -1836,8 +1841,8 @@ golang.org/x/sys v0.2.0/go.mod
h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.3.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.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA=
-golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
+golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI=
+golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
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=
@@ -1859,8 +1864,8 @@ golang.org/x/text v0.4.0/go.mod
h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
-golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4=
-golang.org/x/text v0.27.0/go.mod
h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU=
+golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng=
+golang.org/x/text v0.28.0/go.mod
h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU=
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod
h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod
h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod
h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
@@ -1869,8 +1874,9 @@ golang.org/x/time
v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxb
golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod
h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9/go.mod
h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20220922220347-f3bd1da661af/go.mod
h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
-golang.org/x/time v0.1.0 h1:xYY+Bajn2a7VBmTM5GikTmnK8ZuX8YgnQCqZpbBNtmA=
golang.org/x/time v0.1.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
+golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE=
+golang.org/x/time v0.12.0/go.mod
h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg=
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod
h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod
h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod
h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
@@ -1942,8 +1948,8 @@ golang.org/x/tools v0.1.12/go.mod
h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc
golang.org/x/tools v0.3.0/go.mod
h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k=
golang.org/x/tools v0.6.0/go.mod
h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.7.0/go.mod
h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s=
-golang.org/x/tools v0.34.0 h1:qIpSLOxeCYGg9TrcJokLBG4KFA6d795g0xkBkiESGlo=
-golang.org/x/tools v0.34.0/go.mod
h1:pAP9OwEaY1CAW3HOmg3hLZC5Z0CCmzjAF2UQMSqNARg=
+golang.org/x/tools v0.36.0 h1:kWS0uv/zsvHEle1LbV5LE8QujrxB3wfQyxHfhOk0Qkg=
+golang.org/x/tools v0.36.0/go.mod
h1:WBDiHKJK8YgLHlcQPYQzNCkUxUypCaa5ZegCVutKm+s=
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/integrate_test.sh b/integrate_test.sh
deleted file mode 100755
index 4501c823..00000000
--- a/integrate_test.sh
+++ /dev/null
@@ -1,46 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# 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.
-
-if [ -z "$1" ]; then
- echo 'Provide test directory please, like : ./integrate_test.sh
$(pwd)/samples/simple/server .'
- exit
-fi
-
-P_DIR=$(pwd)/$1
-PIXIU_DIR=$(pwd)
-
-make PROJECT_DIR=$P_DIR PIXIU_DIR=$PIXIU_DIR PROJECT_NAME=$(basename $P_DIR)
BASE_DIR=$P_DIR/dist -f igt/Makefile docker-up
-sleep 2
-# test
-make PROJECT_DIR=$P_DIR PIXIU_DIR=$PIXIU_DIR PROJECT_NAME=$(basename $P_DIR)
BASE_DIR=$P_DIR/dist -f igt/Makefile docker-health-check
-
-# start server
-make PROJECT_DIR=$P_DIR PIXIU_DIR=$PIXIU_DIR PROJECT_NAME=$(basename $P_DIR)
BASE_DIR=$P_DIR/dist -f igt/Makefile start
-sleep 2
-# start server
-make PROJECT_DIR=$P_DIR PIXIU_DIR=$PIXIU_DIR PROJECT_NAME=$(basename $P_DIR)
BASE_DIR=$P_DIR/dist -f igt/Makefile buildPixiu
-sleep 2
-# start integration
-make PROJECT_DIR=$P_DIR PIXIU_DIR=$PIXIU_DIR PROJECT_NAME=$(basename $P_DIR)
BASE_DIR=$P_DIR/dist -f igt/Makefile integration
-result=$?
-# stop server
-make PROJECT_DIR=$P_DIR PIXIU_DIR=$PIXIU_DIR PROJECT_NAME=$(basename $P_DIR)
BASE_DIR=$P_DIR/dist -f igt/Makefile clean
-
-make PROJECT_DIR=$P_DIR PIXIU_DIR=$PIXIU_DIR PROJECT_NAME=$(basename $P_DIR)
BASE_DIR=$P_DIR/dist -f igt/Makefile docker-down
-
-sleep 1
-
-exit $((result))
diff --git a/pkg/adapter/dubboregistry/registry/zookeeper/service_listener.go
b/pkg/adapter/dubboregistry/registry/zookeeper/service_listener.go
index bdc5feeb..54545a73 100644
--- a/pkg/adapter/dubboregistry/registry/zookeeper/service_listener.go
+++ b/pkg/adapter/dubboregistry/registry/zookeeper/service_listener.go
@@ -166,7 +166,7 @@ func (zkl *serviceListener) handleEvent() {
defer zkl.mutex.Unlock()
for i := range methods {
api := registry.CreateAPIConfig(apiPattern, location, bkConfig,
methods[i], mappingParams)
- key := api.URLPattern + ":" + string(api.Method.HTTPVerb)
+ key := api.URLPattern + ":" + string(api.HTTPVerb)
if _, ok := zkl.registryMethod[key]; ok {
return
}
diff --git a/pkg/adapter/dubboregistry/registrycenter.go
b/pkg/adapter/dubboregistry/registrycenter.go
index ca986527..40470170 100644
--- a/pkg/adapter/dubboregistry/registrycenter.go
+++ b/pkg/adapter/dubboregistry/registrycenter.go
@@ -120,14 +120,14 @@ func (a *Adapter) Config() any {
}
func (a *Adapter) OnAddAPI(r router.API) error {
- ipPort := strings.Split(r.IntegrationRequest.URL, ":")
+ ipPort := strings.Split(r.URL, ":")
port, err := strconv.Atoi(ipPort[1])
if err != nil {
return err
}
cluster := getClusterName(r)
server.GetClusterManager().SetEndpoint(cluster, &model.Endpoint{
- ID: r.IntegrationRequest.URL,
+ ID: r.URL,
Address: model.SocketAddress{
Address: ipPort[0],
Port: port,
@@ -151,7 +151,7 @@ func (a *Adapter) OnAddAPI(r router.API) error {
func (a *Adapter) OnRemoveAPI(r router.API) error {
cluster := getClusterName(r)
- server.GetClusterManager().DeleteEndpoint(cluster,
r.IntegrationRequest.URL)
+ server.GetClusterManager().DeleteEndpoint(cluster, r.URL)
return server.GetApiConfigManager().RemoveAPI(a.id, r)
}
diff --git a/pkg/client/dubbo/dubbo.go b/pkg/client/dubbo/dubbo.go
index b48fb043..f56ea652 100644
--- a/pkg/client/dubbo/dubbo.go
+++ b/pkg/client/dubbo/dubbo.go
@@ -176,7 +176,7 @@ func (dc *Client) Call(req *client.Request) (res any, err
error) {
return nil, errors.New("map parameters failed")
}
- dm := req.API.Method.IntegrationRequest
+ dm := req.API.IntegrationRequest
method := dm.Method
types := []string{}
vals := []hessian.Object{}
@@ -235,7 +235,7 @@ func (dc *Client) genericArgs(req *client.Request) (any,
error) {
// MapParams params mapping to api.
func (dc *Client) MapParams(req *client.Request) (any, error) {
- r := req.API.Method.IntegrationRequest
+ r := req.API.IntegrationRequest
values := newDubboTarget(r.MappingParams)
if dc.dubboProxyConfig != nil && dc.dubboProxyConfig.IsDefaultMap {
values = newDubboTarget(defaultMappingParams)
@@ -309,17 +309,17 @@ func (dc *Client) create(key string, irequest
fc.IntegrationRequest) *generic.Ge
RegistryIDs: registerIds,
Protocol: dubbo.DUBBO,
Generic: "true",
- Version: irequest.DubboBackendConfig.Version,
+ Version: irequest.Version,
Group: irequest.Group,
Loadbalance: dc.dubboProxyConfig.LoadBalance,
Retries: dc.dubboProxyConfig.Retries,
}
if refConf.Retries == "" {
- if len(irequest.DubboBackendConfig.Retries) == 0 {
+ if len(irequest.Retries) == 0 {
refConf.Retries = "3"
} else {
- refConf.Retries = irequest.DubboBackendConfig.Retries
+ refConf.Retries = irequest.Retries
}
}
diff --git a/pkg/client/dubbo/dubbo_test.go b/pkg/client/dubbo/dubbo_test.go
index bf3a65fa..c3397fad 100644
--- a/pkg/client/dubbo/dubbo_test.go
+++ b/pkg/client/dubbo/dubbo_test.go
@@ -94,7 +94,7 @@ func TestMappingParams(t *testing.T) {
dClient := NewDubboClient()
r, _ := http.NewRequest("GET", "/mock/test?id=12345&age=19",
bytes.NewReader([]byte("")))
api := mock.GetMockAPI(config.MethodGet, "/mock/test")
- api.IntegrationRequest.MappingParams = []config.MappingParam{
+ api.MappingParams = []config.MappingParam{
{
Name: "queryStrings.id",
MapTo: "0",
@@ -109,12 +109,12 @@ func TestMappingParams(t *testing.T) {
req := client.NewReq(context.TODO(), r, api)
params, err := dClient.MapParams(req)
assert.Nil(t, err)
- assert.Equal(t, params.(*dubboTarget).Values[0], "12345")
- assert.Equal(t, params.(*dubboTarget).Values[1], int(19))
+ assert.Equal(t, "12345", params.(*dubboTarget).Values[0])
+ assert.Equal(t, int(19), params.(*dubboTarget).Values[1])
r, _ = http.NewRequest("GET", "/mock/test?id=12345&age=19",
bytes.NewReader([]byte("")))
api = mock.GetMockAPI(config.MethodGet, "/mock/test")
- api.IntegrationRequest.MappingParams = []config.MappingParam{
+ api.MappingParams = []config.MappingParam{
{
Name: "queryStrings.id",
MapTo: "0",
@@ -135,13 +135,13 @@ func TestMappingParams(t *testing.T) {
req = client.NewReq(context.TODO(), r, api)
params, err = dClient.MapParams(req)
assert.Nil(t, err)
- assert.Equal(t, params.(*dubboTarget).Values[0], "12345")
- assert.Equal(t, params.(*dubboTarget).Values[1], int(19))
- assert.Equal(t, params.(*dubboTarget).Values[2], "1234567")
+ assert.Equal(t, "12345", params.(*dubboTarget).Values[0])
+ assert.Equal(t, int(19), params.(*dubboTarget).Values[1])
+ assert.Equal(t, "1234567", params.(*dubboTarget).Values[2])
r, _ = http.NewRequest("POST", "/mock/test?id=12345&age=19",
bytes.NewReader([]byte(`{"sex": "male", "name":{"firstName": "Joe", "lastName":
"Biden"}}`)))
api = mock.GetMockAPI(config.MethodGet, "/mock/test")
- api.IntegrationRequest.MappingParams = []config.MappingParam{
+ api.MappingParams = []config.MappingParam{
{
Name: "queryStrings.id",
MapTo: "0",
@@ -172,15 +172,15 @@ func TestMappingParams(t *testing.T) {
req = client.NewReq(context.TODO(), r, api)
params, err = dClient.MapParams(req)
assert.Nil(t, err)
- assert.Equal(t, params.(*dubboTarget).Values[0], "12345")
- assert.Equal(t, params.(*dubboTarget).Values[1], int(19))
- assert.Equal(t, params.(*dubboTarget).Values[2], "1234567")
- assert.Equal(t, params.(*dubboTarget).Values[3], "male")
- assert.Equal(t, params.(*dubboTarget).Values[4], "Joe")
+ assert.Equal(t, "12345", params.(*dubboTarget).Values[0])
+ assert.Equal(t, int(19), params.(*dubboTarget).Values[1])
+ assert.Equal(t, "1234567", params.(*dubboTarget).Values[2])
+ assert.Equal(t, "male", params.(*dubboTarget).Values[3])
+ assert.Equal(t, "Joe", params.(*dubboTarget).Values[4])
r, _ = http.NewRequest("POST", "/mock/test?id=12345&age=19",
bytes.NewReader([]byte(`{"sex": "male", "name":{"firstName": "Joe", "lastName":
"Biden"}}`)))
api = mock.GetMockAPI(config.MethodGet, "/mock/test")
- api.IntegrationRequest.MappingParams = []config.MappingParam{
+ api.MappingParams = []config.MappingParam{
{
Name: "queryStrings.id",
MapTo: "opt.method",
@@ -206,10 +206,10 @@ func TestMappingParams(t *testing.T) {
req = client.NewReq(context.TODO(), r, api)
_, err = dClient.MapParams(req)
assert.Nil(t, err)
- assert.Equal(t,
req.API.Method.IntegrationRequest.DubboBackendConfig.ApplicationName, "19")
- assert.Equal(t,
req.API.Method.IntegrationRequest.DubboBackendConfig.Group, "1234567")
- assert.Equal(t,
req.API.Method.IntegrationRequest.DubboBackendConfig.Interface, "Joe")
- assert.Equal(t,
req.API.Method.IntegrationRequest.DubboBackendConfig.Method, "12345")
+ assert.Equal(t, "19", req.API.ApplicationName)
+ assert.Equal(t, "1234567", req.API.Group)
+ assert.Equal(t, "Joe", req.API.Interface)
+ assert.Equal(t, "12345", req.API.Method.Method)
}
func TestBuildOption(t *testing.T) {
diff --git a/pkg/client/dubbo/mapper_test.go b/pkg/client/dubbo/mapper_test.go
index 79a98f9e..16f06576 100644
--- a/pkg/client/dubbo/mapper_test.go
+++ b/pkg/client/dubbo/mapper_test.go
@@ -38,7 +38,7 @@ import (
func TestQueryStringsMapper(t *testing.T) {
r, _ := http.NewRequest("GET", "/mock/test?id=12345&age=19",
bytes.NewReader([]byte("")))
api := mock.GetMockAPI(config.MethodGet, "/mock/test")
- api.IntegrationRequest.MappingParams = []config.MappingParam{
+ api.MappingParams = []config.MappingParam{
{
Name: "queryStrings.id",
MapTo: "0",
@@ -58,27 +58,27 @@ func TestQueryStringsMapper(t *testing.T) {
req := client.NewReq(context.TODO(), r, api)
- params := newDubboTarget(api.IntegrationRequest.MappingParams)
+ params := newDubboTarget(api.MappingParams)
qs := queryStringsMapper{}
// Giving valid mapping params
- err := qs.Map(api.IntegrationRequest.MappingParams[0], req, params, nil)
+ err := qs.Map(api.MappingParams[0], req, params, nil)
// it should not return error
assert.Nil(t, err)
// it should update the target value in target position from
corresponding query value in request.
assert.Equal(t, params.Values[0], "12345")
assert.Equal(t, params.Types[0], "string")
// Giving valid mapping params and same target
- err = qs.Map(api.IntegrationRequest.MappingParams[1], req, params, nil)
+ err = qs.Map(api.MappingParams[1], req, params, nil)
// it should return error when request does not contain the source
parameter
assert.EqualError(t, err, "Query parameter [name] does not exist")
// Giving invalid mapping params that is not a number and same target
- err = qs.Map(api.IntegrationRequest.MappingParams[2], req, params, nil)
+ err = qs.Map(api.MappingParams[2], req, params, nil)
// it should return error that points out the mapping param
assert.EqualError(t, err, "Parameter mapping {queryStrings.age jk int}
incorrect")
r, _ = http.NewRequest("GET", "/mock/test?id=12345&age=19",
bytes.NewReader([]byte("")))
api = mock.GetMockAPI(config.MethodGet, "/mock/test")
- api.IntegrationRequest.MappingParams = []config.MappingParam{
+ api.MappingParams = []config.MappingParam{
{
Name: "queryStrings.id",
MapTo: "1",
@@ -92,13 +92,13 @@ func TestQueryStringsMapper(t *testing.T) {
}
req = client.NewReq(context.TODO(), r, api)
- params = newDubboTarget(api.IntegrationRequest.MappingParams)
- err = qs.Map(api.IntegrationRequest.MappingParams[0], req, params, nil)
+ params = newDubboTarget(api.MappingParams)
+ err = qs.Map(api.MappingParams[0], req, params, nil)
assert.Nil(t, err)
assert.Equal(t, params.Values[1], "12345")
assert.Equal(t, params.Types[1], "string")
assert.Nil(t, params.Values[0])
- err = qs.Map(api.IntegrationRequest.MappingParams[1], req, params, nil)
+ err = qs.Map(api.MappingParams[1], req, params, nil)
assert.Nil(t, err)
assert.Equal(t, params.Types[0], "int")
assert.Equal(t, params.Values[0], 19)
@@ -108,7 +108,7 @@ func TestHeaderMapper(t *testing.T) {
r, _ := http.NewRequest("GET", "/mock/test?id=12345&age=19",
bytes.NewReader([]byte("")))
r.Header.Set("Auth", "1234567")
api := mock.GetMockAPI(config.MethodGet, "/mock/test")
- api.IntegrationRequest.MappingParams = []config.MappingParam{
+ api.MappingParams = []config.MappingParam{
{
Name: "headers.Auth",
MapTo: "0",
@@ -116,10 +116,10 @@ func TestHeaderMapper(t *testing.T) {
},
}
hm := headerMapper{}
- target := newDubboTarget(api.IntegrationRequest.MappingParams)
+ target := newDubboTarget(api.MappingParams)
req := client.NewReq(context.TODO(), r, api)
- err := hm.Map(api.IntegrationRequest.MappingParams[0], req, target, nil)
+ err := hm.Map(api.MappingParams[0], req, target, nil)
assert.Nil(t, err)
assert.Equal(t, target.Values[0], "1234567")
assert.Equal(t, target.Types[0], "string")
@@ -132,7 +132,7 @@ func TestBodyMapper(t *testing.T) {
r, _ := http.NewRequest("POST", "/mock/test?id=12345&age=19",
bytes.NewReader([]byte(`{"sex": "male", "name":{"firstName": "Joe", "lastName":
"Biden"}}`)))
r.Header.Set("Auth", "1234567")
api := mock.GetMockAPI(config.MethodGet, "/mock/test")
- api.IntegrationRequest.MappingParams = []config.MappingParam{
+ api.MappingParams = []config.MappingParam{
{
Name: "requestBody.sex",
MapTo: "0",
@@ -150,20 +150,20 @@ func TestBodyMapper(t *testing.T) {
},
}
bm := bodyMapper{}
- target := newDubboTarget(api.IntegrationRequest.MappingParams)
+ target := newDubboTarget(api.MappingParams)
req := client.NewReq(context.TODO(), r, api)
- err := bm.Map(api.IntegrationRequest.MappingParams[0], req, target, nil)
+ err := bm.Map(api.MappingParams[0], req, target, nil)
assert.Nil(t, err)
assert.Equal(t, target.Values[0], "male")
assert.Equal(t, target.Types[0], "string")
- err = bm.Map(api.IntegrationRequest.MappingParams[1], req, target, nil)
+ err = bm.Map(api.MappingParams[1], req, target, nil)
assert.Nil(t, err)
assert.Equal(t, target.Values[1], "Biden")
assert.Equal(t, target.Types[1], "string")
- err = bm.Map(api.IntegrationRequest.MappingParams[2], req, target, nil)
+ err = bm.Map(api.MappingParams[2], req, target, nil)
assert.Nil(t, err)
assert.Equal(t, target.Types[2], "object")
assert.Equal(t, target.Values[2], map[string]any(map[string]any{
@@ -176,7 +176,7 @@ func TestURIMapper(t *testing.T) {
`{"sex": "male", "name":{"firstName": "Joe", "lastName":
"Biden"}}`)))
r.Header.Set("Auth", "1234567")
api := mock.GetMockAPI(config.MethodGet, "/mock/:id/:name")
- api.IntegrationRequest.MappingParams = []config.MappingParam{
+ api.MappingParams = []config.MappingParam{
{
Name: "requestBody.sex",
MapTo: "0",
@@ -200,11 +200,11 @@ func TestURIMapper(t *testing.T) {
}
um := uriMapper{}
- target := newDubboTarget(api.IntegrationRequest.MappingParams)
+ target := newDubboTarget(api.MappingParams)
req := client.NewReq(context.TODO(), r, api)
- err := um.Map(api.IntegrationRequest.MappingParams[3], req, target, nil)
+ err := um.Map(api.MappingParams[3], req, target, nil)
assert.Nil(t, err)
- err = um.Map(api.IntegrationRequest.MappingParams[2], req, target, nil)
+ err = um.Map(api.MappingParams[2], req, target, nil)
assert.Nil(t, err)
assert.Equal(t, target.Values[2], "joe")
assert.Equal(t, target.Types[2], "object")
@@ -332,12 +332,12 @@ func TestSetGenericTarget(t *testing.T) {
opt = DefaultMapOption[optionKeyInterface]
err = setGenericTarget(req, opt, target, "testingInterface", "")
assert.Nil(t, err)
- assert.Equal(t, req.API.IntegrationRequest.Interface,
"testingInterface")
+ assert.Equal(t, req.API.Interface, "testingInterface")
opt = DefaultMapOption[optionKeyApplication]
err = setGenericTarget(req, opt, target, "testingApplication", "")
assert.Nil(t, err)
- assert.Equal(t, req.API.IntegrationRequest.ApplicationName,
"testingApplication")
+ assert.Equal(t, req.API.ApplicationName, "testingApplication")
}
func TestGetGenericMapTo(t *testing.T) {
diff --git a/pkg/client/dubbo/option.go b/pkg/client/dubbo/option.go
index c8538661..3f044d9d 100644
--- a/pkg/client/dubbo/option.go
+++ b/pkg/client/dubbo/option.go
@@ -64,7 +64,7 @@ func (opt *groupOpt) Action(target, val any) error {
if !ok {
return errors.New("Target is not *client.Request in value
options")
}
- r.API.IntegrationRequest.DubboBackendConfig.Group = v
+ r.API.Group = v
return nil
}
@@ -80,7 +80,7 @@ func (opt *versionOpt) Action(target, val any) error {
if !ok {
return errors.New("Target is not *client.Request in value
options")
}
- r.API.IntegrationRequest.DubboBackendConfig.Version = v
+ r.API.Version = v
return nil
}
@@ -96,7 +96,7 @@ func (opt *methodOpt) Action(target, val any) error {
if !ok {
return errors.New("Target is not *client.Request in value
options")
}
- r.API.IntegrationRequest.DubboBackendConfig.Method = v
+ r.API.DubboBackendConfig.Method = v
return nil
}
@@ -112,7 +112,7 @@ func (opt *applicationOpt) Action(target, val any) error {
if !ok {
return errors.New("Target is not *client.Request in value
options")
}
- r.API.IntegrationRequest.DubboBackendConfig.ApplicationName = v
+ r.API.ApplicationName = v
return nil
}
@@ -128,7 +128,7 @@ func (opt *interfaceOpt) Action(target, val any) error {
if !ok {
return errors.New("Target is not *client.Request in value
options")
}
- r.API.IntegrationRequest.DubboBackendConfig.Interface = v
+ r.API.Interface = v
return nil
}
@@ -158,7 +158,7 @@ func (opt *valuesOpt) Action(target, val any) error {
} else if val, ok := v[0].(string); !ok || val != "" {
toVals = []any{v[0]}
}
- if !(len(toTypes) != 0 && len(toTypes) == len(toVals)) {
+ if len(toTypes) == 0 || len(toTypes) != len(toVals) {
dubboTarget.Types = toTypes
dubboTarget.Values = toVals
return nil
diff --git a/pkg/client/http/http.go b/pkg/client/http/http.go
index 53d70061..a5dc1ec2 100644
--- a/pkg/client/http/http.go
+++ b/pkg/client/http/http.go
@@ -137,7 +137,7 @@ func (dc *Client) Call(req *client.Request) (resp any, err
error) {
// MapParams param mapping to api.
func (dc *Client) MapParams(req *client.Request) (reqData any, err error) {
- mp := req.API.IntegrationRequest.MappingParams
+ mp := req.API.MappingParams
r := newRequestParams()
if len(mp) == 0 {
r.Body = req.IngressRequest.Body
@@ -169,16 +169,16 @@ func (dc *Client) MapParams(req *client.Request) (reqData
any, err error) {
// ParseURL returns the actual target url. Supports wildcard target path value
mapping.
func (dc *Client) parseURL(req *client.Request, params requestParams) (string,
error) {
var schema string
- if len(req.API.IntegrationRequest.HTTPBackendConfig.Schema) == 0 {
+ if len(req.API.Schema) == 0 {
schema = "http"
} else {
- schema = req.API.IntegrationRequest.HTTPBackendConfig.Schema
+ schema = req.API.Schema
}
- rawPath := req.API.IntegrationRequest.HTTPBackendConfig.Path
+ rawPath := req.API.Path
if router.IsWildCardBackendPath(&req.API) {
paths := strings.Split(
-
strings.TrimLeft(req.API.IntegrationRequest.HTTPBackendConfig.Path,
constant.PathSlash),
+ strings.TrimLeft(req.API.Path, constant.PathSlash),
constant.PathSlash)
for i := 0; i < len(paths); i++ {
if strings.HasPrefix(paths[i],
constant.PathParamIdentifier) {
@@ -194,7 +194,7 @@ func (dc *Client) parseURL(req *client.Request, params
requestParams) (string, e
}
parsedURL := url.URL{
- Host: req.API.IntegrationRequest.HTTPBackendConfig.Host,
+ Host: req.API.Host,
Scheme: schema,
Path: rawPath,
RawQuery: params.Query.Encode(),
diff --git a/pkg/client/http/http_test.go b/pkg/client/http/http_test.go
index 94d961d3..2da0dfac 100644
--- a/pkg/client/http/http_test.go
+++ b/pkg/client/http/http_test.go
@@ -54,7 +54,7 @@ func TestMapParams(t *testing.T) {
assert.Equal(t, string(rawBody),
"{\"id\":\"12345\",\"age\":\"19\",\"testStruct\":{\"name\":\"mock\",\"test\":\"happy\",\"nickName\":\"trump\"}}")
- api.IntegrationRequest.MappingParams = []config.MappingParam{
+ api.MappingParams = []config.MappingParam{
{
Name: "queryStrings.team",
MapTo: "queryStrings.team",
@@ -80,8 +80,8 @@ func TestMapParams(t *testing.T) {
MapTo: "requestBody.nickName",
},
}
- api.IntegrationRequest.HTTPBackendConfig.Schema = "https"
- api.IntegrationRequest.HTTPBackendConfig.Host = "localhost"
+ api.Schema = "https"
+ api.Host = "localhost"
r, _ = http.NewRequest("POST", "/mock/test?team=theBoys",
bytes.NewReader([]byte(
"{\"id\":\"12345\",\"age\":\"19\",\"testStruct\":{\"name\":\"mock\",\"test\":\"happy\",\"nickName\":\"trump\"}}")))
r.Header.Set("Auth", "12345")
@@ -105,9 +105,9 @@ func TestParseURL(t *testing.T) {
r, _ := http.NewRequest("POST", "/mock/test/12345",
bytes.NewReader([]byte("")))
api := mock.GetMockAPI(config.MethodGet, "/mock/test/:id")
api.IntegrationRequest.RequestType = "http"
- api.IntegrationRequest.HTTPBackendConfig.Schema = "http"
- api.IntegrationRequest.HTTPBackendConfig.Host = "abc.com"
- api.IntegrationRequest.HTTPBackendConfig.Path = "/:id"
+ api.Schema = "http"
+ api.Host = "abc.com"
+ api.Path = "/:id"
req := client.NewReq(context.TODO(), r, api)
parsedURL, err := hClient.parseURL(req, *requestParams)
assert.Equal(t, parsedURL, "http://abc.com/12345")
@@ -122,7 +122,7 @@ func TestParseURL(t *testing.T) {
requestParams = newRequestParams()
requestParams.URIParams.Set("id", "12345")
- req.API.HTTPBackendConfig.Path = ""
+ req.API.Path = ""
parsedURL, err = hClient.parseURL(req, *requestParams)
assert.Equal(t, parsedURL, "http://abc.com")
assert.Nil(t, err)
diff --git a/pkg/client/http/mapper_test.go b/pkg/client/http/mapper_test.go
index 60c4342d..a7e49092 100644
--- a/pkg/client/http/mapper_test.go
+++ b/pkg/client/http/mapper_test.go
@@ -41,7 +41,7 @@ func TestQueryMapper(t *testing.T) {
qs := queryStringsMapper{}
r, _ := http.NewRequest("GET",
"/mock/test?id=12345&age=19&name=joe&nickName=trump",
bytes.NewReader([]byte("")))
api := mock.GetMockAPI(config.MethodGet, "/mock/test")
- api.IntegrationRequest.MappingParams = []config.MappingParam{
+ api.MappingParams = []config.MappingParam{
{
Name: "queryStrings.id",
MapTo: "headers.Id",
@@ -62,17 +62,17 @@ func TestQueryMapper(t *testing.T) {
req := client.NewReq(context.TODO(), r, api)
target := newRequestParams()
- err := qs.Map(api.IntegrationRequest.MappingParams[0], req, target, nil)
+ err := qs.Map(api.MappingParams[0], req, target, nil)
assert.Nil(t, err)
assert.Equal(t, target.Header.Get("Id"), "12345")
- err = qs.Map(api.IntegrationRequest.MappingParams[1], req, target, nil)
+ err = qs.Map(api.MappingParams[1], req, target, nil)
assert.Nil(t, err)
assert.Equal(t, target.Query.Get("name"), "joe")
- err = qs.Map(api.IntegrationRequest.MappingParams[2], req, target, nil)
+ err = qs.Map(api.MappingParams[2], req, target, nil)
assert.Nil(t, err)
- err = qs.Map(api.IntegrationRequest.MappingParams[3], req, target, nil)
+ err = qs.Map(api.MappingParams[3], req, target, nil)
assert.Nil(t, err)
rawBody, _ := io.ReadAll(target.Body)
assert.Equal(t, string(rawBody),
"{\"age\":\"19\",\"nickName\":\"trump\"}")
@@ -89,7 +89,7 @@ func TestHeaderMapper(t *testing.T) {
r.Header.Set("Origin-Passcode", "whoseyourdaddy")
r.Header.Set("Pokemon-Name", "Pika")
api := mock.GetMockAPI(config.MethodGet, "/mock/test")
- api.IntegrationRequest.MappingParams = []config.MappingParam{
+ api.MappingParams = []config.MappingParam{
{
Name: "headers.Auth",
MapTo: "headers.Auth",
@@ -110,18 +110,18 @@ func TestHeaderMapper(t *testing.T) {
req := client.NewReq(context.TODO(), r, api)
target := newRequestParams()
- err := hm.Map(api.IntegrationRequest.MappingParams[0], req, target, nil)
+ err := hm.Map(api.MappingParams[0], req, target, nil)
assert.Nil(t, err)
assert.Equal(t, target.Header.Get("Auth"), "xxxx12345xxx")
- err = hm.Map(api.IntegrationRequest.MappingParams[1], req, target, nil)
+ err = hm.Map(api.MappingParams[1], req, target, nil)
assert.Nil(t, err)
assert.Equal(t, target.Header.Get("Token"), "ttttt12345ttt")
- err = hm.Map(api.IntegrationRequest.MappingParams[2], req, target, nil)
+ err = hm.Map(api.MappingParams[2], req, target, nil)
assert.Nil(t, err)
assert.Equal(t, target.Query.Get("originPasscode"), "whoseyourdaddy")
- err = hm.Map(api.IntegrationRequest.MappingParams[3], req, target, nil)
+ err = hm.Map(api.MappingParams[3], req, target, nil)
assert.Nil(t, err)
rawBody, err := io.ReadAll(target.Body)
assert.Nil(t, err)
@@ -135,7 +135,7 @@ func TestBodyMapper(t *testing.T) {
bm := bodyMapper{}
r, _ := http.NewRequest("POST", "/mock/test",
bytes.NewReader([]byte("{\"id\":\"12345\",\"age\":\"19\",\"testStruct\":{\"name\":\"mock\",\"test\":\"happy\",\"nickName\":\"trump\"}}")))
api := mock.GetMockAPI(config.MethodGet, "/mock/test")
- api.IntegrationRequest.MappingParams = []config.MappingParam{
+ api.MappingParams = []config.MappingParam{
{
Name: "requestBody.id",
MapTo: "headers.Id",
@@ -156,18 +156,18 @@ func TestBodyMapper(t *testing.T) {
req := client.NewReq(context.TODO(), r, api)
target := newRequestParams()
- err := bm.Map(api.IntegrationRequest.MappingParams[0], req, target, nil)
+ err := bm.Map(api.MappingParams[0], req, target, nil)
assert.Nil(t, err)
assert.Equal(t, target.Header.Get("Id"), "12345")
target = newRequestParams()
- err = bm.Map(api.IntegrationRequest.MappingParams[1], req, target, nil)
+ err = bm.Map(api.MappingParams[1], req, target, nil)
assert.Nil(t, err)
- err = bm.Map(api.IntegrationRequest.MappingParams[2], req, target, nil)
+ err = bm.Map(api.MappingParams[2], req, target, nil)
assert.Nil(t, err)
- err = bm.Map(api.IntegrationRequest.MappingParams[3], req, target, nil)
+ err = bm.Map(api.MappingParams[3], req, target, nil)
assert.Nil(t, err)
rawBody, err := io.ReadAll(target.Body)
assert.Nil(t, err)
@@ -178,7 +178,7 @@ func TestURIMap(t *testing.T) {
um := uriMapper{}
r, _ := http.NewRequest("POST", "/mock/test/12345",
bytes.NewReader([]byte("{\"age\":\"19\",\"testStruct\":{\"name\":\"mock\",\"test\":\"happy\",\"nickName\":\"trump\"}}")))
api := mock.GetMockAPI(config.MethodGet, "/mock/test/:id")
- api.IntegrationRequest.MappingParams = []config.MappingParam{
+ api.MappingParams = []config.MappingParam{
{
Name: "uri.id",
MapTo: "headers.id",
@@ -187,7 +187,7 @@ func TestURIMap(t *testing.T) {
req := client.NewReq(context.TODO(), r, api)
target := newRequestParams()
- err := um.Map(api.IntegrationRequest.MappingParams[0], req, target, nil)
+ err := um.Map(api.MappingParams[0], req, target, nil)
assert.Nil(t, err)
assert.Equal(t, target.Header.Get("Id"), "12345")
diff --git a/pkg/client/proxy/proxy.go b/pkg/client/proxy/proxy.go
index 7e16952f..78b93a7f 100644
--- a/pkg/client/proxy/proxy.go
+++ b/pkg/client/proxy/proxy.go
@@ -78,7 +78,7 @@ func (p *Proxy) Call(ctx context.Context, serviceName,
methodName string, messag
return nil, errors.Wrap(err, stat.Message())
}
- outputMessage :=
dynamic.NewMessage(invocation.MethodDescriptor.GetOutputType())
+ outputMessage := dynamic.NewMessage(invocation.GetOutputType())
err = outputMessage.ConvertFrom(output)
if err != nil {
return nil, errors.Wrap(err, "response from backend could not
be converted internally")
diff --git a/pkg/client/request.go b/pkg/client/request.go
index b4b19821..4be361c9 100644
--- a/pkg/client/request.go
+++ b/pkg/client/request.go
@@ -49,8 +49,8 @@ func NewReq(ctx context.Context, request *http.Request, api
router.API) *Request
func (r *Request) GetURL() string {
ir := r.API.IntegrationRequest
if ir.RequestType == config.HTTPRequest {
- if len(ir.HTTPBackendConfig.URL) != 0 {
- return ir.HTTPBackendConfig.URL
+ if len(ir.URL) != 0 {
+ return ir.URL
}
// now only support http.
diff --git a/pkg/client/triple/triple.go b/pkg/client/triple/triple.go
index 6f205710..8d1f0498 100644
--- a/pkg/client/triple/triple.go
+++ b/pkg/client/triple/triple.go
@@ -80,7 +80,7 @@ func SingletonTripleClient(protoset []string) *Client {
// Call invoke service
func (tc *Client) Call(req *client.Request) (res any, err error) {
- address :=
strings.Split(req.API.IntegrationRequest.HTTPBackendConfig.URL, ":")
+ address := strings.Split(req.API.URL, ":")
p := proxy.NewProxy()
targetURL := &url.URL{
Scheme: address[0],
@@ -100,7 +100,7 @@ func (tc *Client) Call(req *client.Request) (res any, err
error) {
ctx, cancel := context.WithTimeout(ctx, req.Timeout)
defer cancel()
- call, err := p.Call(ctx, req.API.Method.IntegrationRequest.Interface,
req.API.Method.IntegrationRequest.Method, reqData, (*metadata.MD)(&meta))
+ call, err := p.Call(ctx, req.API.Interface, req.API.Method.Method,
reqData, (*metadata.MD)(&meta))
if err != nil {
return "", errors.Errorf("call triple server error = %s", err)
}
diff --git a/pkg/common/router/trie/trie.go b/pkg/common/router/trie/trie.go
index 4423cf8f..1fe44f95 100644
--- a/pkg/common/router/trie/trie.go
+++ b/pkg/common/router/trie/trie.go
@@ -142,7 +142,7 @@ func (trie Trie) Contains(withOutHost string) (bool, error)
{
if e != nil {
return true, e
}
- return !(ret == nil), nil
+ return ret != nil, nil
}
// Put node put
diff --git a/pkg/filter/http/apiconfig/api/discovery_service_test.go
b/pkg/filter/http/apiconfig/api/discovery_service_test.go
index 2e82b9a7..0e5f80aa 100644
--- a/pkg/filter/http/apiconfig/api/discovery_service_test.go
+++ b/pkg/filter/http/apiconfig/api/discovery_service_test.go
@@ -168,8 +168,8 @@ func TestLoadAPIFromResource(t *testing.T) {
func TestLoadAPIFromMethods(t *testing.T) {
mockPutAPIMethod := mock.GetMockAPI(fc.MethodPut, "").Method
mockPutAPIMethod2 := mock.GetMockAPI(fc.MethodPut, "").Method
- mockPutAPIMethod.IntegrationRequest.URL = "localhost:8080"
- mockPutAPIMethod2.IntegrationRequest.URL = "localhost:8081"
+ mockPutAPIMethod.URL = "localhost:8080"
+ mockPutAPIMethod2.URL = "localhost:8081"
tempMethods := []fc.Method{
mockPutAPIMethod,
mockPutAPIMethod2,
diff --git a/pkg/filter/http/apiconfig/api_config.go
b/pkg/filter/http/apiconfig/api_config.go
index 0e6f4ff3..6e929107 100644
--- a/pkg/filter/http/apiconfig/api_config.go
+++ b/pkg/filter/http/apiconfig/api_config.go
@@ -122,7 +122,7 @@ func (f *Filter) Decode(ctx *contexthttp.HttpContext)
filter.FilterStatus {
return filter.Stop
}
- if !v.Method.Enable {
+ if !v.Enable {
ctx.SendLocalReply(http.StatusNotAcceptable,
constant.Default406Body)
e := errors.Errorf("Requested API %s %s does not online",
req.Method, req.URL.Path)
logger.Debug(e.Error())
diff --git a/pkg/filter/http/loadbalancer/loadbalancer.go
b/pkg/filter/http/loadbalancer/loadbalancer.go
index 6bb0ac20..ffc6166f 100644
--- a/pkg/filter/http/loadbalancer/loadbalancer.go
+++ b/pkg/filter/http/loadbalancer/loadbalancer.go
@@ -75,8 +75,8 @@ func (factory *FilterFactory) PrepareFilterChain(ctx
*contexthttp.HttpContext, c
}
func (f *Filter) Decode(c *contexthttp.HttpContext) filter.FilterStatus {
- allInstances :=
strings.Split(c.GetAPI().IntegrationRequest.HTTPBackendConfig.URL, ",")
+ allInstances := strings.Split(c.GetAPI().URL, ",")
idx := rand.Int31n(int32(len(allInstances))) // NOSONAR
- c.Api.IntegrationRequest.HTTPBackendConfig.URL =
strings.TrimSpace(allInstances[idx])
+ c.Api.URL = strings.TrimSpace(allInstances[idx])
return filter.Continue
}
diff --git a/pkg/filter/http/remote/call.go b/pkg/filter/http/remote/call.go
index 92ced473..731c75e8 100644
--- a/pkg/filter/http/remote/call.go
+++ b/pkg/filter/http/remote/call.go
@@ -146,7 +146,7 @@ func (f *Filter) Decode(c *contexthttp.HttpContext)
filter.FilterStatus {
return filter.Continue
}
- typ := api.Method.IntegrationRequest.RequestType
+ typ := api.IntegrationRequest.RequestType
cli, err := f.matchClient(typ)
if err != nil {
diff --git
a/pkg/filter/http/remote/resolver/dubboresolver/dubbo_resolver_test.go
b/pkg/filter/http/remote/resolver/dubboresolver/dubbo_resolver_test.go
index 29e88a77..264bbd46 100644
--- a/pkg/filter/http/remote/resolver/dubboresolver/dubbo_resolver_test.go
+++ b/pkg/filter/http/remote/resolver/dubboresolver/dubbo_resolver_test.go
@@ -66,8 +66,8 @@ func TestStandardDubboResolver_Resolve(t *testing.T) {
{Name: "uri.interface", MapTo:
"opt.interface"},
{Name: "uri.method", MapTo:
"opt.method"},
}
- assert.Equal(t, expectedParams,
api.Method.IntegrationRequest.MappingParams)
- assert.Equal(t, apiConf.DubboRequest,
api.Method.IntegrationRequest.RequestType)
+ assert.Equal(t, expectedParams,
api.MappingParams)
+ assert.Equal(t, apiConf.DubboRequest,
api.IntegrationRequest.RequestType)
},
},
{
diff --git a/pkg/filter/http/remote/resolver/resolver_test.go
b/pkg/filter/http/remote/resolver/resolver_test.go
index c3311131..5154a509 100644
--- a/pkg/filter/http/remote/resolver/resolver_test.go
+++ b/pkg/filter/http/remote/resolver/resolver_test.go
@@ -197,13 +197,13 @@ func TestBaseResolver_BuildAPI(t *testing.T) {
assert.NoError(t, err)
assert.NotNil(t, api)
assert.Equal(t,
"/:application/:interface/:method", api.URLPattern)
- assert.Equal(t, string(http.MethodPost),
string(api.Method.HTTPVerb))
- assert.True(t, api.Method.Enable)
- assert.Equal(t, apiConf.HTTPRequest,
api.Method.InboundRequest.RequestType)
- assert.Equal(t, tt.expectedRequestType,
api.Method.IntegrationRequest.RequestType)
- assert.Equal(t, tt.expectedVersion,
api.Method.IntegrationRequest.DubboBackendConfig.Version)
- assert.Equal(t, tt.expectedGroup,
api.Method.IntegrationRequest.DubboBackendConfig.Group)
- assert.Equal(t, tt.mappingParams,
api.Method.IntegrationRequest.MappingParams)
+ assert.Equal(t, string(http.MethodPost),
string(api.HTTPVerb))
+ assert.True(t, api.Enable)
+ assert.Equal(t, apiConf.HTTPRequest,
api.InboundRequest.RequestType)
+ assert.Equal(t, tt.expectedRequestType,
api.IntegrationRequest.RequestType)
+ assert.Equal(t, tt.expectedVersion, api.Version)
+ assert.Equal(t, tt.expectedGroup, api.Group)
+ assert.Equal(t, tt.mappingParams,
api.MappingParams)
}
})
}
diff --git a/pkg/filter/mcp/mcpserver/context.go
b/pkg/filter/mcp/mcpserver/context.go
index 1404bec2..de9877c6 100644
--- a/pkg/filter/mcp/mcpserver/context.go
+++ b/pkg/filter/mcp/mcpserver/context.go
@@ -82,18 +82,18 @@ func (ctx *MCPContext) IsMCPToolCall() bool {
// StoreMCPDataInParams stores MCP data in HttpContext.Params for passing
through the filter chain
func (ctx *MCPContext) StoreMCPDataInParams() {
- if ctx.HttpContext.Params == nil {
- ctx.HttpContext.Params = make(map[string]any)
+ if ctx.Params == nil {
+ ctx.Params = make(map[string]any)
}
- ctx.HttpContext.Params[MCPDataKey] = ctx.mcpData
+ ctx.Params[MCPDataKey] = ctx.mcpData
}
// LoadMCPDataFromParams loads MCP data from HttpContext.Params
func (ctx *MCPContext) LoadMCPDataFromParams() {
- if ctx.HttpContext.Params == nil {
+ if ctx.Params == nil {
return
}
- if data, ok := ctx.HttpContext.Params[MCPDataKey].(*MCPData); ok {
+ if data, ok := ctx.Params[MCPDataKey].(*MCPData); ok {
ctx.mcpData = data
}
}
diff --git a/pkg/filter/mcp/mcpserver/handlers.go
b/pkg/filter/mcp/mcpserver/handlers.go
index f468b394..451d2dc8 100644
--- a/pkg/filter/mcp/mcpserver/handlers.go
+++ b/pkg/filter/mcp/mcpserver/handlers.go
@@ -428,36 +428,35 @@ func (f *MCPServerFilter) buildBackendRequest(ctx
*MCPContext, toolConfig ToolCo
queryParams := make(map[string]string)
// Process arguments based on their location (path, query, body)
- if arguments != nil {
- for argName, argValue := range arguments {
- // Find argument configuration
- var argConfig *ArgConfig
- for _, arg := range toolConfig.Args {
- if arg.Name == argName {
- argConfig = &arg
- break
- }
- }
- if argConfig == nil {
- continue // Skip unknown arguments
+ for argName, argValue := range arguments {
+ // Find argument configuration
+ var argConfig *ArgConfig
+ for _, arg := range toolConfig.Args {
+ if arg.Name == argName {
+ argConfig = &arg
+ break
}
+ }
- switch argConfig.In {
- case inPath:
- // Replace path parameters
- placeholder := fmt.Sprintf("{%s}", argName)
- replacement := fmt.Sprintf("%v", argValue)
- path = strings.ReplaceAll(path, placeholder,
replacement)
+ if argConfig == nil {
+ continue // Skip unknown arguments
+ }
- case inQuery:
- // Add to query parameters
- queryParams[argName] = fmt.Sprintf("%v",
argValue)
+ switch argConfig.In {
+ case inPath:
+ // Replace path parameters
+ placeholder := fmt.Sprintf("{%s}", argName)
+ replacement := fmt.Sprintf("%v", argValue)
+ path = strings.ReplaceAll(path, placeholder,
replacement)
- case inBody:
- // Add to request body
- bodyParams[argName] = argValue
- }
+ case inQuery:
+ // Add to query parameters
+ queryParams[argName] = fmt.Sprintf("%v", argValue)
+
+ case inBody:
+ // Add to request body
+ bodyParams[argName] = argValue
}
}
diff --git a/pkg/filter/network/grpcproxy/filter/proxy/grpc_proxy_filter.go
b/pkg/filter/network/grpcproxy/filter/proxy/grpc_proxy_filter.go
index 936470ca..eb1522cc 100644
--- a/pkg/filter/network/grpcproxy/filter/proxy/grpc_proxy_filter.go
+++ b/pkg/filter/network/grpcproxy/filter/proxy/grpc_proxy_filter.go
@@ -396,24 +396,21 @@ func (f *Filter) monitorConnection(cacheKey string, conn
*grpc.ClientConn) {
ticker := time.NewTicker(defaultHealthCheckInterval)
defer ticker.Stop()
- for {
- select {
- case <-ticker.C:
- state := conn.GetState()
- if state == connectivity.Shutdown || state ==
connectivity.TransientFailure {
- logger.Warnf("Connection to %s is in bad state
(%s), removing from pool",
- cacheKey, state.String())
-
- f.mu.Lock()
- if currentConn, ok :=
f.clientConnPool.Load(cacheKey); ok {
- if currentConn == conn {
-
f.clientConnPool.Delete(cacheKey)
- }
+ for range ticker.C {
+ state := conn.GetState()
+ if state == connectivity.Shutdown || state ==
connectivity.TransientFailure {
+ logger.Warnf("Connection to %s is in bad state (%s),
removing from pool",
+ cacheKey, state.String())
+
+ f.mu.Lock()
+ if currentConn, ok := f.clientConnPool.Load(cacheKey);
ok {
+ if currentConn == conn {
+ f.clientConnPool.Delete(cacheKey)
}
- f.mu.Unlock()
-
- return
}
+ f.mu.Unlock()
+
+ return
}
}
}
diff --git a/pkg/filter/network/grpcproxy/grpc_manager.go
b/pkg/filter/network/grpcproxy/grpc_manager.go
index c11dee62..2b7e7b97 100644
--- a/pkg/filter/network/grpcproxy/grpc_manager.go
+++ b/pkg/filter/network/grpcproxy/grpc_manager.go
@@ -200,9 +200,7 @@ func (gcm *GrpcProxyConnectionManager)
extractServiceName(ctx context.Context, f
// Fallback to parsing from the full method string, e.g.,
"/package.Service/Method" -> "package.Service"
// Trim leading slash for consistency
- if strings.HasPrefix(fullMethod, "/") {
- fullMethod = fullMethod[1:]
- }
+ fullMethod = strings.TrimPrefix(fullMethod, "/")
lastSlash := strings.LastIndex(fullMethod, "/")
if lastSlash > 0 {
diff --git a/pkg/filter/opa/opa.go b/pkg/filter/opa/opa.go
index 58cc65d3..56bae54d 100644
--- a/pkg/filter/opa/opa.go
+++ b/pkg/filter/opa/opa.go
@@ -91,7 +91,7 @@ func (factory *FilterFactory) Apply() error {
// PrepareFilterChain prepares the filter chain for a new request by
dynamically creating a Filter
func (factory *FilterFactory) PrepareFilterChain(ctx *http.HttpContext, chain
filter.FilterChain) error {
if factory.rego == nil {
- return fmt.Errorf("Rego instance not initialized in factory")
+ return fmt.Errorf("rego instance not initialized in factory")
}
preparedQuery, err := factory.rego.PrepareForEval(ctx.Ctx)
diff --git a/pkg/filter/traffic/traffic.go b/pkg/filter/traffic/traffic.go
index 086371f9..eee6dcd7 100644
--- a/pkg/filter/traffic/traffic.go
+++ b/pkg/filter/traffic/traffic.go
@@ -124,7 +124,7 @@ func (factory *FilterFactory) Apply() error {
}
if cluster.CanaryWeight > 0 && cluster.CanaryWeight <= 100 {
if up+cluster.CanaryWeight > 100 {
- return fmt.Errorf("[dubbo-go-pixiu] clusters'
weight sum more than 100 in %v service!", cluster.Router)
+ return fmt.Errorf("[dubbo-go-pixiu] clusters'
weight sum more than 100 in %v service", cluster.Router)
} else {
wp.weightFloor = up
up += cluster.CanaryWeight
diff --git a/pkg/router/api.go b/pkg/router/api.go
index 28ac8986..0c34ad26 100644
--- a/pkg/router/api.go
+++ b/pkg/router/api.go
@@ -38,8 +38,8 @@ func GetURIParams(api *router.API, rawURL url.URL) url.Values
{
// IsWildCardBackendPath checks whether the configured path of
// the upstream restful service contains parameters
func IsWildCardBackendPath(api *router.API) bool {
- if len(api.IntegrationRequest.Path) == 0 {
+ if len(api.Path) == 0 {
return false
}
- return strings.Contains(api.IntegrationRequest.Path,
constant.PathParamIdentifier)
+ return strings.Contains(api.Path, constant.PathParamIdentifier)
}
diff --git a/pkg/router/api_test.go b/pkg/router/api_test.go
index df9fabb1..61bc10cd 100644
--- a/pkg/router/api_test.go
+++ b/pkg/router/api_test.go
@@ -69,12 +69,12 @@ func TestIsWildCardBackendPath(t *testing.T) {
URLPattern: "/mock/:id/:name",
Method: getMockMethod(config.MethodGet),
}
- mockAPI.IntegrationRequest.Path = "/mock/:id"
+ mockAPI.Path = "/mock/:id"
assert.True(t, IsWildCardBackendPath(mockAPI))
- mockAPI.IntegrationRequest.Path = "/mock/test"
+ mockAPI.Path = "/mock/test"
assert.False(t, IsWildCardBackendPath(mockAPI))
- mockAPI.IntegrationRequest.Path = ""
+ mockAPI.Path = ""
assert.False(t, IsWildCardBackendPath(mockAPI))
}
diff --git a/pkg/router/route.go b/pkg/router/route.go
index a4dd0ba8..df2c0021 100644
--- a/pkg/router/route.go
+++ b/pkg/router/route.go
@@ -61,7 +61,7 @@ func (rt *Route) ClearAPI() error {
func (rt *Route) RemoveAPI(api router.API) {
lowerCasePath := strings.ToLower(api.URLPattern)
- key := getTrieKey(api.Method.HTTPVerb, lowerCasePath, false)
+ key := getTrieKey(api.HTTPVerb, lowerCasePath, false)
rt.lock.Lock()
defer rt.lock.Unlock()
@@ -82,7 +82,7 @@ func (rt *Route) RemoveAPI(api router.API) {
return
}
// avoid thread safe problem
- clusters :=
strings.Split(bizInfo.method.HTTPBackendConfig.URL, ",")
+ clusters := strings.Split(bizInfo.method.URL, ",")
if len(clusters) > 1 {
var i int
for i = 0; i < len(clusters); i++ {
@@ -96,10 +96,10 @@ func (rt *Route) RemoveAPI(api router.API) {
}
// operate pointer has no necessary to call
update api
- bizInfo.method.HTTPBackendConfig.URL =
strings.Join(append(clusters[:i], clusters[i+1:]...), ",")
+ bizInfo.method.URL =
strings.Join(append(clusters[:i], clusters[i+1:]...), ",")
} else {
// double check, avoid removing api that does
not exists
- if
!strings.Contains(bizInfo.method.HTTPBackendConfig.URL, api.URL) {
+ if !strings.Contains(bizInfo.method.URL,
api.URL) {
return
}
// if backend has only one node, then just
directly remove
@@ -122,7 +122,7 @@ func getTrieKey(method config.HTTPVerb, path string,
isPrefix bool) string {
// PutAPI puts an api into the resource
func (rt *Route) PutAPI(api router.API) error {
lowerCasePath := strings.ToLower(api.URLPattern)
- key := getTrieKey(api.Method.HTTPVerb, lowerCasePath, false)
+ key := getTrieKey(api.HTTPVerb, lowerCasePath, false)
node, ok := rt.getNode(key)
if !ok {
rn := &Node{
@@ -137,14 +137,14 @@ func (rt *Route) PutAPI(api router.API) error {
}
return errors.Errorf(
"Method %s with address %s already exists in path %s",
- api.Method.HTTPVerb, lowerCasePath, node.fullPath,
+ api.HTTPVerb, lowerCasePath, node.fullPath,
)
}
// PutOrUpdateAPI puts or updates an api into the resource
func (rt *Route) PutOrUpdateAPI(api router.API) error {
lowerCasePath := strings.ToLower(api.URLPattern)
- key := getTrieKey(api.Method.HTTPVerb, lowerCasePath, false)
+ key := getTrieKey(api.HTTPVerb, lowerCasePath, false)
rn := &Node{
fullPath: lowerCasePath,
method: &api.Method,
@@ -166,9 +166,9 @@ func (rt *Route) PutOrUpdateAPI(api router.API) error {
if bizInfo == nil || !ok {
return errors.New("bizInfoInterface.(*Node)
failed")
}
- if
!strings.Contains(bizInfo.method.HTTPBackendConfig.URL, api.URL) {
+ if !strings.Contains(bizInfo.method.URL, api.URL) {
// operate pointer has no necessary to call
update api
- bizInfo.method.HTTPBackendConfig.URL =
bizInfo.method.HTTPBackendConfig.URL + "," + api.URL
+ bizInfo.method.URL = bizInfo.method.URL + "," +
api.URL
}
}
} else {
diff --git a/pkg/server/cluster_manager.go b/pkg/server/cluster_manager.go
index fb0a3a13..e4ceeff7 100644
--- a/pkg/server/cluster_manager.go
+++ b/pkg/server/cluster_manager.go
@@ -157,7 +157,6 @@ func (cm *ClusterManager) CompareAndSetStore(store
*ClusterStore) bool {
func (cm *ClusterManager) PickEndpoint(clusterName string, policy
model.LbPolicy) *model.Endpoint {
cm.rw.RLock()
defer cm.rw.RUnlock()
-
c := cm.getCluster(clusterName)
if c == nil {
logger.Warnf("[dubbo-go-pixiu] cluster %s not found",
clusterName)
diff --git a/pkg/server/listener_manager.go b/pkg/server/listener_manager.go
index b139c657..e27b2c6b 100644
--- a/pkg/server/listener_manager.go
+++ b/pkg/server/listener_manager.go
@@ -106,7 +106,7 @@ func (lm *ListenerManager) gracefulShutdownInit() {
for _, listener := range lm.activeListenerService {
lm.shutdownWG.Add(1)
go func(listener *wrapListenerService) {
- err :=
listener.ListenerService.ShutDown(lm.shutdownWG)
+ err := listener.ShutDown(lm.shutdownWG)
if err != nil {
logger.Errorf("Shutdown Error: %+v",
err)
os.Exit(0)
diff --git a/pkg/tracing/driver.go b/pkg/tracing/driver.go
index 83263bfb..27002159 100644
--- a/pkg/tracing/driver.go
+++ b/pkg/tracing/driver.go
@@ -96,7 +96,7 @@ func newExporter(ctx context.Context, cfg
*model.TracerConfig) (sdktrace.SpanExp
case JAEGER:
return jaeger.NewJaegerExporter(cfg)
default:
- return nil, errors.New("no exporter error\n")
+ return nil, errors.New("no exporter error")
}
}
diff --git a/quick_start_for_windows.md b/quick_start_for_windows.md
deleted file mode 100644
index 52db7ea1..00000000
--- a/quick_start_for_windows.md
+++ /dev/null
@@ -1,57 +0,0 @@
-<a name="qorlm"></a>
-# Introduction
-This document describes how to run and debug Pixiu samples on Windows. Except
for testing, there is no need to enter a command line. <br />The run of each
sample is divided into four steps :
-> 1. Start the zookeeper
-> 1. Start dubbo-go provider
-> 1. Start pixiu
-> 1. Test
-
-The following will introduce how to start `body sample` under
samples/dubbogo/simple.
-<a name="b10EM"></a>
-# Prerequisite
-
-1. Use an IDE, such as Goland
-1. Install the zookeeper
-1. Install the curl for windows
- <a name="gq18V"></a>
-# Quick Start
-<a name="s2qQB"></a>
-## 1 Start zookeeper
-Go to the `zookeeper/bin` directory and double-click zkServer.cmd to start
zookeeper.
-<a name="db9k8"></a>
-## 2 Start dubbo-go provider
-
-- Firstly, modify run configuration for
samples/dubbogo/simple/body/server/app/server.go, and add two environment
variables.
-> -
CONF_PROVIDER_FILE_PATH:samples\dubbogo\simple\body\server\profiles\dev\server.yml
-> - APP_LOG_CONF_FILE:samples\dubbogo\simple\body\server\profiles\dev\log.yml
-
-- Secondly, execute main function of server.go.
- <a name="YzNS4"></a>
-## 3 Start pixiu
-Pixiu starts the application through command parameters, so we only need to
pass the command and parameters to the main function when starting.<br />
-
-- Firstly, modify run configuration for cmd/pixiu/pixiu.go, and add program
startup arguments `gateway start -c
samples\dubbogo\simple\body\pixiu\conf.yaml`.
-- Secondly, modify the file `samples\dubbogo\simple\body\pixiu\conf.yaml`, set
the path field as `samples\dubbogo\simple\body\pixiu\api_config.yaml`.
-```yaml
-http_filters:
- - name: dgp.filter.http.apiconfig
- config:
- path: samples\dubbogo\simple\body\pixiu\api_config.yaml
-```
-
-- Finally, execute main function of pixiu.go.
- <a name="W1LMZ"></a>
-## 4 Test
-Open cmd terminal,and enter the following command lines :
-```bash
-curl -s -X POST "localhost:8881/api/v1/test-dubbo/user" -d
"{\"id\":\"0003\",\"code\":3,\"name\":\"dubbogo\",\"age\":99}" --header
"Content-Type: application/json"
-curl -s -X PUT "localhost:8881/api/v1/test-dubbo/user" -d
"{\"id\":\"0003\",\"code\":3,\"name\":\"dubbogo\",\"age\":77}" --header
"Content-Type: application/json"
-curl -s -X PUT "localhost:8881/api/v1/test-dubbo/user2" -d
"{\"name\":\"dubbogo\",\"user\":{\"id\":\"0003\",\"code\":3,\"name\":\"dubbogo\",\"age\":88}}"
--header "Content-Type: application/json"
-```
-output:
-```
-{"age":99,"code":3,"iD":"0003","name":"dubbogo"}
-true
-true
-```
-Congratulations, successful startup.
diff --git a/start_integrate_test.sh b/start_integrate_test.sh
index 81bc4fce..c4b5ab3a 100755
--- a/start_integrate_test.sh
+++ b/start_integrate_test.sh
@@ -1,3 +1,5 @@
+#!/bin/bash
+
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
@@ -13,38 +15,36 @@
# 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.
-
-#!/bin/bash
+#
set -e
-set -x
-
-echo 'start integrate-test'
-# set root workspace
-ROOT_DIR=$(pwd)
-echo "integrate-test root work-space -> ${ROOT_DIR}"
+readonly PIXIU_ROOT_DIR=$(pwd)
+readonly SAMPLES_BRANCH="main"
+readonly
SAMPLES_REPO_URL="https://github.com/apache/dubbo-go-pixiu-samples.git"
+readonly SAMPLES_CLONE_DIR="integrate_samples"
-# show all github-env
-echo "github current commit id -> $2"
-echo "github pull request branch -> ${GITHUB_REF}"
-echo "github pull request slug -> ${GITHUB_REPOSITORY}"
-echo "github pull request repo slug -> ${GITHUB_REPOSITORY}"
-echo "github pull request actor -> ${GITHUB_ACTOR}"
-echo "github pull request repo param -> $1"
-echo "github pull request base branch -> $3"
-echo "github pull request head branch -> ${GITHUB_HEAD_REF}"
+echo "::group::Integration Test Environment Details"
+echo "Pixiu Root Directory: ${PIXIU_ROOT_DIR}"
+echo "Commit SHA: ${GITHUB_SHA}"
+echo "Target Branch for Samples: ${SAMPLES_BRANCH}"
+echo "Repository Slug: ${GITHUB_REPOSITORY}"
+echo "::endgroup::"
-echo "use dubbo-go-samples $3 branch for integration testing"
-git clone -b main https://github.com/apache/dubbo-go-pixiu-samples.git
integrate_samples && cd integrate_samples
+if [ ! -d "$SAMPLES_CLONE_DIR" ]; then
+ echo "> Cloning dubbo-go-samples (branch: ${SAMPLES_BRANCH})..."
+ git clone --depth 1 -b "${SAMPLES_BRANCH}" "${SAMPLES_REPO_URL}"
"${SAMPLES_CLONE_DIR}"
+fi
-# update dubbo-go to current commit id
-go mod edit -replace=github.com/apache/dubbo-go-pixiu=github.com/"$1"@"$2"
+cd "${SAMPLES_CLONE_DIR}"
-#grep -rl "github.com/apache/dubbo-go-pixiu/pkg" | xargs sed -i
's/github.com\/apache\/dubbo-go-pixiu\/pkg\//github.com\/apache\/dubbo-go-pixiu\/pixiu\/pkg\//g'
+echo "> Configuring Go modules to use local pixiu code..."
+go mod edit -replace="github.com/apache/dubbo-go-pixiu=${PIXIU_ROOT_DIR}"
-# prepare dependency
+echo "> Preparing dependencies..."
go mod tidy
-# start integrate test
-./start_integrate_test.sh
+echo "> Handing off to the integration test runner..."
+bash ./start_integrate_test.sh
+
+echo "Integration tests completed successfully."
\ No newline at end of file