Skip to content

Commit

Permalink
Merge pull request apache#7 from apache/develop
Browse files Browse the repository at this point in the history
Merge dev 20210701
  • Loading branch information
alchemy-lee authored Jul 1, 2021
2 parents ea5e29e + fa5681d commit 45a63f4
Show file tree
Hide file tree
Showing 72 changed files with 1,757 additions and 1,641 deletions.
2 changes: 1 addition & 1 deletion .asf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ github:
required_status_checks:
strict: true
contexts:
- "ubuntu-latest - Go 1.14"
- "ubuntu-latest - Go 1.15"

notifications:
commits: [email protected]
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
# If you want to matrix build , you can append the following list.
matrix:
go_version:
- 1.15
- 1.14
os:
- ubuntu-latest
Expand Down
12 changes: 10 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
./dubbo-go-pixiu

# app
dubbo-go-pixiu
dubbo-go-pixiu.exe
dubbgo_server.out
samples/dubbogo/simple/server/app/app

/logs
/.idea
/.vscode
pkg/registry/zookeeper-4unittest/contrib/fatjar
pkg/registry/zookeeper-4unittest/contrib/fatjar


2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
language: go

go:
- "1.14"
- "1.15"
env:
- GO111MODULE=on

Expand Down
17 changes: 9 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,31 @@

cur_mkfile := $(abspath $(lastword $(MAKEFILE_LIST)))
currentPath := $(patsubst %/, %, $(dir $(cur_mkfile)))
$(info cur_makefile_path1=$(currentPath))
pixiuPath := /cmd/pixiu/
mainPath := $(currentPath)$(pixiuPath)
$(info $(mainPath))

targetName := dubbo-go-pixiu

api-config-path:=${api-config}
ifeq ("",$(api-config-path))
api-config-path = configs/api_config.yaml
ifeq (,$(api-config-path))
$(warning api-config-path is nil, default: configs/api_config.yaml)
api-config-path = configs/api_config.yaml
endif

config-path:=${config-path}
ifeq ("",$(config-path))
config-path = configs/conf.yaml
ifeq (,$(config-path))
$(warning config-path is nil, default: configs/conf.yaml)
config-path = configs/conf.yaml
endif

$(info api-config-path = $(api-config-path))
$(info config-path = $(config-path))

os := $(shell go env GOOS)
$(info os is $(os))
ifeq (windows,$(os))
targetName = dubbo-go-pixiu.exe
endif
exe := $(mainPath)$(targetName)
$(info path of exe is $(exe))
build:
cd $(mainPath) && go build -o $(targetName)

Expand Down
193 changes: 0 additions & 193 deletions cmd/admin/admin.go

This file was deleted.

2 changes: 1 addition & 1 deletion cmd/pixiu/control.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ var (
initFromRemote := false
if bootstrap.GetAPIMetaConfig() != nil {
if _, err := config.LoadAPIConfig(bootstrap.GetAPIMetaConfig()); err != nil {
logger.Errorf("load api config from etcd error:%+v", err)
logger.Warnf("load api config from etcd error:%+v", err)
} else {
initFromRemote = true
}
Expand Down
9 changes: 0 additions & 9 deletions cmd/pixiu/pixiu.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,6 @@ import (
"github.com/urfave/cli"
)

import (
_ "github.com/apache/dubbo-go-pixiu/pkg/filter/accesslog"
_ "github.com/apache/dubbo-go-pixiu/pkg/filter/logger"
_ "github.com/apache/dubbo-go-pixiu/pkg/filter/recovery"
_ "github.com/apache/dubbo-go-pixiu/pkg/filter/remote"
_ "github.com/apache/dubbo-go-pixiu/pkg/filter/response"
_ "github.com/apache/dubbo-go-pixiu/pkg/filter/timeout"
)

// Version pixiu version
var Version = "0.3.0"

Expand Down
23 changes: 0 additions & 23 deletions configs/admin_config.yaml

This file was deleted.

33 changes: 32 additions & 1 deletion configs/api_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ resources:
- path: '/api/v1/test-dubbo/user'
type: restful
description: user
timeout: 100ms
plugins:
pre:
pluginNames:
Expand Down Expand Up @@ -79,4 +80,34 @@ pluginsGroup:
- name: "trace"
version: "0.0.1"
priority: 1000
externalLookupName: "ExternalPluginTrace"
externalLookupName: "ExternalPluginTrace"
rateLimit:
resources:
- name: test-dubbo
items:
#Exact
- matchStrategy: 0
pattern: "/api/v1/test-dubbo/user"
#Regex
- matchStrategy: 1
pattern: "/api/v1/test-dubbo/user/*"
- name: test-http
items:
#Exact
- matchStrategy: 0
pattern: "/api/v1/http/foo"
- matchStrategy: 0
pattern: "/api/v1/http/bar"
#Regex
- matchStrategy: 1
pattern: "/api/v1/http/foo/*"
- matchStrategy: 1
pattern: "/api/v1/http/bar/*"

rules:
#qps sample At most 100 requests can be passed in 1000ms, so qps is 100
- resource: "test-dubbo"
enable: true
flowRule:
threshold: 100
statintervalinms: 1000
5 changes: 3 additions & 2 deletions configs/conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,16 @@ static_resources:
clusters:
- name: "test_dubbo"
lb_policy: "RoundRobin"
connect_timeout: "5s"
request_timeout: "10s"
registries:
"zookeeper":
protocol: "zookeeper"
timeout: "3s"
address: "127.0.0.1:2181"
username: ""
password: ""
timeout_config:
connect_timeout: "5s"
request_timeout: "10s"
shutdown_config:
timeout: "60s"
step_timeout: "10s"
Expand Down
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* [dubbo](sample/dubbo.md)
* [http](sample/http.md)
* [mock](sample/mock.md)
* [plugins](../samples/plugins/index.md)

## [User Guide](user/README.md)

Expand Down
Loading

0 comments on commit 45a63f4

Please sign in to comment.