Skip to content

Commit

Permalink
test: streaming support including dot-separated thrift (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix021 authored Jan 18, 2024
1 parent 75c4233 commit c4d0ed7
Show file tree
Hide file tree
Showing 128 changed files with 28,097 additions and 67 deletions.
4 changes: 3 additions & 1 deletion thrift_streaming/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ function generate_new() {
else
GOBIN=$dir go install github.com/cloudwego/kitex/tool/cmd/kitex@develop
fi
GOBIN=$dir go install github.com/cloudwego/thriftgo@latest
if [ ! -f "$dir/thriftgo" ]; then
GOBIN=$dir go install github.com/cloudwego/thriftgo@latest
fi

if [ ! -f "$dir/kitex" -o ! -f "$dir/thriftgo" ]; then
echo "[new] Unable to install kitex or thriftgo to $dir, please check before continue."
Expand Down
23 changes: 23 additions & 0 deletions thrift_streaming/idl/a.b.c.thrift
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright 2024 CloudWeGo Authors
//
// Licensed 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.

namespace go a.b.c

struct Request {
1: string message,
}

struct Response {
1: string message,
}
10 changes: 10 additions & 0 deletions thrift_streaming/idl/api.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

namespace go echo

include "a.b.c.thrift"

struct EchoRequest {
1: required string message,
}
Expand Down Expand Up @@ -63,3 +65,11 @@ service StreamOnlyServiceChild extends StreamOnlyService {}

// should also be a streaming service
service StreamOnlyServiceChildChild extends StreamOnlyServiceChild {}

service ABCService {
a.b.c.Response Echo(1: a.b.c.Request req1, 2: a.b.c.Request req2),
a.b.c.Response EchoBidirectional(1: a.b.c.Request req1) (streaming.mode="bidirectional"),
a.b.c.Response EchoServer(1: a.b.c.Request req1) (streaming.mode="server"),
a.b.c.Response EchoClient(1: a.b.c.Request req1) (streaming.mode="client"),
a.b.c.Response EchoUnary(1: a.b.c.Request req1) (streaming.mode="unary"),
}
333 changes: 333 additions & 0 deletions thrift_streaming/kitex_gen/a/b/c/a.b.c.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c4d0ed7

Please sign in to comment.