From c6e946d07c89818f128ab73be549946917e717ff Mon Sep 17 00:00:00 2001 From: Maxim Babichev Date: Thu, 5 Dec 2024 00:44:42 +0300 Subject: [PATCH] wkt: expanding googleapis support --- example/well_known_types/wkt.proto | 15 ++ go.mod | 17 +- go.sum | 34 ++-- protoc-gen-gripmock/go.mod | 6 +- protoc-gen-gripmock/go.sum | 12 +- protogen/empty.go | 19 ++ protogen/example/ms/ms.pb.go | 48 +---- protogen/example/multi-files/file1.pb.go | 48 +---- protogen/example/multi-files/file2.pb.go | 48 +---- protogen/example/multi-package/bar/bar.pb.go | 26 +-- protogen/example/multi-package/foo.pb.go | 26 +-- protogen/example/multi-package/hello.pb.go | 2 +- protogen/example/one-of/oneof.pb.go | 92 ++-------- protogen/example/simple/simple.pb.go | 48 +---- protogen/example/stream/stream.pb.go | 48 +---- .../stub-subfolders/stub-subfolders.pb.go | 48 +---- protogen/example/well_known_types/wkt.pb.go | 172 +++++++++++++++--- protogen/example/well_known_types/wkt.proto | 15 ++ .../example/well_known_types/wkt_grpc.pb.go | 40 +++- protogen/go.mod | 9 +- protogen/go.sum | 18 +- 21 files changed, 370 insertions(+), 421 deletions(-) diff --git a/example/well_known_types/wkt.proto b/example/well_known_types/wkt.proto index 28891bcb..5a0dece8 100644 --- a/example/well_known_types/wkt.proto +++ b/example/well_known_types/wkt.proto @@ -5,6 +5,7 @@ package well_known_types; import "google/api/annotations.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/api.proto"; +import "google/type/date.proto"; option go_package = "github.com/bavix/gripmock/example/well_known_types;wkt"; service Gripmock { @@ -17,4 +18,18 @@ service Gripmock { body: "*" }; } + + rpc ApiInfoV2 (ApiInfoV2Request) returns (ApiInfoV2Response) { + option (google.api.http) = { + post: "/v2/gripmock/api-info" + body: "*" + }; + } +} + +message ApiInfoV2Request { + string name = 1; + google.type.Date time = 2; } + +message ApiInfoV2Response {} diff --git a/go.mod b/go.mod index 32c7f63c..3a798dd9 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.23 require ( github.com/bavix/gripmock/protogen v0.0.0 - github.com/goccy/go-yaml v1.14.3 + github.com/goccy/go-yaml v1.15.3 github.com/google/uuid v1.6.0 github.com/gorilla/mux v1.8.1 github.com/hashicorp/go-memdb v1.3.4 @@ -14,13 +14,13 @@ require ( github.com/oapi-codegen/runtime v1.1.1 github.com/pkg/errors v0.9.1 github.com/rs/zerolog v1.33.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.57.0 go.opentelemetry.io/otel v1.32.0 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.32.0 go.opentelemetry.io/otel/sdk v1.32.0 golang.org/x/text v0.20.0 - google.golang.org/grpc v1.68.0 + google.golang.org/grpc v1.68.1 google.golang.org/protobuf v1.35.2 ) @@ -31,7 +31,7 @@ require ( github.com/felixge/httpsnoop v1.0.4 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.23.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.24.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect github.com/hashicorp/golang-lru v1.0.2 // indirect github.com/mattn/go-colorable v0.1.13 // indirect @@ -42,11 +42,12 @@ require ( go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.32.0 // indirect go.opentelemetry.io/otel/metric v1.32.0 // indirect go.opentelemetry.io/otel/trace v1.32.0 // indirect - go.opentelemetry.io/proto/otlp v1.3.1 // indirect + go.opentelemetry.io/proto/otlp v1.4.0 // indirect golang.org/x/net v0.31.0 // indirect - golang.org/x/sys v0.27.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20241113202542-65e8d215514f // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20241113202542-65e8d215514f // indirect + golang.org/x/sys v0.28.0 // indirect + google.golang.org/genproto v0.0.0-20241202173237-19429a94021a // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20241202173237-19429a94021a // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 0eaffe65..074db43a 100644 --- a/go.sum +++ b/go.sum @@ -15,8 +15,8 @@ github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/goccy/go-yaml v1.14.3 h1:8tVD+aqqPLWisSEhM+6wWoiURWXCx6BwaTKS6ZeITgM= -github.com/goccy/go-yaml v1.14.3/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA= +github.com/goccy/go-yaml v1.15.3 h1:wQ4UwLFkgbSazdi+i9AVmZE3vKTktlNlI2kQqXo5L+I= +github.com/goccy/go-yaml v1.15.3/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= @@ -26,8 +26,8 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.23.0 h1:ad0vkEBuk23VJzZR9nkLVG0YAoN9coASF1GusYX6AlU= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.23.0/go.mod h1:igFoXX2ELCW06bol23DWPB5BEWfZISOzSP5K2sbLea0= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.24.0 h1:TmHmbvxPmaegwhDubVz0lICL0J5Ka2vwTzhoePEXsGE= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.24.0/go.mod h1:qztMSjm835F2bXf+5HKAPIS5qsmQDqZna/PgVt4rWtI= github.com/hashicorp/go-immutable-radix v1.3.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= @@ -70,8 +70,8 @@ github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWR github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKkMo8ZTx3f+BZEkzsRUY10Xsm2mwU0= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.57.0 h1:ydMxn2B3ZKzDXmjgE/tBtq7RsArxmikZUlRWComOPFs= go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.57.0/go.mod h1:rD9Z+09JseOeFdSJUrtnA2hO4XBY3lf1Tj0tPqf+LEM= @@ -91,8 +91,8 @@ go.opentelemetry.io/otel/sdk v1.32.0 h1:RNxepc9vK59A8XsgZQouW8ue8Gkb4jpWtJm9ge5l go.opentelemetry.io/otel/sdk v1.32.0/go.mod h1:LqgegDBjKMmb2GC6/PrTnteJG39I8/vJCAP9LlJXEjU= go.opentelemetry.io/otel/trace v1.32.0 h1:WIC9mYrXf8TmY/EXuULKc8hR17vE+Hjv2cssQDe03fM= go.opentelemetry.io/otel/trace v1.32.0/go.mod h1:+i4rkvCraA+tG6AzwloGaCtkx53Fa+L+V8e9a7YvhT8= -go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= -go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= +go.opentelemetry.io/proto/otlp v1.4.0 h1:TA9WRvW6zMwP+Ssb6fLoUIuirti1gGbP28GcKG1jgeg= +go.opentelemetry.io/proto/otlp v1.4.0/go.mod h1:PPBWZIP98o2ElSqI35IHfu7hIhSwvc5N38Jw8pXuGFY= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -117,8 +117,8 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= @@ -134,12 +134,14 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto/googleapis/api v0.0.0-20241113202542-65e8d215514f h1:M65LEviCfuZTfrfzwwEoxVtgvfkFkBUbFnRbxCXuXhU= -google.golang.org/genproto/googleapis/api v0.0.0-20241113202542-65e8d215514f/go.mod h1:Yo94eF2nj7igQt+TiJ49KxjIH8ndLYPZMIRSiRcEbg0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241113202542-65e8d215514f h1:C1QccEa9kUwvMgEUORqQD9S17QesQijxjZ84sO82mfo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241113202542-65e8d215514f/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= -google.golang.org/grpc v1.68.0 h1:aHQeeJbo8zAkAa3pRzrVjZlbz6uSfeOXlJNQM0RAbz0= -google.golang.org/grpc v1.68.0/go.mod h1:fmSPC5AsjSBCK54MyHRx48kpOti1/jRfOlwEWywNjWA= +google.golang.org/genproto v0.0.0-20241202173237-19429a94021a h1:4voejwOVTsjw6IMfnGt8IzTQBIw45hP8S0e77UMounA= +google.golang.org/genproto v0.0.0-20241202173237-19429a94021a/go.mod h1:dW27OyXi0Ph+N43jeCWMFC86aTT5VgdeQtOSf0Hehdw= +google.golang.org/genproto/googleapis/api v0.0.0-20241202173237-19429a94021a h1:OAiGFfOiA0v9MRYsSidp3ubZaBnteRUyn3xB2ZQ5G/E= +google.golang.org/genproto/googleapis/api v0.0.0-20241202173237-19429a94021a/go.mod h1:jehYqy3+AhJU9ve55aNOaSml7wUXjF9x6z2LcCfpAhY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a h1:hgh8P4EuoxpsuKMXX/To36nOFD7vixReXgn8lPGnt+o= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU= +google.golang.org/grpc v1.68.1 h1:oI5oTa11+ng8r8XMMN7jAOmWfPZWbYpCFaMUTACxkM0= +google.golang.org/grpc v1.68.1/go.mod h1:+q1XYFJjShcqn0QZHvCyeR4CXPA+llXIeUIfIe00waw= google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io= google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/protoc-gen-gripmock/go.mod b/protoc-gen-gripmock/go.mod index 39ab344d..70515ea5 100644 --- a/protoc-gen-gripmock/go.mod +++ b/protoc-gen-gripmock/go.mod @@ -20,7 +20,7 @@ require ( golang.org/x/mod v0.22.0 // indirect golang.org/x/net v0.31.0 // indirect golang.org/x/sync v0.9.0 // indirect - golang.org/x/sys v0.27.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20241113202542-65e8d215514f // indirect - google.golang.org/grpc v1.68.0 // indirect + golang.org/x/sys v0.28.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a // indirect + google.golang.org/grpc v1.68.1 // indirect ) diff --git a/protoc-gen-gripmock/go.sum b/protoc-gen-gripmock/go.sum index 6cbcd49f..8285ac0f 100644 --- a/protoc-gen-gripmock/go.sum +++ b/protoc-gen-gripmock/go.sum @@ -31,16 +31,16 @@ golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= golang.org/x/tools v0.27.0 h1:qEKojBykQkQ4EynWy4S8Weg69NumxKdn40Fce3uc/8o= golang.org/x/tools v0.27.0/go.mod h1:sUi0ZgbwW9ZPAq26Ekut+weQPR5eIM6GQLQ1Yjm1H0Q= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241113202542-65e8d215514f h1:C1QccEa9kUwvMgEUORqQD9S17QesQijxjZ84sO82mfo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241113202542-65e8d215514f/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= -google.golang.org/grpc v1.68.0 h1:aHQeeJbo8zAkAa3pRzrVjZlbz6uSfeOXlJNQM0RAbz0= -google.golang.org/grpc v1.68.0/go.mod h1:fmSPC5AsjSBCK54MyHRx48kpOti1/jRfOlwEWywNjWA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a h1:hgh8P4EuoxpsuKMXX/To36nOFD7vixReXgn8lPGnt+o= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU= +google.golang.org/grpc v1.68.1 h1:oI5oTa11+ng8r8XMMN7jAOmWfPZWbYpCFaMUTACxkM0= +google.golang.org/grpc v1.68.1/go.mod h1:+q1XYFJjShcqn0QZHvCyeR4CXPA+llXIeUIfIe00waw= google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io= google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/protogen/empty.go b/protogen/empty.go index f614159b..ed2c1fc9 100644 --- a/protogen/empty.go +++ b/protogen/empty.go @@ -4,6 +4,25 @@ import ( _ "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" _ "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" _ "google.golang.org/genproto/googleapis/api/annotations" + _ "google.golang.org/genproto/googleapis/type/calendarperiod" + _ "google.golang.org/genproto/googleapis/type/color" + _ "google.golang.org/genproto/googleapis/type/date" + _ "google.golang.org/genproto/googleapis/type/date_range" + _ "google.golang.org/genproto/googleapis/type/date_time_range" + _ "google.golang.org/genproto/googleapis/type/datetime" + _ "google.golang.org/genproto/googleapis/type/dayofweek" + _ "google.golang.org/genproto/googleapis/type/decimal" + _ "google.golang.org/genproto/googleapis/type/expr" + _ "google.golang.org/genproto/googleapis/type/fraction" + _ "google.golang.org/genproto/googleapis/type/interval" + _ "google.golang.org/genproto/googleapis/type/latlng" + _ "google.golang.org/genproto/googleapis/type/localized_text" + _ "google.golang.org/genproto/googleapis/type/money" + _ "google.golang.org/genproto/googleapis/type/month" + _ "google.golang.org/genproto/googleapis/type/phone_number" + _ "google.golang.org/genproto/googleapis/type/postaladdress" + _ "google.golang.org/genproto/googleapis/type/quaternion" + _ "google.golang.org/genproto/googleapis/type/timeofday" _ "google.golang.org/grpc" _ "google.golang.org/grpc/codes" _ "google.golang.org/grpc/status" diff --git a/protogen/example/ms/ms.pb.go b/protogen/example/ms/ms.pb.go index e1ab4c73..d2242b9c 100644 --- a/protogen/example/ms/ms.pb.go +++ b/protogen/example/ms/ms.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.35.2 // protoc v4.24.4 // source: ms.proto @@ -31,11 +31,9 @@ type Request struct { func (x *Request) Reset() { *x = Request{} - if protoimpl.UnsafeEnabled { - mi := &file_ms_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_ms_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Request) String() string { @@ -46,7 +44,7 @@ func (*Request) ProtoMessage() {} func (x *Request) ProtoReflect() protoreflect.Message { mi := &file_ms_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -85,11 +83,9 @@ type Reply struct { func (x *Reply) Reset() { *x = Reply{} - if protoimpl.UnsafeEnabled { - mi := &file_ms_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_ms_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Reply) String() string { @@ -100,7 +96,7 @@ func (*Reply) ProtoMessage() {} func (x *Reply) ProtoReflect() protoreflect.Message { mi := &file_ms_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -172,32 +168,6 @@ func file_ms_proto_init() { if File_ms_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_ms_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Request); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ms_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*Reply); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/protogen/example/multi-files/file1.pb.go b/protogen/example/multi-files/file1.pb.go index 7f16937b..e7f90ef7 100644 --- a/protogen/example/multi-files/file1.pb.go +++ b/protogen/example/multi-files/file1.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.35.2 // protoc v4.24.4 // source: file1.proto @@ -31,11 +31,9 @@ type Request1 struct { func (x *Request1) Reset() { *x = Request1{} - if protoimpl.UnsafeEnabled { - mi := &file_file1_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_file1_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Request1) String() string { @@ -46,7 +44,7 @@ func (*Request1) ProtoMessage() {} func (x *Request1) ProtoReflect() protoreflect.Message { mi := &file_file1_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -80,11 +78,9 @@ type Reply1 struct { func (x *Reply1) Reset() { *x = Reply1{} - if protoimpl.UnsafeEnabled { - mi := &file_file1_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_file1_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Reply1) String() string { @@ -95,7 +91,7 @@ func (*Reply1) ProtoMessage() {} func (x *Reply1) ProtoReflect() protoreflect.Message { mi := &file_file1_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -178,32 +174,6 @@ func file_file1_proto_init() { if File_file1_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_file1_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Request1); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_file1_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*Reply1); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/protogen/example/multi-files/file2.pb.go b/protogen/example/multi-files/file2.pb.go index 434ea8f3..a3dbad6f 100644 --- a/protogen/example/multi-files/file2.pb.go +++ b/protogen/example/multi-files/file2.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.35.2 // protoc v4.24.4 // source: file2.proto @@ -31,11 +31,9 @@ type Request2 struct { func (x *Request2) Reset() { *x = Request2{} - if protoimpl.UnsafeEnabled { - mi := &file_file2_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_file2_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Request2) String() string { @@ -46,7 +44,7 @@ func (*Request2) ProtoMessage() {} func (x *Request2) ProtoReflect() protoreflect.Message { mi := &file_file2_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -80,11 +78,9 @@ type Reply2 struct { func (x *Reply2) Reset() { *x = Reply2{} - if protoimpl.UnsafeEnabled { - mi := &file_file2_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_file2_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Reply2) String() string { @@ -95,7 +91,7 @@ func (*Reply2) ProtoMessage() {} func (x *Reply2) ProtoReflect() protoreflect.Message { mi := &file_file2_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -178,32 +174,6 @@ func file_file2_proto_init() { if File_file2_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_file2_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Request2); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_file2_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*Reply2); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/protogen/example/multi-package/bar/bar.pb.go b/protogen/example/multi-package/bar/bar.pb.go index fa3feb38..fdace5e3 100644 --- a/protogen/example/multi-package/bar/bar.pb.go +++ b/protogen/example/multi-package/bar/bar.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.35.2 // protoc v4.24.4 // source: bar/bar.proto @@ -30,11 +30,9 @@ type Bar struct { func (x *Bar) Reset() { *x = Bar{} - if protoimpl.UnsafeEnabled { - mi := &file_bar_bar_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_bar_bar_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Bar) String() string { @@ -45,7 +43,7 @@ func (*Bar) ProtoMessage() {} func (x *Bar) ProtoReflect() protoreflect.Message { mi := &file_bar_bar_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -109,20 +107,6 @@ func file_bar_bar_proto_init() { if File_bar_bar_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_bar_bar_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Bar); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/protogen/example/multi-package/foo.pb.go b/protogen/example/multi-package/foo.pb.go index 33a519f6..31e0504b 100644 --- a/protogen/example/multi-package/foo.pb.go +++ b/protogen/example/multi-package/foo.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.35.2 // protoc v4.24.4 // source: foo.proto @@ -33,11 +33,9 @@ type Response struct { func (x *Response) Reset() { *x = Response{} - if protoimpl.UnsafeEnabled { - mi := &file_foo_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_foo_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Response) String() string { @@ -48,7 +46,7 @@ func (*Response) ProtoMessage() {} func (x *Response) ProtoReflect() protoreflect.Message { mi := &file_foo_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -112,20 +110,6 @@ func file_foo_proto_init() { if File_foo_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_foo_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Response); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/protogen/example/multi-package/hello.pb.go b/protogen/example/multi-package/hello.pb.go index a9405fd8..221ddc9e 100644 --- a/protogen/example/multi-package/hello.pb.go +++ b/protogen/example/multi-package/hello.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.35.2 // protoc v4.24.4 // source: hello.proto diff --git a/protogen/example/one-of/oneof.pb.go b/protogen/example/one-of/oneof.pb.go index 8e143d82..30928cea 100644 --- a/protogen/example/one-of/oneof.pb.go +++ b/protogen/example/one-of/oneof.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.35.2 // protoc v4.24.4 // source: oneof.proto @@ -31,11 +31,9 @@ type Request struct { func (x *Request) Reset() { *x = Request{} - if protoimpl.UnsafeEnabled { - mi := &file_oneof_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_oneof_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Request) String() string { @@ -46,7 +44,7 @@ func (*Request) ProtoMessage() {} func (x *Request) ProtoReflect() protoreflect.Message { mi := &file_oneof_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -82,11 +80,9 @@ type Reply struct { func (x *Reply) Reset() { *x = Reply{} - if protoimpl.UnsafeEnabled { - mi := &file_oneof_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_oneof_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Reply) String() string { @@ -97,7 +93,7 @@ func (*Reply) ProtoMessage() {} func (x *Reply) ProtoReflect() protoreflect.Message { mi := &file_oneof_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -161,11 +157,9 @@ type Reply1 struct { func (x *Reply1) Reset() { *x = Reply1{} - if protoimpl.UnsafeEnabled { - mi := &file_oneof_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_oneof_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Reply1) String() string { @@ -176,7 +170,7 @@ func (*Reply1) ProtoMessage() {} func (x *Reply1) ProtoReflect() protoreflect.Message { mi := &file_oneof_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -216,11 +210,9 @@ type Reply2 struct { func (x *Reply2) Reset() { *x = Reply2{} - if protoimpl.UnsafeEnabled { - mi := &file_oneof_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_oneof_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Reply2) String() string { @@ -231,7 +223,7 @@ func (*Reply2) ProtoMessage() {} func (x *Reply2) ProtoReflect() protoreflect.Message { mi := &file_oneof_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -318,56 +310,6 @@ func file_oneof_proto_init() { if File_oneof_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_oneof_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Request); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_oneof_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*Reply); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_oneof_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*Reply1); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_oneof_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*Reply2); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } file_oneof_proto_msgTypes[1].OneofWrappers = []any{ (*Reply_Reply1)(nil), (*Reply_Reply2)(nil), diff --git a/protogen/example/simple/simple.pb.go b/protogen/example/simple/simple.pb.go index d066d621..4fc23192 100644 --- a/protogen/example/simple/simple.pb.go +++ b/protogen/example/simple/simple.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.35.2 // protoc v4.24.4 // source: simple.proto @@ -34,11 +34,9 @@ type Request struct { func (x *Request) Reset() { *x = Request{} - if protoimpl.UnsafeEnabled { - mi := &file_simple_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_simple_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Request) String() string { @@ -49,7 +47,7 @@ func (*Request) ProtoMessage() {} func (x *Request) ProtoReflect() protoreflect.Message { mi := &file_simple_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -106,11 +104,9 @@ type Reply struct { func (x *Reply) Reset() { *x = Reply{} - if protoimpl.UnsafeEnabled { - mi := &file_simple_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_simple_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Reply) String() string { @@ -121,7 +117,7 @@ func (*Reply) ProtoMessage() {} func (x *Reply) ProtoReflect() protoreflect.Message { mi := &file_simple_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -224,32 +220,6 @@ func file_simple_proto_init() { if File_simple_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_simple_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Request); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_simple_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*Reply); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/protogen/example/stream/stream.pb.go b/protogen/example/stream/stream.pb.go index 819ed3b5..184c1780 100644 --- a/protogen/example/stream/stream.pb.go +++ b/protogen/example/stream/stream.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.35.2 // protoc v4.24.4 // source: stream.proto @@ -31,11 +31,9 @@ type Request struct { func (x *Request) Reset() { *x = Request{} - if protoimpl.UnsafeEnabled { - mi := &file_stream_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stream_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Request) String() string { @@ -46,7 +44,7 @@ func (*Request) ProtoMessage() {} func (x *Request) ProtoReflect() protoreflect.Message { mi := &file_stream_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -79,11 +77,9 @@ type Reply struct { func (x *Reply) Reset() { *x = Reply{} - if protoimpl.UnsafeEnabled { - mi := &file_stream_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stream_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Reply) String() string { @@ -94,7 +90,7 @@ func (*Reply) ProtoMessage() {} func (x *Reply) ProtoReflect() protoreflect.Message { mi := &file_stream_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -177,32 +173,6 @@ func file_stream_proto_init() { if File_stream_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_stream_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Request); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stream_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*Reply); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/protogen/example/stub-subfolders/stub-subfolders.pb.go b/protogen/example/stub-subfolders/stub-subfolders.pb.go index d577571d..e19ad51b 100644 --- a/protogen/example/stub-subfolders/stub-subfolders.pb.go +++ b/protogen/example/stub-subfolders/stub-subfolders.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.35.2 // protoc v4.24.4 // source: stub-subfolders.proto @@ -31,11 +31,9 @@ type Request struct { func (x *Request) Reset() { *x = Request{} - if protoimpl.UnsafeEnabled { - mi := &file_stub_subfolders_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stub_subfolders_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Request) String() string { @@ -46,7 +44,7 @@ func (*Request) ProtoMessage() {} func (x *Request) ProtoReflect() protoreflect.Message { mi := &file_stub_subfolders_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -80,11 +78,9 @@ type Reply struct { func (x *Reply) Reset() { *x = Reply{} - if protoimpl.UnsafeEnabled { - mi := &file_stub_subfolders_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_stub_subfolders_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Reply) String() string { @@ -95,7 +91,7 @@ func (*Reply) ProtoMessage() {} func (x *Reply) ProtoReflect() protoreflect.Message { mi := &file_stub_subfolders_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -179,32 +175,6 @@ func file_stub_subfolders_proto_init() { if File_stub_subfolders_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_stub_subfolders_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Request); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_stub_subfolders_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*Reply); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/protogen/example/well_known_types/wkt.pb.go b/protogen/example/well_known_types/wkt.pb.go index dce57037..2ae99c81 100644 --- a/protogen/example/well_known_types/wkt.pb.go +++ b/protogen/example/well_known_types/wkt.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.35.2 // protoc v4.24.4 // source: wkt.proto @@ -8,11 +8,13 @@ package well_known_types import ( _ "google.golang.org/genproto/googleapis/api/annotations" + date "google.golang.org/genproto/googleapis/type/date" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" apipb "google.golang.org/protobuf/types/known/apipb" emptypb "google.golang.org/protobuf/types/known/emptypb" reflect "reflect" + sync "sync" ) const ( @@ -22,6 +24,95 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +type ApiInfoV2Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Time *date.Date `protobuf:"bytes,2,opt,name=time,proto3" json:"time,omitempty"` +} + +func (x *ApiInfoV2Request) Reset() { + *x = ApiInfoV2Request{} + mi := &file_wkt_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ApiInfoV2Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApiInfoV2Request) ProtoMessage() {} + +func (x *ApiInfoV2Request) ProtoReflect() protoreflect.Message { + mi := &file_wkt_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ApiInfoV2Request.ProtoReflect.Descriptor instead. +func (*ApiInfoV2Request) Descriptor() ([]byte, []int) { + return file_wkt_proto_rawDescGZIP(), []int{0} +} + +func (x *ApiInfoV2Request) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ApiInfoV2Request) GetTime() *date.Date { + if x != nil { + return x.Time + } + return nil +} + +type ApiInfoV2Response struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ApiInfoV2Response) Reset() { + *x = ApiInfoV2Response{} + mi := &file_wkt_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ApiInfoV2Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApiInfoV2Response) ProtoMessage() {} + +func (x *ApiInfoV2Response) ProtoReflect() protoreflect.Message { + mi := &file_wkt_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ApiInfoV2Response.ProtoReflect.Descriptor instead. +func (*ApiInfoV2Response) Descriptor() ([]byte, []int) { + return file_wkt_proto_rawDescGZIP(), []int{1} +} + var File_wkt_proto protoreflect.FileDescriptor var file_wkt_proto_rawDesc = []byte{ @@ -32,32 +123,66 @@ var file_wkt_proto_rawDesc = []byte{ 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x32, 0x65, 0x0a, 0x08, 0x47, 0x72, 0x69, 0x70, 0x6d, 0x6f, 0x63, 0x6b, 0x12, - 0x59, 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, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, - 0x3a, 0x01, 0x2a, 0x22, 0x15, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x72, 0x69, 0x70, 0x6d, 0x6f, 0x63, - 0x6b, 0x2f, 0x61, 0x70, 0x69, 0x2d, 0x69, 0x6e, 0x66, 0x6f, 0x42, 0x3d, 0x5a, 0x3b, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x61, 0x76, 0x69, 0x78, 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, + 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x74, 0x79, 0x70, 0x65, + 0x2f, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4d, 0x0a, 0x10, 0x41, + 0x70, 0x69, 0x49, 0x6e, 0x66, 0x6f, 0x56, 0x32, 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, 0x12, 0x25, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, + 0x44, 0x61, 0x74, 0x65, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x13, 0x0a, 0x11, 0x41, 0x70, + 0x69, 0x49, 0x6e, 0x66, 0x6f, 0x56, 0x32, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, + 0xdd, 0x01, 0x0a, 0x08, 0x47, 0x72, 0x69, 0x70, 0x6d, 0x6f, 0x63, 0x6b, 0x12, 0x59, 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, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x3a, 0x01, 0x2a, + 0x22, 0x15, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x72, 0x69, 0x70, 0x6d, 0x6f, 0x63, 0x6b, 0x2f, 0x61, + 0x70, 0x69, 0x2d, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x76, 0x0a, 0x09, 0x41, 0x70, 0x69, 0x49, 0x6e, + 0x66, 0x6f, 0x56, 0x32, 0x12, 0x22, 0x2e, 0x77, 0x65, 0x6c, 0x6c, 0x5f, 0x6b, 0x6e, 0x6f, 0x77, + 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x41, 0x70, 0x69, 0x49, 0x6e, 0x66, 0x6f, 0x56, + 0x32, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x77, 0x65, 0x6c, 0x6c, 0x5f, + 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x41, 0x70, 0x69, 0x49, + 0x6e, 0x66, 0x6f, 0x56, 0x32, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x20, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x3a, 0x01, 0x2a, 0x22, 0x15, 0x2f, 0x76, 0x32, 0x2f, 0x67, 0x72, + 0x69, 0x70, 0x6d, 0x6f, 0x63, 0x6b, 0x2f, 0x61, 0x70, 0x69, 0x2d, 0x69, 0x6e, 0x66, 0x6f, 0x42, + 0x3d, 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x61, + 0x76, 0x69, 0x78, 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_rawDescOnce sync.Once + file_wkt_proto_rawDescData = file_wkt_proto_rawDesc +) + +func file_wkt_proto_rawDescGZIP() []byte { + file_wkt_proto_rawDescOnce.Do(func() { + file_wkt_proto_rawDescData = protoimpl.X.CompressGZIP(file_wkt_proto_rawDescData) + }) + return file_wkt_proto_rawDescData } +var file_wkt_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_wkt_proto_goTypes = []any{ - (*emptypb.Empty)(nil), // 0: google.protobuf.Empty - (*apipb.Api)(nil), // 1: google.protobuf.Api + (*ApiInfoV2Request)(nil), // 0: well_known_types.ApiInfoV2Request + (*ApiInfoV2Response)(nil), // 1: well_known_types.ApiInfoV2Response + (*date.Date)(nil), // 2: google.type.Date + (*emptypb.Empty)(nil), // 3: google.protobuf.Empty + (*apipb.Api)(nil), // 4: google.protobuf.Api } var file_wkt_proto_depIdxs = []int32{ - 0, // 0: well_known_types.Gripmock.ApiInfo:input_type -> google.protobuf.Empty - 1, // 1: well_known_types.Gripmock.ApiInfo:output_type -> google.protobuf.Api - 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 - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name + 2, // 0: well_known_types.ApiInfoV2Request.time:type_name -> google.type.Date + 3, // 1: well_known_types.Gripmock.ApiInfo:input_type -> google.protobuf.Empty + 0, // 2: well_known_types.Gripmock.ApiInfoV2:input_type -> well_known_types.ApiInfoV2Request + 4, // 3: well_known_types.Gripmock.ApiInfo:output_type -> google.protobuf.Api + 1, // 4: well_known_types.Gripmock.ApiInfoV2:output_type -> well_known_types.ApiInfoV2Response + 3, // [3:5] is the sub-list for method output_type + 1, // [1:3] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name } func init() { file_wkt_proto_init() } @@ -71,12 +196,13 @@ func file_wkt_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_wkt_proto_rawDesc, NumEnums: 0, - NumMessages: 0, + NumMessages: 2, NumExtensions: 0, NumServices: 1, }, GoTypes: file_wkt_proto_goTypes, DependencyIndexes: file_wkt_proto_depIdxs, + MessageInfos: file_wkt_proto_msgTypes, }.Build() File_wkt_proto = out.File file_wkt_proto_rawDesc = nil diff --git a/protogen/example/well_known_types/wkt.proto b/protogen/example/well_known_types/wkt.proto index 647f296a..1f0f3beb 100644 --- a/protogen/example/well_known_types/wkt.proto +++ b/protogen/example/well_known_types/wkt.proto @@ -5,6 +5,7 @@ package well_known_types; import "google/api/annotations.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/api.proto"; +import "google/type/date.proto"; option go_package = "github.com/bavix/gripmock/protogen/example/well_known_types"; service Gripmock { @@ -17,4 +18,18 @@ service Gripmock { body: "*" }; } + + rpc ApiInfoV2 (ApiInfoV2Request) returns (ApiInfoV2Response) { + option (google.api.http) = { + post: "/v2/gripmock/api-info" + body: "*" + }; + } +} + +message ApiInfoV2Request { + string name = 1; + google.type.Date time = 2; } + +message ApiInfoV2Response {} diff --git a/protogen/example/well_known_types/wkt_grpc.pb.go b/protogen/example/well_known_types/wkt_grpc.pb.go index 70fdec35..6385429b 100644 --- a/protogen/example/well_known_types/wkt_grpc.pb.go +++ b/protogen/example/well_known_types/wkt_grpc.pb.go @@ -21,7 +21,8 @@ import ( const _ = grpc.SupportPackageIsVersion9 const ( - Gripmock_ApiInfo_FullMethodName = "/well_known_types.Gripmock/ApiInfo" + Gripmock_ApiInfo_FullMethodName = "/well_known_types.Gripmock/ApiInfo" + Gripmock_ApiInfoV2_FullMethodName = "/well_known_types.Gripmock/ApiInfoV2" ) // GripmockClient is the client API for Gripmock service. @@ -32,6 +33,7 @@ type GripmockClient interface { // api.proto in particular has go_package alias with semicolon // "google.golang.org/genproto/protobuf/api;api" ApiInfo(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*apipb.Api, error) + ApiInfoV2(ctx context.Context, in *ApiInfoV2Request, opts ...grpc.CallOption) (*ApiInfoV2Response, error) } type gripmockClient struct { @@ -52,6 +54,16 @@ func (c *gripmockClient) ApiInfo(ctx context.Context, in *emptypb.Empty, opts .. return out, nil } +func (c *gripmockClient) ApiInfoV2(ctx context.Context, in *ApiInfoV2Request, opts ...grpc.CallOption) (*ApiInfoV2Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ApiInfoV2Response) + err := c.cc.Invoke(ctx, Gripmock_ApiInfoV2_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + // GripmockServer is the server API for Gripmock service. // All implementations must embed UnimplementedGripmockServer // for forward compatibility. @@ -60,6 +72,7 @@ type GripmockServer interface { // api.proto in particular has go_package alias with semicolon // "google.golang.org/genproto/protobuf/api;api" ApiInfo(context.Context, *emptypb.Empty) (*apipb.Api, error) + ApiInfoV2(context.Context, *ApiInfoV2Request) (*ApiInfoV2Response, error) mustEmbedUnimplementedGripmockServer() } @@ -73,6 +86,9 @@ type UnimplementedGripmockServer struct{} func (UnimplementedGripmockServer) ApiInfo(context.Context, *emptypb.Empty) (*apipb.Api, error) { return nil, status.Errorf(codes.Unimplemented, "method ApiInfo not implemented") } +func (UnimplementedGripmockServer) ApiInfoV2(context.Context, *ApiInfoV2Request) (*ApiInfoV2Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method ApiInfoV2 not implemented") +} func (UnimplementedGripmockServer) mustEmbedUnimplementedGripmockServer() {} func (UnimplementedGripmockServer) testEmbeddedByValue() {} @@ -112,6 +128,24 @@ func _Gripmock_ApiInfo_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Gripmock_ApiInfoV2_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ApiInfoV2Request) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GripmockServer).ApiInfoV2(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Gripmock_ApiInfoV2_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GripmockServer).ApiInfoV2(ctx, req.(*ApiInfoV2Request)) + } + return interceptor(ctx, in, info, handler) +} + // Gripmock_ServiceDesc is the grpc.ServiceDesc for Gripmock service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -123,6 +157,10 @@ var Gripmock_ServiceDesc = grpc.ServiceDesc{ MethodName: "ApiInfo", Handler: _Gripmock_ApiInfo_Handler, }, + { + MethodName: "ApiInfoV2", + Handler: _Gripmock_ApiInfoV2_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "wkt.proto", diff --git a/protogen/go.mod b/protogen/go.mod index 5d30b8c2..8ae63a60 100644 --- a/protogen/go.mod +++ b/protogen/go.mod @@ -5,8 +5,9 @@ go 1.23 require ( go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.57.0 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.57.0 - google.golang.org/genproto/googleapis/api v0.0.0-20241113202542-65e8d215514f - google.golang.org/grpc v1.68.0 + google.golang.org/genproto v0.0.0-20241202173237-19429a94021a + google.golang.org/genproto/googleapis/api v0.0.0-20241202173237-19429a94021a + google.golang.org/grpc v1.68.1 google.golang.org/protobuf v1.35.2 ) @@ -18,7 +19,7 @@ require ( go.opentelemetry.io/otel/metric v1.32.0 // indirect go.opentelemetry.io/otel/trace v1.32.0 // indirect golang.org/x/net v0.31.0 // indirect - golang.org/x/sys v0.27.0 // indirect + golang.org/x/sys v0.28.0 // indirect golang.org/x/text v0.20.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20241113202542-65e8d215514f // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a // indirect ) diff --git a/protogen/go.sum b/protogen/go.sum index 8347f748..505aef6d 100644 --- a/protogen/go.sum +++ b/protogen/go.sum @@ -27,16 +27,18 @@ go.opentelemetry.io/otel/trace v1.32.0 h1:WIC9mYrXf8TmY/EXuULKc8hR17vE+Hjv2cssQD go.opentelemetry.io/otel/trace v1.32.0/go.mod h1:+i4rkvCraA+tG6AzwloGaCtkx53Fa+L+V8e9a7YvhT8= golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= -google.golang.org/genproto/googleapis/api v0.0.0-20241113202542-65e8d215514f h1:M65LEviCfuZTfrfzwwEoxVtgvfkFkBUbFnRbxCXuXhU= -google.golang.org/genproto/googleapis/api v0.0.0-20241113202542-65e8d215514f/go.mod h1:Yo94eF2nj7igQt+TiJ49KxjIH8ndLYPZMIRSiRcEbg0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241113202542-65e8d215514f h1:C1QccEa9kUwvMgEUORqQD9S17QesQijxjZ84sO82mfo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241113202542-65e8d215514f/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= -google.golang.org/grpc v1.68.0 h1:aHQeeJbo8zAkAa3pRzrVjZlbz6uSfeOXlJNQM0RAbz0= -google.golang.org/grpc v1.68.0/go.mod h1:fmSPC5AsjSBCK54MyHRx48kpOti1/jRfOlwEWywNjWA= +google.golang.org/genproto v0.0.0-20241202173237-19429a94021a h1:4voejwOVTsjw6IMfnGt8IzTQBIw45hP8S0e77UMounA= +google.golang.org/genproto v0.0.0-20241202173237-19429a94021a/go.mod h1:dW27OyXi0Ph+N43jeCWMFC86aTT5VgdeQtOSf0Hehdw= +google.golang.org/genproto/googleapis/api v0.0.0-20241202173237-19429a94021a h1:OAiGFfOiA0v9MRYsSidp3ubZaBnteRUyn3xB2ZQ5G/E= +google.golang.org/genproto/googleapis/api v0.0.0-20241202173237-19429a94021a/go.mod h1:jehYqy3+AhJU9ve55aNOaSml7wUXjF9x6z2LcCfpAhY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a h1:hgh8P4EuoxpsuKMXX/To36nOFD7vixReXgn8lPGnt+o= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU= +google.golang.org/grpc v1.68.1 h1:oI5oTa11+ng8r8XMMN7jAOmWfPZWbYpCFaMUTACxkM0= +google.golang.org/grpc v1.68.1/go.mod h1:+q1XYFJjShcqn0QZHvCyeR4CXPA+llXIeUIfIe00waw= google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io= google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=