Skip to content

Commit

Permalink
feat:add client stream mid
Browse files Browse the repository at this point in the history
  • Loading branch information
geebytes committed Jul 14, 2024
1 parent 0e4e056 commit 9f4c49d
Show file tree
Hide file tree
Showing 49 changed files with 1,546 additions and 735 deletions.
10 changes: 10 additions & 0 deletions cmd/begonia/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,4 +205,14 @@ func main() {
if err := cmd.Execute(); err != nil {
log.Fatalf("failed to start begonia: %v", err)
}
// env, _ := cmd.Flags().GetString("env")
// cnf, err := cmd.Flags().GetString("config")
// if err != nil {
// log.Fatalf("failed to get config: %v", err)
// }
// config := config.ReadConfigWithDir("dev", "/data/work/begonia-org/begonia/config/settings.yml")
// worker := internal.New(config, gateway.Log, "127.0.0.1:12138")
// hd, _ := os.UserHomeDir()
// _ = os.WriteFile(hd+"/.begonia/gateway.json", []byte(fmt.Sprintf(`{"addr":"http://%s"}`, "127.0.0.1:12138")), 0666)
// worker.Start()
}
13 changes: 7 additions & 6 deletions config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ file:
engines:
- name: "FILE_ENGINE_MINIO"
endpoint: "127.0.0.1:9000"
accessKey: "7OdVJK1alV8cpRMeBLBW"
secretKey: "2GNNRqqElReC1KnV3kX9jSjyLU4kwOaTZEqDS2vH"
accessKey: "rLV2Jjj2UbMWSJOhTOtZ"
secretKey: "OVyJOILwx4iVE0EVJB4CKB65j7xlhjT5q1aGCv5t"
- name: "FILE_ENGINE_LOCAL"
endpoint: "/data/work/begonia-org/begonia/upload"
protos:
Expand Down Expand Up @@ -70,11 +70,12 @@ gateway:
- "example.com"
plugins:
local:
logger: 1
exception: 0
# 优先级越大越先执行
exception: 4
logger: 3
http: 2
params_validator: 3
auth: 4
auth: 1
params_validator: 0
# only_api_key_auth: 4
rpc:
# - server:
Expand Down
299 changes: 0 additions & 299 deletions gateway.json

This file was deleted.

3 changes: 2 additions & 1 deletion gateway/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package gateway

import (
"context"
"fmt"
"strings"

loadbalance "github.com/begonia-org/go-loadbalancer"
Expand Down Expand Up @@ -42,7 +43,7 @@ func (e *httpForwardGrpcEndpointImpl) Request(req GrpcRequest) (proto.Message, r
return nil, runtime.ServerMetadata{
HeaderMD: make(map[string][]string),
TrailerMD: make(map[string][]string),
}, err
}, fmt.Errorf("get conn error:%v", err)
}
defer e.pool.Release(req.GetContext(), cc)

Expand Down
Loading

0 comments on commit 9f4c49d

Please sign in to comment.