Skip to content

Commit

Permalink
[feat][schema] Support the schema type ProtoNativeSchema (#1006)
Browse files Browse the repository at this point in the history
* Support the ProtoNativeSchema

* fix

* fix

* fix

* fix

* fix style

* fix license header

* address comments

* fix

* fix

* Fix typo in logs

---------

Co-authored-by: Yunze Xu <xyzinfernity@163.com>
  • Loading branch information
gaoran10 and BewareMyPower committed Apr 23, 2023
1 parent 55f0c7c commit fc4f289
Show file tree
Hide file tree
Showing 9 changed files with 469 additions and 22 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ require (
golang.org/x/mod v0.5.1
golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602
golang.org/x/time v0.0.0-20191024005414-555d28b269f0
google.golang.org/protobuf v1.26.0
google.golang.org/protobuf v1.30.0 // indirect
)

require (
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,8 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
7 changes: 6 additions & 1 deletion integration-tests/pb/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,9 @@
# under the License.
#

protoc --go_out=. --go_opt=paths=source_relative hello.proto
PROJECT_DIR=$(git rev-parse --show-toplevel)
SOURCE_PATH="$PROJECT_DIR/integration-tests/pb"
DEST_PATH="$PROJECT_DIR/integration-tests/pb"
echo "source_path: $SOURCE_PATH"
echo "dest_path: $DEST_PATH"
protoc -I=$SOURCE_PATH --go_out=$DEST_PATH $SOURCE_PATH/*.proto
142 changes: 124 additions & 18 deletions integration-tests/pb/hello.pb.go

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

12 changes: 11 additions & 1 deletion integration-tests/pb/hello.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,19 @@
syntax = "proto3";
package prototest;

option go_package = "./pb";
option go_package = ".";

import "hi.proto";

message Test {
int32 num = 1;
string msf = 2;
Foo foo = 3;
HiContent hiContent = 4;
}

message Foo {
string name = 1;
int32 value = 2;
repeated string names = 3;
}
Loading

0 comments on commit fc4f289

Please sign in to comment.