diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index be6a261e..0f8cd06b 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -42,7 +42,3 @@ jobs: uses: ./ with: entrypoint: example/stub-subfolders/entrypoint.sh - - name: Run no go_package example - uses: ./ - with: - entrypoint: example/no-gopackage/entrypoint.sh diff --git a/.gitignore b/.gitignore index eadf978d..aa6934c2 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,7 @@ pkged.go gripmock .idea .DS_Store -protogen +protogen/* +!protogen/go.mod +!protogen/example/ +temp \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 09297ede..6d82e56c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,17 +4,13 @@ RUN mkdir /proto RUN mkdir /stubs -RUN apk -U --no-cache add git protobuf +RUN apk -U --no-cache add git protobuf bash -RUN go get -u -v github.com/golang/protobuf/protoc-gen-go \ - google.golang.org/grpc \ - google.golang.org/grpc/reflection \ - golang.org/x/net/context \ - github.com/go-chi/chi \ - github.com/lithammer/fuzzysearch/fuzzy \ - golang.org/x/tools/imports +RUN go install -v github.com/golang/protobuf/protoc-gen-go@latest -RUN go get github.com/markbates/pkger/cmd/pkger +RUN go install -v google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest + +RUN go install github.com/markbates/pkger/cmd/pkger@latest # cloning well-known-types RUN git clone --depth=1 https://github.com/google/protobuf.git /protobuf-repo @@ -30,6 +26,8 @@ RUN mkdir -p /go/src/github.com/tokopedia/gripmock COPY . /go/src/github.com/tokopedia/gripmock +RUN ln -s /go/src/github.com/tokopedia/gripmock/fix_gopackage.sh /bin/ + WORKDIR /go/src/github.com/tokopedia/gripmock/protoc-gen-gripmock RUN pkger @@ -42,6 +40,9 @@ WORKDIR /go/src/github.com/tokopedia/gripmock # install gripmock RUN go install -v +# to cache necessary imports +RUN go build ./example/simple/client + # remove all .pb.go generated files # since generating go file is part of the test RUN find . -name "*.pb.go" -delete -type f diff --git a/example/multi-files/client/main.go b/example/multi-files/client/main.go index 46bf1c33..22c1a66d 100644 --- a/example/multi-files/client/main.go +++ b/example/multi-files/client/main.go @@ -5,11 +5,10 @@ import ( "log" "time" - pb "github.com/tokopedia/gripmock/example/multi-files" + pb "github.com/tokopedia/gripmock/protogen/example/multi-files" "google.golang.org/grpc" ) -//go:generate protoc --go_out=plugins=grpc:${GOPATH}/src -I=.. ../file1.proto ../file2.proto func main() { ctx, cancel := context.WithTimeout(context.Background(), time.Second*5) defer cancel() diff --git a/example/multi-package/client/main.go b/example/multi-package/client/main.go index 0cd57ae4..c1da7ad5 100644 --- a/example/multi-package/client/main.go +++ b/example/multi-package/client/main.go @@ -6,12 +6,11 @@ import ( "os" "time" - pb "github.com/tokopedia/gripmock/example/multi-package" - multi_package "github.com/tokopedia/gripmock/example/multi-package/bar" + pb "github.com/tokopedia/gripmock/protogen/example/multi-package" + multi_package "github.com/tokopedia/gripmock/protogen/example/multi-package/bar" "google.golang.org/grpc" ) -//go:generate protoc --go_out=plugins=grpc:${GOPATH}/src -I=.. ../hello.proto ../foo.proto ../bar/bar.proto func main() { ctx, cancel := context.WithTimeout(context.Background(), time.Second*5) defer cancel() diff --git a/example/multi-package/foo.proto b/example/multi-package/foo.proto index 8b60fd61..89376fcb 100644 --- a/example/multi-package/foo.proto +++ b/example/multi-package/foo.proto @@ -4,7 +4,8 @@ syntax = "proto3"; // but different package package foo; -option go_package = "github.com/tokopedia/gripmock/example/multi-package"; +// simulating dummy private repo +option go_package = "github.com/my/private/repo/multi-package"; message Response { string response = 1; diff --git a/example/multi-package/hello.proto b/example/multi-package/hello.proto index ffb12f9b..4b960442 100644 --- a/example/multi-package/hello.proto +++ b/example/multi-package/hello.proto @@ -5,8 +5,7 @@ package multi_package; import "bar/bar.proto"; import "foo.proto"; -// simulate go_package alias with - -option go_package = "github.com/tokopedia/gripmock/example/multi-package"; +// simulate no go_package and folder with - service Gripmock { rpc Greet (bar.Bar) returns (foo.Response); diff --git a/example/no-gopackage/bar/bar.proto b/example/no-gopackage/bar/bar.proto deleted file mode 100644 index e8fd8511..00000000 --- a/example/no-gopackage/bar/bar.proto +++ /dev/null @@ -1,6 +0,0 @@ -syntax = "proto3"; -package bar; - -message Bar{ - string name = 1; -} diff --git a/example/no-gopackage/bar/deep/bar.proto b/example/no-gopackage/bar/deep/bar.proto deleted file mode 100644 index 1befae86..00000000 --- a/example/no-gopackage/bar/deep/bar.proto +++ /dev/null @@ -1,6 +0,0 @@ -syntax = "proto3"; -package bar; - -message DeepBar{ - string address = 1; -} diff --git a/example/no-gopackage/client/main.go b/example/no-gopackage/client/main.go deleted file mode 100644 index b2d7c445..00000000 --- a/example/no-gopackage/client/main.go +++ /dev/null @@ -1,38 +0,0 @@ -package main - -import ( - "context" - "log" - "os" - "time" - - pb "github.com/tokopedia/gripmock/protogen/example/no-gopackage" - no_gopackage "github.com/tokopedia/gripmock/protogen/example/no-gopackage/bar" - "google.golang.org/grpc" -) - -//go:generate protoc --go_out=plugins=grpc:${GOPATH}/src -I=../../protogen ../hello.proto ../foo.proto ../bar/bar.proto ../bar/deep/bar.proto -func main() { - ctx, cancel := context.WithTimeout(context.Background(), time.Second*5) - defer cancel() - - // Set up a connection to the server. - conn, err := grpc.DialContext(ctx, "localhost:4770", grpc.WithInsecure(), grpc.WithBlock()) - if err != nil { - log.Fatalf("did not connect: %v", err) - } - defer conn.Close() - - c := pb.NewGripmockClient(conn) - - // Contact the server and print out its response. - name := "tokopedia" - if len(os.Args) > 1 { - name = os.Args[1] - } - r, err := c.Greet(context.Background(), &no_gopackage.Bar{Name: name}) - if err != nil { - log.Fatalf("error from grpc: %v", err) - } - log.Printf("Greeting: %s\nAddress:%s", r.Response, r.Deepbar.Address) -} diff --git a/example/no-gopackage/entrypoint.sh b/example/no-gopackage/entrypoint.sh deleted file mode 100755 index e10bcb63..00000000 --- a/example/no-gopackage/entrypoint.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env sh - -# this file is used by .github/workflows/integration-test.yml - -gripmock --stub=example/no-gopackage/stub \ - example/no-gopackage/foo.proto example/no-gopackage/hello.proto \ - example/no-gopackage/bar/bar.proto \ - example/no-gopackage/bar/deep/bar.proto & - -# wait for generated files to be available and gripmock is up -sleep 2 - -go run example/no-gopackage/client/*.go \ No newline at end of file diff --git a/example/no-gopackage/stub/simple.json b/example/no-gopackage/stub/simple.json deleted file mode 100644 index 38c6eb21..00000000 --- a/example/no-gopackage/stub/simple.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "service":"Gripmock", - "method":"Greet", - "input":{ - "equals":{ - "name":"tokopedia" - } - }, - "output":{ - "data":{ - "response":"Hello Tokopedia", - "deepbar": { - "address": "Jakarta" - } - } - } -} \ No newline at end of file diff --git a/example/one-of/client/main.go b/example/one-of/client/main.go index 441a8502..32b5856a 100644 --- a/example/one-of/client/main.go +++ b/example/one-of/client/main.go @@ -6,12 +6,11 @@ import ( "os" "time" - oneof "github.com/tokopedia/gripmock/example/one-of" + oneof "github.com/tokopedia/gripmock/protogen/example/one-of" "google.golang.org/grpc" ) -//go:generate protoc --go_out=plugins=grpc:${GOPATH}/src -I=.. ../oneof.proto func main() { ctx, cancel := context.WithTimeout(context.Background(), time.Second*5) defer cancel() diff --git a/example/simple/client/main.go b/example/simple/client/main.go index 01f2928d..ba8f265e 100644 --- a/example/simple/client/main.go +++ b/example/simple/client/main.go @@ -6,11 +6,10 @@ import ( "os" "time" - pb "github.com/tokopedia/gripmock/example/simple" + pb "github.com/tokopedia/gripmock/protogen/example/simple" "google.golang.org/grpc" ) -//go:generate protoc -I=.. --go_out=plugins=grpc:${GOPATH}/src ../simple.proto func main() { ctx, cancel := context.WithTimeout(context.Background(), time.Second*5) defer cancel() @@ -25,7 +24,7 @@ func main() { c := pb.NewGripmockClient(conn) // Contact the server and print out its response. - name := "gripmock" + name := "tokopedia" if len(os.Args) > 1 { name = os.Args[1] } diff --git a/example/stream/client/main.go b/example/stream/client/main.go index 01ad610f..83c24403 100644 --- a/example/stream/client/main.go +++ b/example/stream/client/main.go @@ -7,11 +7,10 @@ import ( "sync" "time" - pb "github.com/tokopedia/gripmock/example/stream" + pb "github.com/tokopedia/gripmock/protogen/example/stream" "google.golang.org/grpc" ) -//go:generate protoc --go_out=plugins=grpc:${GOPATH}/src -I=.. ../stream.proto func main() { // Set up a connection to the server. ctx, cancel := context.WithTimeout(context.Background(), time.Second*5) diff --git a/example/stub-subfolders/client/main.go b/example/stub-subfolders/client/main.go index 2dee1620..68592356 100644 --- a/example/stub-subfolders/client/main.go +++ b/example/stub-subfolders/client/main.go @@ -5,7 +5,7 @@ import ( "log" "time" - pb "github.com/tokopedia/gripmock/example/stub-subfolders" + pb "github.com/tokopedia/gripmock/protogen/example/stub-subfolders" "google.golang.org/grpc" ) diff --git a/example/well_known_types/client/main.go b/example/well_known_types/client/main.go index 3b0aaba2..7018575d 100644 --- a/example/well_known_types/client/main.go +++ b/example/well_known_types/client/main.go @@ -6,7 +6,7 @@ import ( "time" "github.com/golang/protobuf/ptypes/empty" - pb "github.com/tokopedia/gripmock/example/well_known_types" + pb "github.com/tokopedia/gripmock/protogen/example/well_known_types" "google.golang.org/grpc" ) diff --git a/fix_gopackage.sh b/fix_gopackage.sh index 94d61119..026f9ceb 100755 --- a/fix_gopackage.sh +++ b/fix_gopackage.sh @@ -4,29 +4,42 @@ protos=("$@") for proto in "${protos[@]}" do - if grep '^option go_package' $proto;then - echo "option go_package detected in $proto, no need to append" - exit 1 - fi -done - -for proto in "${protos[@]}" -do + # if it's a directory then skip if [[ -d $proto ]]; then continue fi + # example $proto: example/foo/bar/hello.proto + + # get string from left until the last / + # example value: example/foo/bar/ dir=${proto%/*} + + # remove prefix / if any + dir=$(echo $dir | sed -n 's:^/*\(.*\)$:\1:p') + + # get string from right until the first / + # example value: hello.proto file=${proto##*/} newdir="protogen/$dir" newfile="$newdir/$file" + # copy to protogen directory - mkdir -p "$newdir" && cp "$proto" "$_" + mkdir -p "$newdir" && \ + cp "$proto" "$_" && \ + # Force remove any declaration of go_package + # then replace it with our own declaration below + sed -i 's/^option go_package.*$//g' $newfile + + + # get the line number of "syntax" declaration syntaxLineNum="$(grep -n "syntax" "$newfile" | head -n 1 | cut -d: -f1)" goPackageString="option go_package = \"github.com/tokopedia/gripmock/protogen/$dir\";" + + # append our own go_package delcaration just below "syntax" declaration sed -i "${syntaxLineNum}s~$~\n$goPackageString~" $newfile echo $newfile done diff --git a/go.mod b/go.mod index fe5653eb..b2dc7ffb 100644 --- a/go.mod +++ b/go.mod @@ -8,14 +8,21 @@ require ( github.com/golang/protobuf v1.5.2 github.com/kr/pretty v0.2.0 // indirect github.com/lithammer/fuzzysearch v1.1.1 - github.com/stretchr/testify v1.6.1 + github.com/stretchr/testify v1.7.0 + github.com/tokopedia/gripmock/protogen v0.0.0 // indirect + github.com/tokopedia/gripmock/protogen/example v0.0.0 // indirect golang.org/x/net v0.0.0-20201110031124-69a78807bb2b // indirect - golang.org/x/sys v0.0.0-20201112073958-5cba982894dd // indirect golang.org/x/text v0.3.4 // indirect - golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect google.golang.org/genproto v0.0.0-20201111145450-ac7456db90a6 - google.golang.org/grpc v1.33.2 - google.golang.org/protobuf v1.27.1 + google.golang.org/grpc v1.47.0 + google.golang.org/protobuf v1.28.0 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect ) + +// this is for generated server to be able to run +replace github.com/tokopedia/gripmock/protogen/example v0.0.0 => ./protogen/example + +// this is for example client to be able to run +replace github.com/tokopedia/gripmock/protogen v0.0.0 => ./protogen + diff --git a/go.sum b/go.sum index 7f4a09da..81487afb 100644 --- a/go.sum +++ b/go.sum @@ -1,27 +1,41 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-chi/chi v4.1.2+incompatible h1:fGFk2Gmi/YKXk0OmGfBh0WgmN3XB8lVnEyNz34tQRec= github.com/go-chi/chi v4.1.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= @@ -30,9 +44,11 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -43,9 +59,12 @@ github.com/lithammer/fuzzysearch v1.1.1/go.mod h1:H2bng+w5gsR7NlfIJM8ElGZI0sX6C/ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -54,21 +73,27 @@ golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvx golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201112073958-5cba982894dd h1:5CtCZbICpIOFdgO940moixOPjc0178IU44m4EjOO5IY= -golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4 h1:myAQVi0cGEoqQVR5POX+8RR2mrocKqNN1hmeMqhX27k= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -78,7 +103,6 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135 h1:5Beo0mZN8dRzgrMMkDp0jc8YXQKx9DiJ2k1dkvGsn5A= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= @@ -87,6 +111,7 @@ google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9Ywl google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20201111145450-ac7456db90a6 h1:iRN4+t0lvZX/l9gH14ARF9i58tsVa5a97k6aH95rC3Y= google.golang.org/genproto v0.0.0-20201111145450-ac7456db90a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= @@ -94,24 +119,30 @@ google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZi google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o= -google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.47.0 h1:9n77onPX5F3qfFCqjy9dhn8PbNQsIKeVU04J9G7umt8= +google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/protoc-gen-gripmock/go.sum b/protoc-gen-gripmock/go.sum index 574dc395..45247adf 100644 --- a/protoc-gen-gripmock/go.sum +++ b/protoc-gen-gripmock/go.sum @@ -1,19 +1,29 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/gobuffalo/here v0.6.0 h1:hYrd0a6gDmWxBM4TnrGw8mQg24iSVoIkHEk7FodQcBI= github.com/gobuffalo/here v0.6.0/go.mod h1:wAG085dHOYqUpf+Ap+WOdrPTp5IYcDAs/x7PLa8Y5fM= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/markbates/pkger v0.17.1 h1:/MKEtWqtc0mZvu9OinB9UzVN9iYCwLWuyUv4Bw+PCno= github.com/markbates/pkger v0.17.1/go.mod h1:0JoVlrol20BSywW79rN3kdFFsE5xYM+rSCQDXbLhiuI= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -24,21 +34,27 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007 h1:gG67DSER+11cZvqIMb8S8bt0vZtiN6xWYARwirrOSfE= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.5 h1:ouewzE6p+/VEB31YYnTbEJdi8pFqKp4P4n85vwo3DHA= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.7 h1:VUgggvou5XRW9mHwD/yXxIYSMtY0zoKQf/v226p2nyo= gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/protogen/example/go.mod b/protogen/example/go.mod new file mode 100644 index 00000000..6e646477 --- /dev/null +++ b/protogen/example/go.mod @@ -0,0 +1,3 @@ +module github.com/tokopedia/gripmock/protogen/example + +go 1.18 diff --git a/example/multi-files/file1.pb.go b/protogen/example/multi-files/file1.pb.go similarity index 96% rename from example/multi-files/file1.pb.go rename to protogen/example/multi-files/file1.pb.go index 16b8074a..d113a55a 100644 --- a/example/multi-files/file1.pb.go +++ b/protogen/example/multi-files/file1.pb.go @@ -143,10 +143,11 @@ var file_file1_proto_rawDesc = []byte{ 0x61, 0x79, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x12, 0x14, 0x2e, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x31, 0x1a, 0x12, 0x2e, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x79, - 0x31, 0x42, 0x33, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x31, 0x42, 0x3c, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x6f, 0x6b, 0x6f, 0x70, 0x65, 0x64, 0x69, 0x61, 0x2f, 0x67, 0x72, 0x69, 0x70, 0x6d, 0x6f, - 0x63, 0x6b, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x6d, 0x75, 0x6c, 0x74, 0x69, - 0x2d, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x63, 0x6b, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x78, 0x61, 0x6d, + 0x70, 0x6c, 0x65, 0x2f, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x2d, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/protogen/example/multi-files/file1.proto b/protogen/example/multi-files/file1.proto new file mode 100644 index 00000000..1951376d --- /dev/null +++ b/protogen/example/multi-files/file1.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; +option go_package = "github.com/tokopedia/gripmock/protogen/example/multi-files"; + +package multifiles; + + +// The Gripmock service definition. +service Gripmock1 { + // simple unary method + rpc SayHello (Request1) returns (Reply1); +} + +// The request message containing the user's name. +message Request1 { + string name = 1; +} + +// The response message containing the greetings +message Reply1 { + string message = 1; + int32 return_code = 2; +} \ No newline at end of file diff --git a/example/multi-files/file2.pb.go b/protogen/example/multi-files/file2.pb.go similarity index 96% rename from example/multi-files/file2.pb.go rename to protogen/example/multi-files/file2.pb.go index 73f97bad..236f19e8 100644 --- a/example/multi-files/file2.pb.go +++ b/protogen/example/multi-files/file2.pb.go @@ -143,10 +143,11 @@ var file_file2_proto_rawDesc = []byte{ 0x61, 0x79, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x12, 0x14, 0x2e, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x32, 0x1a, 0x12, 0x2e, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x79, - 0x32, 0x42, 0x33, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x32, 0x42, 0x3c, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x6f, 0x6b, 0x6f, 0x70, 0x65, 0x64, 0x69, 0x61, 0x2f, 0x67, 0x72, 0x69, 0x70, 0x6d, 0x6f, - 0x63, 0x6b, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x6d, 0x75, 0x6c, 0x74, 0x69, - 0x2d, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x63, 0x6b, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x78, 0x61, 0x6d, + 0x70, 0x6c, 0x65, 0x2f, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x2d, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/protogen/example/multi-files/file2.proto b/protogen/example/multi-files/file2.proto new file mode 100644 index 00000000..858d34c7 --- /dev/null +++ b/protogen/example/multi-files/file2.proto @@ -0,0 +1,21 @@ +syntax = "proto3"; +option go_package = "github.com/tokopedia/gripmock/protogen/example/multi-files"; + +package multifiles; + + +service Gripmock2 { + // simple unary method + rpc SayHello (Request2) returns (Reply2); +} + +// The request message containing the user's name. +message Request2 { + string name = 1; +} + +// The response message containing the greetings +message Reply2 { + string message = 1; + int32 return_code = 2; +} \ No newline at end of file diff --git a/example/multi-package/bar/bar.pb.go b/protogen/example/multi-package/bar/bar.pb.go similarity index 91% rename from example/multi-package/bar/bar.pb.go rename to protogen/example/multi-package/bar/bar.pb.go index 1c7beeec..8df453f4 100644 --- a/example/multi-package/bar/bar.pb.go +++ b/protogen/example/multi-package/bar/bar.pb.go @@ -4,7 +4,7 @@ // protoc v3.17.3 // source: bar/bar.proto -package multi_package +package bar import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -73,11 +73,11 @@ var file_bar_bar_proto_rawDesc = []byte{ 0x0a, 0x0d, 0x62, 0x61, 0x72, 0x2f, 0x62, 0x61, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x03, 0x62, 0x61, 0x72, 0x22, 0x19, 0x0a, 0x03, 0x42, 0x61, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x42, - 0x47, 0x5a, 0x45, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x6f, + 0x42, 0x5a, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x6f, 0x6b, 0x6f, 0x70, 0x65, 0x64, 0x69, 0x61, 0x2f, 0x67, 0x72, 0x69, 0x70, 0x6d, 0x6f, 0x63, 0x6b, - 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x2d, 0x70, - 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x2f, 0x62, 0x61, 0x72, 0x3b, 0x6d, 0x75, 0x6c, 0x74, 0x69, - 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, + 0x65, 0x2f, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x2d, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x2f, + 0x62, 0x61, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/protogen/example/multi-package/bar/bar.proto b/protogen/example/multi-package/bar/bar.proto new file mode 100644 index 00000000..b881ca74 --- /dev/null +++ b/protogen/example/multi-package/bar/bar.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; +option go_package = "github.com/tokopedia/gripmock/protogen/example/multi-package/bar"; +package bar; + +// this go_package is simulating alias collision + + +message Bar{ + string name = 1; +} diff --git a/example/multi-package/foo.pb.go b/protogen/example/multi-package/foo.pb.go similarity index 90% rename from example/multi-package/foo.pb.go rename to protogen/example/multi-package/foo.pb.go index 0ba7ff1f..0419397a 100644 --- a/example/multi-package/foo.pb.go +++ b/protogen/example/multi-package/foo.pb.go @@ -76,11 +76,11 @@ var file_foo_proto_rawDesc = []byte{ 0x0a, 0x09, 0x66, 0x6f, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x03, 0x66, 0x6f, 0x6f, 0x22, 0x26, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x35, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, + 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x3e, 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x6f, 0x6b, 0x6f, 0x70, 0x65, 0x64, 0x69, 0x61, - 0x2f, 0x67, 0x72, 0x69, 0x70, 0x6d, 0x6f, 0x63, 0x6b, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, - 0x65, 0x2f, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x2d, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2f, 0x67, 0x72, 0x69, 0x70, 0x6d, 0x6f, 0x63, 0x6b, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x67, + 0x65, 0x6e, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x6d, 0x75, 0x6c, 0x74, 0x69, + 0x2d, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/example/no-gopackage/foo.proto b/protogen/example/multi-package/foo.proto similarity index 54% rename from example/no-gopackage/foo.proto rename to protogen/example/multi-package/foo.proto index dfee27c1..81397f55 100644 --- a/example/no-gopackage/foo.proto +++ b/protogen/example/multi-package/foo.proto @@ -1,12 +1,13 @@ syntax = "proto3"; +option go_package = "github.com/tokopedia/gripmock/protogen/example/multi-package"; // simulating neighboring .proto file // but different package package foo; -import "bar/deep/bar.proto"; +// simulating dummy private repo + message Response { string response = 1; - bar.DeepBar deepbar = 2; } diff --git a/example/multi-package/hello.pb.go b/protogen/example/multi-package/hello.pb.go similarity index 92% rename from example/multi-package/hello.pb.go rename to protogen/example/multi-package/hello.pb.go index 88853ba8..00ffa6d8 100644 --- a/example/multi-package/hello.pb.go +++ b/protogen/example/multi-package/hello.pb.go @@ -8,7 +8,7 @@ package multi_package import ( context "context" - bar "github.com/tokopedia/gripmock/example/multi-package/bar" + bar "github.com/tokopedia/gripmock/protogen/example/multi-package/bar" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -33,11 +33,11 @@ var file_hello_proto_rawDesc = []byte{ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x2c, 0x0a, 0x08, 0x47, 0x72, 0x69, 0x70, 0x6d, 0x6f, 0x63, 0x6b, 0x12, 0x20, 0x0a, 0x05, 0x47, 0x72, 0x65, 0x65, 0x74, 0x12, 0x08, 0x2e, 0x62, 0x61, 0x72, 0x2e, 0x42, 0x61, 0x72, 0x1a, 0x0d, 0x2e, 0x66, 0x6f, 0x6f, 0x2e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x35, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x3e, 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x6f, 0x6b, 0x6f, 0x70, 0x65, 0x64, 0x69, 0x61, 0x2f, 0x67, 0x72, 0x69, - 0x70, 0x6d, 0x6f, 0x63, 0x6b, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x6d, 0x75, - 0x6c, 0x74, 0x69, 0x2d, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x70, 0x6d, 0x6f, 0x63, 0x6b, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x65, + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x2d, 0x70, 0x61, 0x63, + 0x6b, 0x61, 0x67, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var file_hello_proto_goTypes = []interface{}{ diff --git a/example/no-gopackage/hello.proto b/protogen/example/multi-package/hello.proto similarity index 55% rename from example/no-gopackage/hello.proto rename to protogen/example/multi-package/hello.proto index 14435d99..09dc2cbc 100644 --- a/example/no-gopackage/hello.proto +++ b/protogen/example/multi-package/hello.proto @@ -1,10 +1,13 @@ syntax = "proto3"; +option go_package = "github.com/tokopedia/gripmock/protogen/example/multi-package"; package multi_package; import "bar/bar.proto"; import "foo.proto"; +// simulate no go_package and folder with - + service Gripmock { rpc Greet (bar.Bar) returns (foo.Response); } diff --git a/example/one-of/oneof.pb.go b/protogen/example/one-of/oneof.pb.go similarity index 97% rename from example/one-of/oneof.pb.go rename to protogen/example/one-of/oneof.pb.go index 95911457..a19e5f75 100644 --- a/example/one-of/oneof.pb.go +++ b/protogen/example/one-of/oneof.pb.go @@ -278,10 +278,11 @@ var file_oneof_proto_rawDesc = []byte{ 0x32, 0x34, 0x0a, 0x08, 0x47, 0x72, 0x69, 0x70, 0x6d, 0x6f, 0x63, 0x6b, 0x12, 0x28, 0x0a, 0x08, 0x53, 0x61, 0x79, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x12, 0x0e, 0x2e, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0c, 0x2e, 0x6f, 0x6e, 0x65, 0x6f, 0x66, - 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x42, 0x2e, 0x5a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x42, 0x37, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x6f, 0x6b, 0x6f, 0x70, 0x65, 0x64, 0x69, 0x61, 0x2f, 0x67, - 0x72, 0x69, 0x70, 0x6d, 0x6f, 0x63, 0x6b, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, - 0x6f, 0x6e, 0x65, 0x2d, 0x6f, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x69, 0x70, 0x6d, 0x6f, 0x63, 0x6b, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, + 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x6f, 0x6e, 0x65, 0x2d, 0x6f, 0x66, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/protogen/example/one-of/oneof.proto b/protogen/example/one-of/oneof.proto new file mode 100644 index 00000000..fa2f36ac --- /dev/null +++ b/protogen/example/one-of/oneof.proto @@ -0,0 +1,35 @@ +syntax = "proto3"; +option go_package = "github.com/tokopedia/gripmock/protogen/example/one-of"; + +package oneof; + + + +// The Gripmock service definition. +service Gripmock { + // simple unary method + rpc SayHello (Request) returns (Reply); +} + +// The request message containing the user's name. +message Request { + string name = 1; +} + +message Reply { + oneof replyType { + Reply1 reply1 = 1; + Reply2 reply2 = 2; + } +} + +// usual response type +message Reply1 { + string message = 1; + int32 return_code = 2; +} + +// other response type +message Reply2 { + int32 other = 1; +} \ No newline at end of file diff --git a/example/simple/simple.pb.go b/protogen/example/simple/simple.pb.go similarity index 97% rename from example/simple/simple.pb.go rename to protogen/example/simple/simple.pb.go index bdd2f784..49a36f1f 100644 --- a/example/simple/simple.pb.go +++ b/protogen/example/simple/simple.pb.go @@ -142,10 +142,11 @@ var file_simple_proto_rawDesc = []byte{ 0x70, 0x6d, 0x6f, 0x63, 0x6b, 0x12, 0x2a, 0x0a, 0x08, 0x53, 0x61, 0x79, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x12, 0x0f, 0x2e, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x52, 0x65, 0x70, 0x6c, - 0x79, 0x42, 0x2e, 0x5a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x79, 0x42, 0x37, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x6f, 0x6b, 0x6f, 0x70, 0x65, 0x64, 0x69, 0x61, 0x2f, 0x67, 0x72, 0x69, 0x70, 0x6d, 0x6f, - 0x63, 0x6b, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x73, 0x69, 0x6d, 0x70, 0x6c, - 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x63, 0x6b, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x78, 0x61, 0x6d, + 0x70, 0x6c, 0x65, 0x2f, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( diff --git a/protogen/example/simple/simple.proto b/protogen/example/simple/simple.proto new file mode 100644 index 00000000..e1e588ba --- /dev/null +++ b/protogen/example/simple/simple.proto @@ -0,0 +1,23 @@ +syntax = "proto3"; +option go_package = "github.com/tokopedia/gripmock/protogen/example/simple"; + +package simple; + + + +// The Gripmock service definition. +service Gripmock { + // simple unary method + rpc SayHello (Request) returns (Reply); +} + +// The request message containing the user's name. +message Request { + string name = 1; +} + +// The response message containing the greetings +message Reply { + string message = 1; + int32 return_code = 2; +} \ No newline at end of file diff --git a/example/stream/stream.pb.go b/protogen/example/stream/stream.pb.go similarity index 98% rename from example/stream/stream.pb.go rename to protogen/example/stream/stream.pb.go index 0901edb8..3cd0a217 100644 --- a/example/stream/stream.pb.go +++ b/protogen/example/stream/stream.pb.go @@ -138,11 +138,11 @@ var file_stream_proto_rawDesc = []byte{ 0x6d, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x28, 0x01, 0x12, 0x33, 0x0a, 0x0d, 0x62, 0x69, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x12, 0x0f, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x73, 0x74, - 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x28, 0x01, 0x30, 0x01, 0x42, 0x2e, - 0x5a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x6f, 0x6b, + 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x28, 0x01, 0x30, 0x01, 0x42, 0x37, + 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x6f, 0x6b, 0x6f, 0x70, 0x65, 0x64, 0x69, 0x61, 0x2f, 0x67, 0x72, 0x69, 0x70, 0x6d, 0x6f, 0x63, 0x6b, 0x2f, - 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, + 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/protogen/example/stream/stream.proto b/protogen/example/stream/stream.proto new file mode 100644 index 00000000..0fa8f0c9 --- /dev/null +++ b/protogen/example/stream/stream.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; +option go_package = "github.com/tokopedia/gripmock/protogen/example/stream"; + +package stream; + + +// The Gripmock service definition. +service Gripmock { + // server to client sreaming + rpc serverStream (Request) returns (stream Reply); + // client to server streaming + rpc clientStream (stream Request) returns (Reply); + // bidirectional streaming + rpc bidirectional (stream Request) returns (stream Reply); +} + +// The request message containing the user's name. +message Request { + string name = 1; +} + +// The response message containing the greetings +message Reply { + string message = 1; +} \ No newline at end of file diff --git a/example/stub-subfolders/stub-subfolders.pb.go b/protogen/example/stub-subfolders/stub-subfolders.pb.go similarity index 60% rename from example/stub-subfolders/stub-subfolders.pb.go rename to protogen/example/stub-subfolders/stub-subfolders.pb.go index 6caa19ee..115c8dd7 100644 --- a/example/stub-subfolders/stub-subfolders.pb.go +++ b/protogen/example/stub-subfolders/stub-subfolders.pb.go @@ -1,14 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.24.0-devel -// protoc v3.12.2 +// protoc-gen-go v1.27.1 +// protoc v3.17.3 // source: stub-subfolders.proto package stub_subfolders import ( context "context" - proto "github.com/golang/protobuf/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -25,10 +24,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - // The request message containing the user's name. type Request struct { state protoimpl.MessageState @@ -41,7 +36,7 @@ type Request struct { func (x *Request) Reset() { *x = Request{} if protoimpl.UnsafeEnabled { - mi := &file_simple_proto_msgTypes[0] + mi := &file_stub_subfolders_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -54,7 +49,7 @@ func (x *Request) String() string { func (*Request) ProtoMessage() {} func (x *Request) ProtoReflect() protoreflect.Message { - mi := &file_simple_proto_msgTypes[0] + mi := &file_stub_subfolders_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -67,7 +62,7 @@ func (x *Request) ProtoReflect() protoreflect.Message { // Deprecated: Use Request.ProtoReflect.Descriptor instead. func (*Request) Descriptor() ([]byte, []int) { - return file_simple_proto_rawDescGZIP(), []int{0} + return file_stub_subfolders_proto_rawDescGZIP(), []int{0} } func (x *Request) GetName() string { @@ -90,7 +85,7 @@ type Reply struct { func (x *Reply) Reset() { *x = Reply{} if protoimpl.UnsafeEnabled { - mi := &file_simple_proto_msgTypes[1] + mi := &file_stub_subfolders_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -103,7 +98,7 @@ func (x *Reply) String() string { func (*Reply) ProtoMessage() {} func (x *Reply) ProtoReflect() protoreflect.Message { - mi := &file_simple_proto_msgTypes[1] + mi := &file_stub_subfolders_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -116,7 +111,7 @@ func (x *Reply) ProtoReflect() protoreflect.Message { // Deprecated: Use Reply.ProtoReflect.Descriptor instead. func (*Reply) Descriptor() ([]byte, []int) { - return file_simple_proto_rawDescGZIP(), []int{1} + return file_stub_subfolders_proto_rawDescGZIP(), []int{1} } func (x *Reply) GetMessage() string { @@ -133,43 +128,49 @@ func (x *Reply) GetReturnCode() int32 { return 0 } -var File_simple_proto protoreflect.FileDescriptor - -var file_simple_proto_rawDesc = []byte{ - 0x0a, 0x0c, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, - 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x22, 0x1d, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x42, 0x0a, 0x05, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x18, - 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x74, 0x75, - 0x72, 0x6e, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x72, - 0x65, 0x74, 0x75, 0x72, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x32, 0x36, 0x0a, 0x08, 0x47, 0x72, 0x69, - 0x70, 0x6d, 0x6f, 0x63, 0x6b, 0x12, 0x2a, 0x0a, 0x08, 0x53, 0x61, 0x79, 0x48, 0x65, 0x6c, 0x6c, - 0x6f, 0x12, 0x0f, 0x2e, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x52, 0x65, 0x70, 0x6c, - 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +var File_stub_subfolders_proto protoreflect.FileDescriptor + +var file_stub_subfolders_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x73, 0x74, 0x75, 0x62, 0x2d, 0x73, 0x75, 0x62, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x73, 0x74, 0x75, 0x62, 0x5f, 0x73, 0x75, + 0x62, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x73, 0x22, 0x1d, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x42, 0x0a, 0x05, 0x52, 0x65, 0x70, 0x6c, 0x79, + 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, + 0x74, 0x75, 0x72, 0x6e, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0a, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x32, 0x48, 0x0a, 0x08, 0x47, + 0x72, 0x69, 0x70, 0x6d, 0x6f, 0x63, 0x6b, 0x12, 0x3c, 0x0a, 0x08, 0x53, 0x61, 0x79, 0x48, 0x65, + 0x6c, 0x6c, 0x6f, 0x12, 0x18, 0x2e, 0x73, 0x74, 0x75, 0x62, 0x5f, 0x73, 0x75, 0x62, 0x66, 0x6f, + 0x6c, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, + 0x73, 0x74, 0x75, 0x62, 0x5f, 0x73, 0x75, 0x62, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x73, 0x2e, + 0x52, 0x65, 0x70, 0x6c, 0x79, 0x42, 0x40, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x6f, 0x6b, 0x6f, 0x70, 0x65, 0x64, 0x69, 0x61, 0x2f, 0x67, 0x72, + 0x69, 0x70, 0x6d, 0x6f, 0x63, 0x6b, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, + 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x73, 0x74, 0x75, 0x62, 0x2d, 0x73, 0x75, 0x62, + 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_simple_proto_rawDescOnce sync.Once - file_simple_proto_rawDescData = file_simple_proto_rawDesc + file_stub_subfolders_proto_rawDescOnce sync.Once + file_stub_subfolders_proto_rawDescData = file_stub_subfolders_proto_rawDesc ) -func file_simple_proto_rawDescGZIP() []byte { - file_simple_proto_rawDescOnce.Do(func() { - file_simple_proto_rawDescData = protoimpl.X.CompressGZIP(file_simple_proto_rawDescData) +func file_stub_subfolders_proto_rawDescGZIP() []byte { + file_stub_subfolders_proto_rawDescOnce.Do(func() { + file_stub_subfolders_proto_rawDescData = protoimpl.X.CompressGZIP(file_stub_subfolders_proto_rawDescData) }) - return file_simple_proto_rawDescData + return file_stub_subfolders_proto_rawDescData } -var file_simple_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_simple_proto_goTypes = []interface{}{ - (*Request)(nil), // 0: simple.Request - (*Reply)(nil), // 1: simple.Reply +var file_stub_subfolders_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_stub_subfolders_proto_goTypes = []interface{}{ + (*Request)(nil), // 0: stub_subfolders.Request + (*Reply)(nil), // 1: stub_subfolders.Reply } -var file_simple_proto_depIdxs = []int32{ - 0, // 0: simple.Gripmock.SayHello:input_type -> simple.Request - 1, // 1: simple.Gripmock.SayHello:output_type -> simple.Reply +var file_stub_subfolders_proto_depIdxs = []int32{ + 0, // 0: stub_subfolders.Gripmock.SayHello:input_type -> stub_subfolders.Request + 1, // 1: stub_subfolders.Gripmock.SayHello:output_type -> stub_subfolders.Reply 1, // [1:2] is the sub-list for method output_type 0, // [0:1] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name @@ -177,13 +178,13 @@ var file_simple_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for field type_name } -func init() { file_simple_proto_init() } -func file_simple_proto_init() { - if File_simple_proto != nil { +func init() { file_stub_subfolders_proto_init() } +func file_stub_subfolders_proto_init() { + if File_stub_subfolders_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_simple_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_stub_subfolders_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Request); i { case 0: return &v.state @@ -195,7 +196,7 @@ func file_simple_proto_init() { return nil } } - file_simple_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_stub_subfolders_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Reply); i { case 0: return &v.state @@ -212,20 +213,20 @@ func file_simple_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_simple_proto_rawDesc, + RawDescriptor: file_stub_subfolders_proto_rawDesc, NumEnums: 0, NumMessages: 2, NumExtensions: 0, NumServices: 1, }, - GoTypes: file_simple_proto_goTypes, - DependencyIndexes: file_simple_proto_depIdxs, - MessageInfos: file_simple_proto_msgTypes, + GoTypes: file_stub_subfolders_proto_goTypes, + DependencyIndexes: file_stub_subfolders_proto_depIdxs, + MessageInfos: file_stub_subfolders_proto_msgTypes, }.Build() - File_simple_proto = out.File - file_simple_proto_rawDesc = nil - file_simple_proto_goTypes = nil - file_simple_proto_depIdxs = nil + File_stub_subfolders_proto = out.File + file_stub_subfolders_proto_rawDesc = nil + file_stub_subfolders_proto_goTypes = nil + file_stub_subfolders_proto_depIdxs = nil } // Reference imports to suppress errors if they are not otherwise used. @@ -254,7 +255,7 @@ func NewGripmockClient(cc grpc.ClientConnInterface) GripmockClient { func (c *gripmockClient) SayHello(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Reply, error) { out := new(Reply) - err := c.cc.Invoke(ctx, "/simple.Gripmock/SayHello", in, out, opts...) + err := c.cc.Invoke(ctx, "/stub_subfolders.Gripmock/SayHello", in, out, opts...) if err != nil { return nil, err } @@ -289,7 +290,7 @@ func _Gripmock_SayHello_Handler(srv interface{}, ctx context.Context, dec func(i } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/simple.Gripmock/SayHello", + FullMethod: "/stub_subfolders.Gripmock/SayHello", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GripmockServer).SayHello(ctx, req.(*Request)) @@ -298,7 +299,7 @@ func _Gripmock_SayHello_Handler(srv interface{}, ctx context.Context, dec func(i } var _Gripmock_serviceDesc = grpc.ServiceDesc{ - ServiceName: "simple.Gripmock", + ServiceName: "stub_subfolders.Gripmock", HandlerType: (*GripmockServer)(nil), Methods: []grpc.MethodDesc{ { @@ -307,5 +308,5 @@ var _Gripmock_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "simple.proto", + Metadata: "stub-subfolders.proto", } diff --git a/protogen/example/stub-subfolders/stub-subfolders.proto b/protogen/example/stub-subfolders/stub-subfolders.proto new file mode 100644 index 00000000..e52f7373 --- /dev/null +++ b/protogen/example/stub-subfolders/stub-subfolders.proto @@ -0,0 +1,21 @@ +syntax = "proto3"; +option go_package = "github.com/tokopedia/gripmock/protogen/example/stub-subfolders"; + +package stub_subfolders; + +// The Gripmock service definition. +service Gripmock { + // simple unary method + rpc SayHello (Request) returns (Reply); +} + +// The request message containing the user's name. +message Request { + string name = 1; +} + +// The response message containing the greetings +message Reply { + string message = 1; + int32 return_code = 2; +} \ No newline at end of file diff --git a/example/well_known_types/wkt.pb.go b/protogen/example/well_known_types/wkt.pb.go similarity index 95% rename from example/well_known_types/wkt.pb.go rename to protogen/example/well_known_types/wkt.pb.go index 13877f7d..6ff88407 100644 --- a/example/well_known_types/wkt.pb.go +++ b/protogen/example/well_known_types/wkt.pb.go @@ -4,7 +4,7 @@ // protoc v3.17.3 // source: wkt.proto -package wkt +package well_known_types import ( context "context" @@ -37,11 +37,12 @@ var file_wkt_proto_rawDesc = []byte{ 0x6b, 0x12, 0x37, 0x0a, 0x07, 0x41, 0x70, 0x69, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x70, 0x69, 0x42, 0x3c, 0x5a, 0x3a, 0x67, 0x69, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x70, 0x69, 0x42, 0x41, 0x5a, 0x3f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x6f, 0x6b, 0x6f, 0x70, 0x65, 0x64, - 0x69, 0x61, 0x2f, 0x67, 0x72, 0x69, 0x70, 0x6d, 0x6f, 0x63, 0x6b, 0x2f, 0x65, 0x78, 0x61, 0x6d, - 0x70, 0x6c, 0x65, 0x2f, 0x77, 0x65, 0x6c, 0x6c, 0x5f, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x3b, 0x77, 0x6b, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x69, 0x61, 0x2f, 0x67, 0x72, 0x69, 0x70, 0x6d, 0x6f, 0x63, 0x6b, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x77, 0x65, 0x6c, + 0x6c, 0x5f, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var file_wkt_proto_goTypes = []interface{}{ diff --git a/protogen/example/well_known_types/wkt.proto b/protogen/example/well_known_types/wkt.proto new file mode 100644 index 00000000..d0ca9dee --- /dev/null +++ b/protogen/example/well_known_types/wkt.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +option go_package = "github.com/tokopedia/gripmock/protogen/example/well_known_types"; + +package well_known_types; + +import "google/protobuf/empty.proto"; +import "google/protobuf/api.proto"; + + +service Gripmock { + // this shows us example on using WKT as dependency + // api.proto in particular has go_package alias with semicolon + // "google.golang.org/genproto/protobuf/api;api" + rpc ApiInfo(google.protobuf.Empty) returns (google.protobuf.Api); +} diff --git a/protogen/go.mod b/protogen/go.mod new file mode 100644 index 00000000..75e4ce79 --- /dev/null +++ b/protogen/go.mod @@ -0,0 +1,3 @@ +module github.com/tokopedia/gripmock/protogen + +go 1.13 diff --git a/protogen/go.sum b/protogen/go.sum new file mode 100644 index 00000000..e69de29b