Skip to content

Commit

Permalink
Merge pull request #16 from begonia-org/feature/feat-grpc-proxy
Browse files Browse the repository at this point in the history
Feature/feat grpc proxy
  • Loading branch information
geebytes authored May 27, 2024
2 parents 0e4c5ca + 42655de commit 8bc8bee
Show file tree
Hide file tree
Showing 68 changed files with 2,687 additions and 817 deletions.
1 change: 1 addition & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
run: |
mkdir -p /tmp/protos
git clone https://github.com/begonia-org/protos.git /tmp/protos
cp cert/* /tmp/
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
Expand Down
16 changes: 16 additions & 0 deletions config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ auth:
aes_iv: "L!#x].upV.>Jx0QN"
jwt_secret: "WNjp6mW^GXnRf3]34asF"
jwt_expiration: 7200 # seconds
rsa:
private_key: "/data/work/begonia-org/begonia/cert/auth_private_key.pem"
public_key: "/data/work/begonia-org/begonia/cert/auth_public_key.pem"
blacklist:
filter:
entries: 100000
Expand Down Expand Up @@ -92,6 +95,19 @@ test:
protos:
dir: "/tmp/protos"
desc: "/tmp/protos/api.bin"
etcd:
endpoint:
prefix: "/begonia/endpoints"
app:
prefix: "/begonia/apps"
auth:
aes_key: "1234567890123456"
aes_iv: "L!#x].upV.>Jx0QN"
jwt_secret: "WNjp6mW^GXnRf3]34asF"
jwt_expiration: 7200 # seconds
rsa:
private_key: "/tmp/auth_private_key.pem"
public_key: "/tmp/auth_public_key.pem"
common:
rdb_key_prefix: "begonia"
filter_key_prefix: "begonia:filter"
Expand Down
299 changes: 299 additions & 0 deletions gateway.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,299 @@
{
"/helloworld.Greeter/SayHello": [
{
"Pattern": {},
"Template": {
"Version": 1,
"OpCodes": [
2,
0,
2,
1,
2,
2,
2,
3
],
"Pool": [
"api",
"v1",
"example",
"post"
],
"Verb": "",
"Fields": null,
"Template": "/api/v1/example/post"
},
"HttpMethod": "POST",
"FullMethodName": "/helloworld.Greeter/SayHello",
"HttpUri": "/api/v1/example/post",
"PathParams": [],
"InName": "HelloRequest",
"OutName": "HelloReply",
"IsClientStream": false,
"IsServerStream": false,
"Pkg": "helloworld",
"InPkg": "helloworld",
"OutPkg": "helloworld"
}
],
"/helloworld.Greeter/SayHelloBody": [
{
"Pattern": {},
"Template": {
"Version": 1,
"OpCodes": [
2,
0,
2,
1,
2,
2,
2,
3
],
"Pool": [
"api",
"v1",
"example",
"body"
],
"Verb": "",
"Fields": null,
"Template": "/api/v1/example/body"
},
"HttpMethod": "POST",
"FullMethodName": "/helloworld.Greeter/SayHelloBody",
"HttpUri": "/api/v1/example/body",
"PathParams": [],
"InName": "HttpBody",
"OutName": "HttpBody",
"IsClientStream": false,
"IsServerStream": false,
"Pkg": "helloworld",
"InPkg": "google.api",
"OutPkg": "google.api"
}
],
"/helloworld.Greeter/SayHelloClientStream": [
{
"Pattern": {},
"Template": {
"Version": 1,
"OpCodes": [
2,
0,
2,
1,
2,
2,
2,
3,
2,
4
],
"Pool": [
"api",
"v1",
"example",
"client",
"stream"
],
"Verb": "",
"Fields": null,
"Template": "/api/v1/example/client/stream"
},
"HttpMethod": "POST",
"FullMethodName": "/helloworld.Greeter/SayHelloClientStream",
"HttpUri": "/api/v1/example/client/stream",
"PathParams": [],
"InName": "HelloRequest",
"OutName": "RepeatedReply",
"IsClientStream": true,
"IsServerStream": false,
"Pkg": "helloworld",
"InPkg": "helloworld",
"OutPkg": "helloworld"
}
],
"/helloworld.Greeter/SayHelloError": [
{
"Pattern": {},
"Template": {
"Version": 1,
"OpCodes": [
2,
0,
2,
1,
2,
2,
2,
3,
2,
4
],
"Pool": [
"api",
"v1",
"example",
"error",
"test"
],
"Verb": "",
"Fields": null,
"Template": "/api/v1/example/error/test"
},
"HttpMethod": "GET",
"FullMethodName": "/helloworld.Greeter/SayHelloError",
"HttpUri": "/api/v1/example/error/test",
"PathParams": [],
"InName": "ErrorRequest",
"OutName": "HelloReply",
"IsClientStream": false,
"IsServerStream": false,
"Pkg": "helloworld",
"InPkg": "helloworld",
"OutPkg": "helloworld"
}
],
"/helloworld.Greeter/SayHelloGet": [
{
"Pattern": {},
"Template": {
"Version": 1,
"OpCodes": [
2,
0,
2,
1,
2,
2,
1,
0,
4,
1,
5,
3
],
"Pool": [
"api",
"v1",
"example",
"name"
],
"Verb": "",
"Fields": [
"name"
],
"Template": "/api/v1/example/{name}"
},
"HttpMethod": "GET",
"FullMethodName": "/helloworld.Greeter/SayHelloGet",
"HttpUri": "/api/v1/example/{name}",
"PathParams": [
"name"
],
"InName": "HelloRequest",
"OutName": "HelloReply",
"IsClientStream": false,
"IsServerStream": false,
"Pkg": "helloworld",
"InPkg": "helloworld",
"OutPkg": "helloworld"
}
],
"/helloworld.Greeter/SayHelloServerSideEvent": [
{
"Pattern": {},
"Template": {
"Version": 1,
"OpCodes": [
2,
0,
2,
1,
2,
2,
2,
3,
2,
4,
1,
0,
4,
1,
5,
5
],
"Pool": [
"api",
"v1",
"example",
"server",
"sse",
"name"
],
"Verb": "",
"Fields": [
"name"
],
"Template": "/api/v1/example/server/sse/{name}"
},
"HttpMethod": "GET",
"FullMethodName": "/helloworld.Greeter/SayHelloServerSideEvent",
"HttpUri": "/api/v1/example/server/sse/{name}",
"PathParams": [
"name"
],
"InName": "HelloRequest",
"OutName": "HelloReply",
"IsClientStream": false,
"IsServerStream": true,
"Pkg": "helloworld",
"InPkg": "helloworld",
"OutPkg": "helloworld"
}
],
"/helloworld.Greeter/SayHelloWebsocket": [
{
"Pattern": {},
"Template": {
"Version": 1,
"OpCodes": [
2,
0,
2,
1,
2,
2,
2,
3,
2,
4
],
"Pool": [
"api",
"v1",
"example",
"server",
"websocket"
],
"Verb": "",
"Fields": null,
"Template": "/api/v1/example/server/websocket"
},
"HttpMethod": "GET",
"FullMethodName": "/helloworld.Greeter/SayHelloWebsocket",
"HttpUri": "/api/v1/example/server/websocket",
"PathParams": [],
"InName": "HelloRequest",
"OutName": "HelloReply",
"IsClientStream": true,
"IsServerStream": true,
"Pkg": "helloworld",
"InPkg": "helloworld",
"OutPkg": "helloworld"
}
]
}
Loading

0 comments on commit 8bc8bee

Please sign in to comment.