Skip to content

Commit

Permalink
Merge pull request #1 from apache/develop
Browse files Browse the repository at this point in the history
20210521Merge

Former-commit-id: ab65f3e
  • Loading branch information
alchemy-lee authored May 21, 2021
2 parents a512529 + e249bd2 commit 768578b
Show file tree
Hide file tree
Showing 37 changed files with 773 additions and 699 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ jobs:
- name: golangci-lint
uses: ./.github/actions/review-dog
with:
golangci_lint_flags: "--enable-all --timeout=10m --exclude-use-default=false"
golangci_lint_flags: "--timeout=10m"
2 changes: 1 addition & 1 deletion cmd/pixiu/pixiu.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import (
)

// Version pixiu version
var Version = "0.1.0"
var Version = "0.3.0"

// main pixiu run method
func main() {
Expand Down
7 changes: 4 additions & 3 deletions docs/sample/dubbo-body.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ resources:
mappingParams:
- name: requestBody._all
mapTo: 0
mapType: "object"
applicationName: "UserProvider"
interface: "com.dubbogo.pixiu.UserService"
method: "CreateUser"
paramTypes: [ "object" ]
group: "test"
version: 1.0.0
clusterName: "test_dubbo"
Expand All @@ -41,10 +41,10 @@ resources:
mappingParams:
- name: requestBody._all
mapTo: 0
mapType: "object"
applicationName: "UserProvider"
interface: "com.dubbogo.pixiu.UserService"
method: "UpdateUser"
paramTypes: [ "object" ]
group: "test"
version: 1.0.0
clusterName: "test_dubbo"
Expand All @@ -62,12 +62,13 @@ resources:
mappingParams:
- name: requestBody.name
mapTo: 0
mapType: "string"
- name: requestBody.user
mapTo: 1
mapType: "object"
applicationName: "UserService"
interface: "com.dubbogo.pixiu.UserService"
method: "UpdateUserByName"
paramTypes: [ "string", "object" ]
group: "test"
version: 1.0.0
clusterName: "test_dubbo"
Expand Down
9 changes: 6 additions & 3 deletions docs/sample/dubbo-mix.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ resources:
mappingParams:
- name: uri.name
mapTo: 0
mapType: "string"
- name: queryStrings.age
mapTo: 1
mapType: "int"
applicationName: "UserService"
interface: "com.dubbogo.pixiu.UserService"
method: "GetUserByNameAndAge"
paramTypes: [ "string", "int" ]
group: "test"
version: 1.0.0
clusterName: "test_dubbo"
Expand All @@ -43,12 +44,13 @@ resources:
mappingParams:
- name: uri.name
mapTo: 0
mapType: "string"
- name: requestBody._all
mapTo: 1
mapType: "object"
applicationName: "UserService"
interface: "com.dubbogo.pixiu.UserService"
method: "UpdateUserByName"
paramTypes: [ "string", "object" ]
group: "test"
version: 1.0.0
clusterName: "test_dubbo"
Expand All @@ -66,12 +68,13 @@ resources:
mappingParams:
- name: queryStrings.name
mapTo: 0
mapType: "string"
- name: requestBody._all
mapTo: 1
mapType: "object"
applicationName: "UserService"
interface: "com.dubbogo.pixiu.UserService"
method: "UpdateUserByName"
paramTypes: [ "string", "object" ]
group: "test"
version: 1.0.0
clusterName: "test_dubbo"
Expand Down
10 changes: 6 additions & 4 deletions docs/sample/dubbo-multi.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ resources:
mappingParams:
- name: uri.name
mapTo: 0
mapType: "string"
applicationName: "StudentService"
interface: "com.dubbogo.pixiu.StudentService"
method: "GetStudentByName"
paramTypes: [ "string" ]
group: "test"
version: 1.0.0
clusterName: "test_dubbo"
Expand All @@ -43,12 +43,13 @@ resources:
mappingParams:
- name: uri.name
mapTo: 0
mapType: "string"
- name: requestBody._all
mapTo: 1
mapType: "object"
applicationName: "StudentService"
interface: "com.dubbogo.pixiu.StudentService"
method: "UpdateStudentByName"
paramTypes: [ "string", "object" ]
group: "test"
version: 1.0.0
clusterName: "test_dubbo"
Expand All @@ -68,10 +69,10 @@ resources:
mappingParams:
- name: uri.name
mapTo: 0
mapType: "string"
applicationName: "TeacherService"
interface: "com.dubbogo.pixiu.TeacherService"
method: "GetTeacherByName"
paramTypes: [ "string" ]
group: "test"
version: 1.0.0
clusterName: "test_dubbo"
Expand All @@ -85,12 +86,13 @@ resources:
mappingParams:
- name: uri.name
mapTo: 0
mapType: "string"
- name: requestBody._all
mapTo: 1
mapType: "object"
applicationName: "TeacherService"
interface: "com.dubbogo.pixiu.TeacherService"
method: "UpdateTeacherByName"
paramTypes: [ "string", "object" ]
group: "test"
version: 1.0.0
clusterName: "test_dubbo"
Expand Down
7 changes: 4 additions & 3 deletions docs/sample/dubbo-query.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ resources:
mappingParams:
- name: queryStrings.name
mapTo: 0
mapType: "string"
applicationName: "UserService"
interface: "com.dubbogo.pixiu.UserService"
method: "GetUserByName"
paramTypes: [ "string" ]
group: "test"
version: 1.0.0
clusterName: "test_dubbo"
Expand All @@ -45,12 +45,13 @@ resources:
mappingParams:
- name: queryStrings.name
mapTo: 0
mapType: "string"
- name: queryStrings.age
mapTo: 1
mapType: "int"
applicationName: "UserService"
interface: "com.dubbogo.pixiu.UserService"
method: "GetUserByNameAndAge"
paramTypes: [ "string","int" ]
group: "test"
version: 1.0.0
clusterName: "test_dubbo"
Expand All @@ -68,10 +69,10 @@ resources:
mappingParams:
- name: queryStrings.code
mapTo: 0
mapType: "int"
applicationName: "UserService"
interface: "com.dubbogo.pixiu.UserService"
method: "GetUserByCode"
paramTypes: [ "int" ]
group: "test"
version: 1.0.0
clusterName: "test_dubbo"
Expand Down
63 changes: 17 additions & 46 deletions docs/sample/dubbo-universality.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,44 +25,20 @@ resources:
requestType: dubbo
mappingParams:
- name: requestBody.values
mapTo: 0
opt:
open: true
usable: true
name: values
mapTo: opt.values
- name: requestBody.types
mapTo: 1
opt:
open: true
name: types
mapTo: opt.types
- name: uri.application
mapTo: 2
opt:
open: true
name: application
mapTo: opt.application
- name: uri.interface
mapTo: 3
opt:
open: true
name: interface
mapTo: opt.interface
- name: queryStrings.method
mapTo: 4
opt:
open: true
name: method
mapTo: opt.method
- name: queryStrings.group
mapTo: 5
opt:
open: true
name: group
mapTo: opt.group
- name: queryStrings.version
mapTo: 6
opt:
open: true
name: version
paramTypes: ["object", "object", "string", "string", "string", "string", "string"]
mapTo: opt.version
# Notice: this is the really paramTypes to dubbo service, it takes precedence over paramTypes when it is finally called.
toParamTypes: ["string"]
clusterName: "test_dubbo"
```
Expand Down Expand Up @@ -134,7 +110,7 @@ const (

#### Options

Assemble generic params to invoke.
By configuring mapTo with option keywords(listed below), Pixiu will assemble generic params to invoke.

```go
// GenericService uses for generic invoke for service call
Expand All @@ -144,33 +120,33 @@ type GenericService struct {
}
```

- types
- opt.types

> dubbo generic types
Use for dubbogo `GenericService#Invoke` func arg 2rd param.

- method
- opt.method

Use for dubbogo `GenericService#Invoke` func arg 1rd param.

- group
- opt.group

Dubbo group in `ReferenceConfig#Group`.

- version
- opt.version

Dubbo version in `ReferenceConfig#Version`.

- interface
- opt.interface

Dubbo interface in `ReferenceConfig#InterfaceName`.

- application
- opt.application

Now only use for part of cache key.

- values
- opt.values

Use for dubbogo `GenericService#Invoke` func arg 3rd param.

Expand All @@ -191,16 +167,11 @@ request body

```yaml
- name: requestBody.types
mapTo: 1
opt:
open: true
name: types
mapTo: opt.types
```
- `requestBody.types` means body content with types key.
- `opt.name` means use types option.
- `opt.open` must `true` will create opt,may be deleted in the future for thin provisioning。
- `opt.usable` means if remove the request to downstream service.
- `opt.types` means use types option.

##### Multiple params

Expand Down
7 changes: 4 additions & 3 deletions docs/sample/dubbo-uri.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ resources:
mappingParams:
- name: uri.name
mapTo: 0
mapType: "string"
applicationName: "UserProvider"
interface: "com.dubbogo.pixiu.UserService"
method: "GetUserByName"
paramTypes: [ "string" ]
group: "test"
version: 1.0.0
clusterName: "test_dubbo"
Expand All @@ -51,10 +51,10 @@ resources:
mappingParams:
- name: uri.code
mapTo: 0
mapType: "int"
applicationName: "UserProvider"
interface: "com.dubbogo.pixiu.UserService"
method: "GetUserByCode"
paramTypes: [ "int" ]
group: "test"
version: 1.0.0
clusterName: "test_dubbo"
Expand All @@ -77,12 +77,13 @@ resources:
mappingParams:
- name: uri.name
mapTo: 0
mapType: "string"
- name: uri.age
mapTo: 1
mapType: "int"
applicationName: "UserProvider"
interface: "com.dubbogo.pixiu.UserService"
method: "GetUserByNameAndAge"
paramTypes: [ "string", "int" ]
group: "test"
version: 1.0.0
clusterName: "test_dubbo"
Expand Down
7 changes: 4 additions & 3 deletions docs/sample/zh-cn/dubbo-body.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ resources:
mappingParams:
- name: requestBody._all
mapTo: 0
mapType: "object"
applicationName: "UserProvider"
interface: "com.dubbogo.pixiu.UserService"
method: "CreateUser"
paramTypes: [ "object" ]
group: "test"
version: 1.0.0
clusterName: "test_dubbo"
Expand All @@ -41,10 +41,10 @@ resources:
mappingParams:
- name: requestBody._all
mapTo: 0
mapType: "object"
applicationName: "UserProvider"
interface: "com.dubbogo.pixiu.UserService"
method: "UpdateUser"
paramTypes: [ "object" ]
group: "test"
version: 1.0.0
clusterName: "test_dubbo"
Expand All @@ -62,12 +62,13 @@ resources:
mappingParams:
- name: requestBody.name
mapTo: 0
mapType: "string"
- name: requestBody.user
mapTo: 1
mapType: "object"
applicationName: "UserService"
interface: "com.dubbogo.pixiu.UserService"
method: "UpdateUserByName"
paramTypes: [ "string", "object" ]
group: "test"
version: 1.0.0
clusterName: "test_dubbo"
Expand Down
Loading

0 comments on commit 768578b

Please sign in to comment.