From 6c2488a11e2bd304e7baa96aa2b40b949c476396 Mon Sep 17 00:00:00 2001 From: sgayangi Date: Wed, 25 Sep 2024 14:17:51 +0530 Subject: [PATCH] Update go integration test for gRPC API --- test/integration/go.mod | 30 +-- test/integration/go.sum | 35 +++ .../integration/integration/tests/grpc-api.go | 4 +- .../tests/resources/base/manifests.yaml | 20 +- .../tests/resources/tests/grpc-api.yaml | 10 +- .../utils/grpc-code/student/student.go | 8 +- .../utils/grpc-code/student/student.pb.go | 86 +++---- .../grpc-code/student/student_grpc.pb.go | 214 +++++------------ .../student_default_version.pb.go | 144 ++++++------ .../student_default_version_grpc.pb.go | 218 ++++++------------ 10 files changed, 310 insertions(+), 459 deletions(-) diff --git a/test/integration/go.mod b/test/integration/go.mod index abfa51f20..b26db230d 100644 --- a/test/integration/go.mod +++ b/test/integration/go.mod @@ -16,11 +16,11 @@ require ( github.com/agnivade/levenshtein v1.1.1 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4 // indirect + github.com/cncf/xds/go v0.0.0-20240318125728-8a4994d93e50 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/emicklei/go-restful/v3 v3.9.0 // indirect - github.com/envoyproxy/go-control-plane v0.11.2-0.20230802074621-eea0b3bd0f81 // indirect - github.com/envoyproxy/protoc-gen-validate v1.0.2 // indirect + github.com/envoyproxy/go-control-plane v0.12.0 // indirect + github.com/envoyproxy/protoc-gen-validate v1.0.4 // indirect github.com/evanphx/json-patch/v5 v5.6.0 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/go-logr/logr v1.2.4 // indirect @@ -29,11 +29,11 @@ require ( github.com/go-openapi/swag v0.22.3 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/protobuf v1.5.3 // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/google/gnostic v0.5.7-v3refs // indirect - github.com/google/go-cmp v0.5.9 // indirect + github.com/google/go-cmp v0.6.0 // indirect github.com/google/gofuzz v1.2.0 // indirect - github.com/google/uuid v1.3.0 // indirect + github.com/google/uuid v1.6.0 // indirect github.com/imdario/mergo v0.3.12 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect @@ -46,7 +46,7 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_golang v1.15.1 // indirect - github.com/prometheus/client_model v0.4.0 // indirect + github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.42.0 // indirect github.com/prometheus/procfs v0.9.0 // indirect github.com/sirupsen/logrus v1.9.0 // indirect @@ -54,17 +54,17 @@ require ( github.com/vektah/gqlparser v1.3.1 // indirect github.com/wso2/apk/adapter v0.0.0-20231207051518-6dd728943082 // indirect golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb // indirect - golang.org/x/net v0.19.0 // indirect - golang.org/x/oauth2 v0.10.0 // indirect - golang.org/x/sys v0.15.0 // indirect - golang.org/x/term v0.15.0 // indirect + golang.org/x/net v0.22.0 // indirect + golang.org/x/oauth2 v0.18.0 // indirect + golang.org/x/sys v0.18.0 // indirect + golang.org/x/term v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.3.0 // indirect gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230731190214-cbb8c96f2d6d // indirect - google.golang.org/grpc v1.58.3 // indirect - google.golang.org/protobuf v1.31.0 // indirect + google.golang.org/appengine v1.6.8 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect + google.golang.org/grpc v1.64.0 // indirect + google.golang.org/protobuf v1.33.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/test/integration/go.sum b/test/integration/go.sum index 90e27943d..3508bcb5f 100644 --- a/test/integration/go.sum +++ b/test/integration/go.sum @@ -16,6 +16,7 @@ github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4 h1:/inchEIKaYC1Akx+H+gqO04wryn5h75LSazbRlnya1k= github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20240318125728-8a4994d93e50/go.mod h1:5e1+Vvlzido69INQaVO6d87Qn543Xr6nooe9Kz7oBFM= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= 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= @@ -29,9 +30,11 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF 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.11.2-0.20230802074621-eea0b3bd0f81 h1:dx15VeDt3L5Z0Wx28jXbwgpeTrLsVvqC/wSvNgYPb/k= github.com/envoyproxy/go-control-plane v0.11.2-0.20230802074621-eea0b3bd0f81/go.mod h1:zV+ml0OfGpQxGvM1qlmhvZzE9ShvBO7CPWzGb3q5cog= +github.com/envoyproxy/go-control-plane v0.12.0/go.mod h1:ZBTaoJ23lqITozF0M6G4/IragXCQKCnYbmlmtHvwRG0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA= github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE= +github.com/envoyproxy/protoc-gen-validate v1.0.4/go.mod h1:qys6tmnRsYrQqIhm2bvKZH4Blx/1gTIZ2UKVY1M+Yew= github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww= github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= @@ -67,6 +70,7 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/gnostic v0.5.7-v3refs h1:FhTMOKj2VhjpouxvWJAV1TL304uMlb9zcDqkl6cEI54= github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -76,12 +80,14 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= @@ -124,6 +130,7 @@ github.com/prometheus/client_golang v1.15.1/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= +github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= @@ -155,6 +162,7 @@ github.com/wso2/apk/common-go-libs v0.0.0-20240116050401-5ddd9af96825 h1:xPADJ/o github.com/wso2/apk/common-go-libs v0.0.0-20240116050401-5ddd9af96825/go.mod h1:OJyTVeVKVX2ZHZPb4ua+Db/Z/4gfocntXMjfNIxX6f8= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= @@ -162,6 +170,7 @@ go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= 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/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb h1:c0vyKkb6yr3KR7jEfJaOSv4lG7xPkbN6r52aJz1d8a8= golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= @@ -170,6 +179,7 @@ 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/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= 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-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -179,30 +189,47 @@ golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= +golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= +golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.10.0 h1:zHCpF2Khkwy4mMB4bv0U37YtJdTGW8jI0glAApi0Kh8= golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI= +golang.org/x/oauth2 v0.18.0/go.mod h1:Wf7knwG0MPoWIMMBgFlEaSUDaKskp0dCfrlJRJXbBi8= 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/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/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-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.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.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= +golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= 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= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= @@ -216,6 +243,7 @@ golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.16.0 h1:GO788SKMRunPIBCXiQyo2AaexLstOrVhuAL5YwsckQM= 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= @@ -227,18 +255,23 @@ 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/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= 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-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto/googleapis/rpc v0.0.0-20230731190214-cbb8c96f2d6d h1:pgIUhmqwKOUlnKna4r6amKdUngdL8DrkpFeV8+VBElY= google.golang.org/genproto/googleapis/rpc v0.0.0-20230731190214-cbb8c96f2d6d/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 h1:NnYq6UN9ReLM9/Y01KWNOWyI5xQ9kbIms5GGJVwS/Yc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= 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.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ= google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= +google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= +google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= 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= @@ -251,6 +284,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= diff --git a/test/integration/integration/tests/grpc-api.go b/test/integration/integration/tests/grpc-api.go index a5b46aac0..2ddf270d7 100644 --- a/test/integration/integration/tests/grpc-api.go +++ b/test/integration/integration/tests/grpc-api.go @@ -42,7 +42,7 @@ var GRPCAPI = suite.IntegrationTest{ { ExpectedResponse: grpcutils.ExpectedResponse{ Out: &student.StudentResponse{ - Name: "Dineth", + Name: "Student", Age: 10, }, Err: nil, @@ -55,7 +55,7 @@ var GRPCAPI = suite.IntegrationTest{ { ExpectedResponse: grpcutils.ExpectedResponse{ Out: &student_default_version.StudentResponse{ - Name: "Dineth", + Name: "Student", Age: 10, }, Err: nil, diff --git a/test/integration/integration/tests/resources/base/manifests.yaml b/test/integration/integration/tests/resources/base/manifests.yaml index 81592bc23..6c675d5d0 100644 --- a/test/integration/integration/tests/resources/base/manifests.yaml +++ b/test/integration/integration/tests/resources/base/manifests.yaml @@ -122,7 +122,7 @@ spec: ports: - protocol: TCP port: 6565 - targetPort: 6565 + targetPort: 9090 --- apiVersion: apps/v1 kind: Deployment @@ -142,21 +142,11 @@ spec: app: grpc-backend-v1 spec: containers: - - name: grpc-backend-v1 - image: ddh13/dineth-grpc-demo-server:1.0.0 + - name: grpc-backend + image: sega1234/student-service:1.0.0 imagePullPolicy: Always - env: - - name: POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - resources: - requests: - cpu: 10m + ports: + - containerPort: 9090 --- apiVersion: v1 kind: Service diff --git a/test/integration/integration/tests/resources/tests/grpc-api.yaml b/test/integration/integration/tests/resources/tests/grpc-api.yaml index 885c44eab..64f59df6e 100644 --- a/test/integration/integration/tests/resources/tests/grpc-api.yaml +++ b/test/integration/integration/tests/resources/tests/grpc-api.yaml @@ -23,7 +23,7 @@ spec: apiName: GRPC API apiType: GRPC apiVersion: v1 - basePath: /dineth.grpc.api.v1 + basePath: /org.apk.v1 isDefaultVersion: true production: - routeRefs: @@ -47,7 +47,7 @@ spec: rules: - matches: - method: - service: student.StudentService + service: student_service.StudentService method: GetStudent backendRefs: - name: grpc-backend-v1 @@ -55,7 +55,7 @@ spec: port: 6565 - matches: - method: - service: student.StudentService + service: student_service.StudentService method: SendStudentStream backendRefs: - name: grpc-backend-v1 @@ -63,7 +63,7 @@ spec: port: 6565 - matches: - method: - service: student.StudentService + service: student_service.StudentService method: GetStudentStream backendRefs: - name: grpc-backend-v1 @@ -71,7 +71,7 @@ spec: port: 6565 - matches: - method: - service: student.StudentService + service: student_service.StudentService method: SendAndGetStudentStream backendRefs: - name: grpc-backend-v1 diff --git a/test/integration/integration/utils/grpc-code/student/student.go b/test/integration/integration/utils/grpc-code/student/student.go index be01a82f5..c2392e7d8 100644 --- a/test/integration/integration/utils/grpc-code/student/student.go +++ b/test/integration/integration/utils/grpc-code/student/student.go @@ -13,16 +13,16 @@ type StudentResponseSatisfier struct{} // IsSatisfactory checks if the given response is satisfactory based on the expected response. func (srs StudentResponseSatisfier) IsSatisfactory(response any, expectedResponse grpcutils.ExpectedResponse) bool { - // Type assert the response to *student.StudentResponse + // Type assert the response to *student_service.StudentResponse resp, respOk := response.(*StudentResponse) if !respOk { - log.Println("Failed to assert response as *student.StudentResponse") + log.Println("Failed to assert response as *student_service.StudentResponse") return false } - // Type assert the expected output to *student.StudentResponse + // Type assert the expected output to *student_service.StudentResponse expectedResp, expOk := expectedResponse.Out.(*StudentResponse) if !expOk { - log.Println("Failed to assert expectedResponse.Out as *student.StudentResponse") + log.Println("Failed to assert expectedResponse.Out as *student_service.StudentResponse") return false } diff --git a/test/integration/integration/utils/grpc-code/student/student.pb.go b/test/integration/integration/utils/grpc-code/student/student.pb.go index 2a1e74b08..0727ef1c4 100644 --- a/test/integration/integration/utils/grpc-code/student/student.pb.go +++ b/test/integration/integration/utils/grpc-code/student/student.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.33.0 -// protoc v3.12.4 +// protoc-gen-go v1.34.2 +// protoc v5.28.0 // source: student.proto package student @@ -126,8 +126,8 @@ var File_student_proto protoreflect.FileDescriptor var file_student_proto_rawDesc = []byte{ 0x0a, 0x0d, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x1a, 0x64, 0x69, 0x6e, 0x65, 0x74, 0x68, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x22, 0x20, 0x0a, 0x0e, 0x53, + 0x1a, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x74, 0x75, 0x64, + 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x20, 0x0a, 0x0e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x37, 0x0a, 0x0f, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, @@ -135,38 +135,38 @@ var file_student_proto_rawDesc = []byte{ 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x61, 0x67, 0x65, 0x32, 0xd6, 0x03, 0x0a, 0x0e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x67, 0x0a, 0x0a, 0x47, 0x65, 0x74, - 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x12, 0x2a, 0x2e, 0x64, 0x69, 0x6e, 0x65, 0x74, 0x68, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x74, 0x75, - 0x64, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x64, 0x69, 0x6e, 0x65, 0x74, 0x68, 0x2e, 0x67, 0x72, 0x70, - 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, + 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x12, 0x2a, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, + 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x76, 0x31, + 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x6f, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, - 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x2a, 0x2e, 0x64, 0x69, 0x6e, 0x65, 0x74, 0x68, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x74, 0x75, 0x64, - 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x64, 0x69, 0x6e, 0x65, 0x74, 0x68, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x2e, + 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x2a, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, + 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x76, 0x31, 0x2e, + 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x70, 0x0a, 0x11, 0x53, 0x65, 0x6e, 0x64, 0x53, 0x74, 0x75, 0x64, 0x65, - 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x2a, 0x2e, 0x64, 0x69, 0x6e, 0x65, 0x74, - 0x68, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x74, - 0x75, 0x64, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x64, 0x69, 0x6e, 0x65, 0x74, 0x68, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, - 0x74, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x2a, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, + 0x70, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x76, + 0x31, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x12, 0x78, 0x0a, 0x17, 0x53, 0x65, 0x6e, 0x64, 0x41, 0x6e, 0x64, 0x47, 0x65, 0x74, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, - 0x12, 0x2a, 0x2e, 0x64, 0x69, 0x6e, 0x65, 0x74, 0x68, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, - 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x64, - 0x69, 0x6e, 0x65, 0x74, 0x68, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x31, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, + 0x12, 0x2a, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x74, + 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, + 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x6f, + 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, + 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, - 0x30, 0x5a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, - 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, - 0x65, 0x73, 0x2f, 0x73, 0x63, 0x68, 0x6f, 0x6f, 0x6c, 0x2f, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, - 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x28, 0x0a, 0x1a, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x74, + 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x01, 0x5a, + 0x08, 0x2f, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -182,19 +182,19 @@ func file_student_proto_rawDescGZIP() []byte { } var file_student_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_student_proto_goTypes = []interface{}{ - (*StudentRequest)(nil), // 0: dineth.grpc.api.v1.student.StudentRequest - (*StudentResponse)(nil), // 1: dineth.grpc.api.v1.student.StudentResponse +var file_student_proto_goTypes = []any{ + (*StudentRequest)(nil), // 0: org.apk.v1.student_service.StudentRequest + (*StudentResponse)(nil), // 1: org.apk.v1.student_service.StudentResponse } var file_student_proto_depIdxs = []int32{ - 0, // 0: dineth.grpc.api.v1.student.StudentService.GetStudent:input_type -> dineth.grpc.api.v1.student.StudentRequest - 0, // 1: dineth.grpc.api.v1.student.StudentService.GetStudentStream:input_type -> dineth.grpc.api.v1.student.StudentRequest - 0, // 2: dineth.grpc.api.v1.student.StudentService.SendStudentStream:input_type -> dineth.grpc.api.v1.student.StudentRequest - 0, // 3: dineth.grpc.api.v1.student.StudentService.SendAndGetStudentStream:input_type -> dineth.grpc.api.v1.student.StudentRequest - 1, // 4: dineth.grpc.api.v1.student.StudentService.GetStudent:output_type -> dineth.grpc.api.v1.student.StudentResponse - 1, // 5: dineth.grpc.api.v1.student.StudentService.GetStudentStream:output_type -> dineth.grpc.api.v1.student.StudentResponse - 1, // 6: dineth.grpc.api.v1.student.StudentService.SendStudentStream:output_type -> dineth.grpc.api.v1.student.StudentResponse - 1, // 7: dineth.grpc.api.v1.student.StudentService.SendAndGetStudentStream:output_type -> dineth.grpc.api.v1.student.StudentResponse + 0, // 0: org.apk.v1.student_service.StudentService.GetStudent:input_type -> org.apk.v1.student_service.StudentRequest + 0, // 1: org.apk.v1.student_service.StudentService.GetStudentStream:input_type -> org.apk.v1.student_service.StudentRequest + 0, // 2: org.apk.v1.student_service.StudentService.SendStudentStream:input_type -> org.apk.v1.student_service.StudentRequest + 0, // 3: org.apk.v1.student_service.StudentService.SendAndGetStudentStream:input_type -> org.apk.v1.student_service.StudentRequest + 1, // 4: org.apk.v1.student_service.StudentService.GetStudent:output_type -> org.apk.v1.student_service.StudentResponse + 1, // 5: org.apk.v1.student_service.StudentService.GetStudentStream:output_type -> org.apk.v1.student_service.StudentResponse + 1, // 6: org.apk.v1.student_service.StudentService.SendStudentStream:output_type -> org.apk.v1.student_service.StudentResponse + 1, // 7: org.apk.v1.student_service.StudentService.SendAndGetStudentStream:output_type -> org.apk.v1.student_service.StudentResponse 4, // [4:8] is the sub-list for method output_type 0, // [0:4] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name @@ -208,7 +208,7 @@ func file_student_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_student_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_student_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*StudentRequest); i { case 0: return &v.state @@ -220,7 +220,7 @@ func file_student_proto_init() { return nil } } - file_student_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_student_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*StudentResponse); i { case 0: return &v.state @@ -251,4 +251,4 @@ func file_student_proto_init() { file_student_proto_rawDesc = nil file_student_proto_goTypes = nil file_student_proto_depIdxs = nil -} \ No newline at end of file +} diff --git a/test/integration/integration/utils/grpc-code/student/student_grpc.pb.go b/test/integration/integration/utils/grpc-code/student/student_grpc.pb.go index 52cad0142..a646d457c 100644 --- a/test/integration/integration/utils/grpc-code/student/student_grpc.pb.go +++ b/test/integration/integration/utils/grpc-code/student/student_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v3.12.4 +// - protoc-gen-go-grpc v1.5.1 +// - protoc v5.28.0 // source: student.proto package student @@ -15,14 +15,14 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( - StudentService_GetStudent_FullMethodName = "/dineth.grpc.api.v1.student.StudentService/GetStudent" - StudentService_GetStudentStream_FullMethodName = "/dineth.grpc.api.v1.student.StudentService/GetStudentStream" - StudentService_SendStudentStream_FullMethodName = "/dineth.grpc.api.v1.student.StudentService/SendStudentStream" - StudentService_SendAndGetStudentStream_FullMethodName = "/dineth.grpc.api.v1.student.StudentService/SendAndGetStudentStream" + StudentService_GetStudent_FullMethodName = "/org.apk.v1.student_service.StudentService/GetStudent" + StudentService_GetStudentStream_FullMethodName = "/org.apk.v1.student_service.StudentService/GetStudentStream" + StudentService_SendStudentStream_FullMethodName = "/org.apk.v1.student_service.StudentService/SendStudentStream" + StudentService_SendAndGetStudentStream_FullMethodName = "/org.apk.v1.student_service.StudentService/SendAndGetStudentStream" ) // StudentServiceClient is the client API for StudentService service. @@ -30,9 +30,9 @@ const ( // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type StudentServiceClient interface { GetStudent(ctx context.Context, in *StudentRequest, opts ...grpc.CallOption) (*StudentResponse, error) - GetStudentStream(ctx context.Context, in *StudentRequest, opts ...grpc.CallOption) (StudentService_GetStudentStreamClient, error) - SendStudentStream(ctx context.Context, opts ...grpc.CallOption) (StudentService_SendStudentStreamClient, error) - SendAndGetStudentStream(ctx context.Context, opts ...grpc.CallOption) (StudentService_SendAndGetStudentStreamClient, error) + GetStudentStream(ctx context.Context, in *StudentRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[StudentResponse], error) + SendStudentStream(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[StudentRequest, StudentResponse], error) + SendAndGetStudentStream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[StudentRequest, StudentResponse], error) } type studentServiceClient struct { @@ -44,20 +44,22 @@ func NewStudentServiceClient(cc grpc.ClientConnInterface) StudentServiceClient { } func (c *studentServiceClient) GetStudent(ctx context.Context, in *StudentRequest, opts ...grpc.CallOption) (*StudentResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(StudentResponse) - err := c.cc.Invoke(ctx, StudentService_GetStudent_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, StudentService_GetStudent_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *studentServiceClient) GetStudentStream(ctx context.Context, in *StudentRequest, opts ...grpc.CallOption) (StudentService_GetStudentStreamClient, error) { - stream, err := c.cc.NewStream(ctx, &StudentService_ServiceDesc.Streams[0], StudentService_GetStudentStream_FullMethodName, opts...) +func (c *studentServiceClient) GetStudentStream(ctx context.Context, in *StudentRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[StudentResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &StudentService_ServiceDesc.Streams[0], StudentService_GetStudentStream_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &studentServiceGetStudentStreamClient{stream} + x := &grpc.GenericClientStream[StudentRequest, StudentResponse]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -67,116 +69,67 @@ func (c *studentServiceClient) GetStudentStream(ctx context.Context, in *Student return x, nil } -type StudentService_GetStudentStreamClient interface { - Recv() (*StudentResponse, error) - grpc.ClientStream -} - -type studentServiceGetStudentStreamClient struct { - grpc.ClientStream -} - -func (x *studentServiceGetStudentStreamClient) Recv() (*StudentResponse, error) { - m := new(StudentResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type StudentService_GetStudentStreamClient = grpc.ServerStreamingClient[StudentResponse] -func (c *studentServiceClient) SendStudentStream(ctx context.Context, opts ...grpc.CallOption) (StudentService_SendStudentStreamClient, error) { - stream, err := c.cc.NewStream(ctx, &StudentService_ServiceDesc.Streams[1], StudentService_SendStudentStream_FullMethodName, opts...) +func (c *studentServiceClient) SendStudentStream(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[StudentRequest, StudentResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &StudentService_ServiceDesc.Streams[1], StudentService_SendStudentStream_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &studentServiceSendStudentStreamClient{stream} + x := &grpc.GenericClientStream[StudentRequest, StudentResponse]{ClientStream: stream} return x, nil } -type StudentService_SendStudentStreamClient interface { - Send(*StudentRequest) error - CloseAndRecv() (*StudentResponse, error) - grpc.ClientStream -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type StudentService_SendStudentStreamClient = grpc.ClientStreamingClient[StudentRequest, StudentResponse] -type studentServiceSendStudentStreamClient struct { - grpc.ClientStream -} - -func (x *studentServiceSendStudentStreamClient) Send(m *StudentRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *studentServiceSendStudentStreamClient) CloseAndRecv() (*StudentResponse, error) { - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - m := new(StudentResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *studentServiceClient) SendAndGetStudentStream(ctx context.Context, opts ...grpc.CallOption) (StudentService_SendAndGetStudentStreamClient, error) { - stream, err := c.cc.NewStream(ctx, &StudentService_ServiceDesc.Streams[2], StudentService_SendAndGetStudentStream_FullMethodName, opts...) +func (c *studentServiceClient) SendAndGetStudentStream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[StudentRequest, StudentResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &StudentService_ServiceDesc.Streams[2], StudentService_SendAndGetStudentStream_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &studentServiceSendAndGetStudentStreamClient{stream} + x := &grpc.GenericClientStream[StudentRequest, StudentResponse]{ClientStream: stream} return x, nil } -type StudentService_SendAndGetStudentStreamClient interface { - Send(*StudentRequest) error - Recv() (*StudentResponse, error) - grpc.ClientStream -} - -type studentServiceSendAndGetStudentStreamClient struct { - grpc.ClientStream -} - -func (x *studentServiceSendAndGetStudentStreamClient) Send(m *StudentRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *studentServiceSendAndGetStudentStreamClient) Recv() (*StudentResponse, error) { - m := new(StudentResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type StudentService_SendAndGetStudentStreamClient = grpc.BidiStreamingClient[StudentRequest, StudentResponse] // StudentServiceServer is the server API for StudentService service. // All implementations must embed UnimplementedStudentServiceServer -// for forward compatibility +// for forward compatibility. type StudentServiceServer interface { GetStudent(context.Context, *StudentRequest) (*StudentResponse, error) - GetStudentStream(*StudentRequest, StudentService_GetStudentStreamServer) error - SendStudentStream(StudentService_SendStudentStreamServer) error - SendAndGetStudentStream(StudentService_SendAndGetStudentStreamServer) error + GetStudentStream(*StudentRequest, grpc.ServerStreamingServer[StudentResponse]) error + SendStudentStream(grpc.ClientStreamingServer[StudentRequest, StudentResponse]) error + SendAndGetStudentStream(grpc.BidiStreamingServer[StudentRequest, StudentResponse]) error mustEmbedUnimplementedStudentServiceServer() } -// UnimplementedStudentServiceServer must be embedded to have forward compatible implementations. -type UnimplementedStudentServiceServer struct { -} +// UnimplementedStudentServiceServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedStudentServiceServer struct{} func (UnimplementedStudentServiceServer) GetStudent(context.Context, *StudentRequest) (*StudentResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetStudent not implemented") } -func (UnimplementedStudentServiceServer) GetStudentStream(*StudentRequest, StudentService_GetStudentStreamServer) error { +func (UnimplementedStudentServiceServer) GetStudentStream(*StudentRequest, grpc.ServerStreamingServer[StudentResponse]) error { return status.Errorf(codes.Unimplemented, "method GetStudentStream not implemented") } -func (UnimplementedStudentServiceServer) SendStudentStream(StudentService_SendStudentStreamServer) error { +func (UnimplementedStudentServiceServer) SendStudentStream(grpc.ClientStreamingServer[StudentRequest, StudentResponse]) error { return status.Errorf(codes.Unimplemented, "method SendStudentStream not implemented") } -func (UnimplementedStudentServiceServer) SendAndGetStudentStream(StudentService_SendAndGetStudentStreamServer) error { +func (UnimplementedStudentServiceServer) SendAndGetStudentStream(grpc.BidiStreamingServer[StudentRequest, StudentResponse]) error { return status.Errorf(codes.Unimplemented, "method SendAndGetStudentStream not implemented") } func (UnimplementedStudentServiceServer) mustEmbedUnimplementedStudentServiceServer() {} +func (UnimplementedStudentServiceServer) testEmbeddedByValue() {} // UnsafeStudentServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to StudentServiceServer will @@ -186,6 +139,13 @@ type UnsafeStudentServiceServer interface { } func RegisterStudentServiceServer(s grpc.ServiceRegistrar, srv StudentServiceServer) { + // If the following call pancis, it indicates UnimplementedStudentServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&StudentService_ServiceDesc, srv) } @@ -212,79 +172,31 @@ func _StudentService_GetStudentStream_Handler(srv interface{}, stream grpc.Serve if err := stream.RecvMsg(m); err != nil { return err } - return srv.(StudentServiceServer).GetStudentStream(m, &studentServiceGetStudentStreamServer{stream}) -} - -type StudentService_GetStudentStreamServer interface { - Send(*StudentResponse) error - grpc.ServerStream + return srv.(StudentServiceServer).GetStudentStream(m, &grpc.GenericServerStream[StudentRequest, StudentResponse]{ServerStream: stream}) } -type studentServiceGetStudentStreamServer struct { - grpc.ServerStream -} - -func (x *studentServiceGetStudentStreamServer) Send(m *StudentResponse) error { - return x.ServerStream.SendMsg(m) -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type StudentService_GetStudentStreamServer = grpc.ServerStreamingServer[StudentResponse] func _StudentService_SendStudentStream_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(StudentServiceServer).SendStudentStream(&studentServiceSendStudentStreamServer{stream}) + return srv.(StudentServiceServer).SendStudentStream(&grpc.GenericServerStream[StudentRequest, StudentResponse]{ServerStream: stream}) } -type StudentService_SendStudentStreamServer interface { - SendAndClose(*StudentResponse) error - Recv() (*StudentRequest, error) - grpc.ServerStream -} - -type studentServiceSendStudentStreamServer struct { - grpc.ServerStream -} - -func (x *studentServiceSendStudentStreamServer) SendAndClose(m *StudentResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *studentServiceSendStudentStreamServer) Recv() (*StudentRequest, error) { - m := new(StudentRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type StudentService_SendStudentStreamServer = grpc.ClientStreamingServer[StudentRequest, StudentResponse] func _StudentService_SendAndGetStudentStream_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(StudentServiceServer).SendAndGetStudentStream(&studentServiceSendAndGetStudentStreamServer{stream}) -} - -type StudentService_SendAndGetStudentStreamServer interface { - Send(*StudentResponse) error - Recv() (*StudentRequest, error) - grpc.ServerStream -} - -type studentServiceSendAndGetStudentStreamServer struct { - grpc.ServerStream + return srv.(StudentServiceServer).SendAndGetStudentStream(&grpc.GenericServerStream[StudentRequest, StudentResponse]{ServerStream: stream}) } -func (x *studentServiceSendAndGetStudentStreamServer) Send(m *StudentResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *studentServiceSendAndGetStudentStreamServer) Recv() (*StudentRequest, error) { - m := new(StudentRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type StudentService_SendAndGetStudentStreamServer = grpc.BidiStreamingServer[StudentRequest, StudentResponse] // StudentService_ServiceDesc is the grpc.ServiceDesc for StudentService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var StudentService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "dineth.grpc.api.v1.student.StudentService", + ServiceName: "org.apk.v1.student_service.StudentService", HandlerType: (*StudentServiceServer)(nil), Methods: []grpc.MethodDesc{ { @@ -311,4 +223,4 @@ var StudentService_ServiceDesc = grpc.ServiceDesc{ }, }, Metadata: "student.proto", -} \ No newline at end of file +} diff --git a/test/integration/integration/utils/grpc-code/student_default_version/student_default_version.pb.go b/test/integration/integration/utils/grpc-code/student_default_version/student_default_version.pb.go index 3437a246f..7871032d8 100644 --- a/test/integration/integration/utils/grpc-code/student_default_version/student_default_version.pb.go +++ b/test/integration/integration/utils/grpc-code/student_default_version/student_default_version.pb.go @@ -1,8 +1,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.33.0 -// protoc v3.12.4 -// source: student_default_version.proto +// protoc-gen-go v1.34.2 +// protoc v5.28.0 +// source: student.proto package student_default_version @@ -31,7 +31,7 @@ type StudentRequest struct { func (x *StudentRequest) Reset() { *x = StudentRequest{} if protoimpl.UnsafeEnabled { - mi := &file_student_default_version_proto_msgTypes[0] + mi := &file_student_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -44,7 +44,7 @@ func (x *StudentRequest) String() string { func (*StudentRequest) ProtoMessage() {} func (x *StudentRequest) ProtoReflect() protoreflect.Message { - mi := &file_student_default_version_proto_msgTypes[0] + mi := &file_student_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -57,7 +57,7 @@ func (x *StudentRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use StudentRequest.ProtoReflect.Descriptor instead. func (*StudentRequest) Descriptor() ([]byte, []int) { - return file_student_default_version_proto_rawDescGZIP(), []int{0} + return file_student_proto_rawDescGZIP(), []int{0} } func (x *StudentRequest) GetId() int32 { @@ -79,7 +79,7 @@ type StudentResponse struct { func (x *StudentResponse) Reset() { *x = StudentResponse{} if protoimpl.UnsafeEnabled { - mi := &file_student_default_version_proto_msgTypes[1] + mi := &file_student_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -92,7 +92,7 @@ func (x *StudentResponse) String() string { func (*StudentResponse) ProtoMessage() {} func (x *StudentResponse) ProtoReflect() protoreflect.Message { - mi := &file_student_default_version_proto_msgTypes[1] + mi := &file_student_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -105,7 +105,7 @@ func (x *StudentResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use StudentResponse.ProtoReflect.Descriptor instead. func (*StudentResponse) Descriptor() ([]byte, []int) { - return file_student_default_version_proto_rawDescGZIP(), []int{1} + return file_student_proto_rawDescGZIP(), []int{1} } func (x *StudentResponse) GetName() string { @@ -122,13 +122,12 @@ func (x *StudentResponse) GetAge() int32 { return 0 } -var File_student_default_version_proto protoreflect.FileDescriptor +var File_student_proto protoreflect.FileDescriptor -var file_student_default_version_proto_rawDesc = []byte{ - 0x0a, 0x1d, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, - 0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x17, 0x64, 0x69, 0x6e, 0x65, 0x74, 0x68, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x22, 0x20, 0x0a, 0x0e, 0x53, 0x74, 0x75, 0x64, +var file_student_proto_rawDesc = []byte{ + 0x0a, 0x0d, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x17, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, + 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x20, 0x0a, 0x0e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x37, 0x0a, 0x0f, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, @@ -136,62 +135,65 @@ var file_student_default_version_proto_rawDesc = []byte{ 0x65, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x61, 0x67, 0x65, 0x32, 0xbe, 0x03, 0x0a, 0x0e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x61, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x53, 0x74, 0x75, - 0x64, 0x65, 0x6e, 0x74, 0x12, 0x27, 0x2e, 0x64, 0x69, 0x6e, 0x65, 0x74, 0x68, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x2e, 0x53, + 0x64, 0x65, 0x6e, 0x74, 0x12, 0x27, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x73, + 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, - 0x64, 0x69, 0x6e, 0x65, 0x74, 0x68, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, + 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x69, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x27, 0x2e, - 0x64, 0x69, 0x6e, 0x65, 0x74, 0x68, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x64, 0x69, 0x6e, 0x65, 0x74, 0x68, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, + 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, + 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x6a, 0x0a, 0x11, 0x53, 0x65, 0x6e, 0x64, 0x53, 0x74, 0x75, 0x64, - 0x65, 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x27, 0x2e, 0x64, 0x69, 0x6e, 0x65, - 0x74, 0x68, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x74, 0x75, 0x64, - 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x64, 0x69, 0x6e, 0x65, 0x74, 0x68, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x75, + 0x65, 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x27, 0x2e, 0x6f, 0x72, 0x67, 0x2e, + 0x61, 0x70, 0x6b, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x73, 0x74, 0x75, + 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x12, 0x72, 0x0a, 0x17, 0x53, 0x65, 0x6e, 0x64, 0x41, 0x6e, 0x64, 0x47, 0x65, 0x74, 0x53, 0x74, - 0x75, 0x64, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x27, 0x2e, 0x64, 0x69, - 0x6e, 0x65, 0x74, 0x68, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x74, - 0x75, 0x64, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x64, 0x69, 0x6e, 0x65, 0x74, 0x68, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x2e, 0x53, + 0x75, 0x64, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x27, 0x2e, 0x6f, 0x72, + 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x73, + 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x28, 0x01, 0x30, 0x01, 0x42, 0x0f, 0x0a, 0x0b, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x78, 0x61, 0x6d, - 0x70, 0x6c, 0x65, 0x50, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x28, 0x01, 0x30, 0x01, 0x42, 0x38, 0x0a, 0x1a, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, + 0x76, 0x31, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x50, 0x01, 0x5a, 0x18, 0x2f, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x64, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_student_default_version_proto_rawDescOnce sync.Once - file_student_default_version_proto_rawDescData = file_student_default_version_proto_rawDesc + file_student_proto_rawDescOnce sync.Once + file_student_proto_rawDescData = file_student_proto_rawDesc ) -func file_student_default_version_proto_rawDescGZIP() []byte { - file_student_default_version_proto_rawDescOnce.Do(func() { - file_student_default_version_proto_rawDescData = protoimpl.X.CompressGZIP(file_student_default_version_proto_rawDescData) +func file_student_proto_rawDescGZIP() []byte { + file_student_proto_rawDescOnce.Do(func() { + file_student_proto_rawDescData = protoimpl.X.CompressGZIP(file_student_proto_rawDescData) }) - return file_student_default_version_proto_rawDescData -} - -var file_student_default_version_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_student_default_version_proto_goTypes = []interface{}{ - (*StudentRequest)(nil), // 0: dineth.grpc.api.student.StudentRequest - (*StudentResponse)(nil), // 1: dineth.grpc.api.student.StudentResponse -} -var file_student_default_version_proto_depIdxs = []int32{ - 0, // 0: dineth.grpc.api.student.StudentService.GetStudent:input_type -> dineth.grpc.api.student.StudentRequest - 0, // 1: dineth.grpc.api.student.StudentService.GetStudentStream:input_type -> dineth.grpc.api.student.StudentRequest - 0, // 2: dineth.grpc.api.student.StudentService.SendStudentStream:input_type -> dineth.grpc.api.student.StudentRequest - 0, // 3: dineth.grpc.api.student.StudentService.SendAndGetStudentStream:input_type -> dineth.grpc.api.student.StudentRequest - 1, // 4: dineth.grpc.api.student.StudentService.GetStudent:output_type -> dineth.grpc.api.student.StudentResponse - 1, // 5: dineth.grpc.api.student.StudentService.GetStudentStream:output_type -> dineth.grpc.api.student.StudentResponse - 1, // 6: dineth.grpc.api.student.StudentService.SendStudentStream:output_type -> dineth.grpc.api.student.StudentResponse - 1, // 7: dineth.grpc.api.student.StudentService.SendAndGetStudentStream:output_type -> dineth.grpc.api.student.StudentResponse + return file_student_proto_rawDescData +} + +var file_student_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_student_proto_goTypes = []any{ + (*StudentRequest)(nil), // 0: org.apk.student_service.StudentRequest + (*StudentResponse)(nil), // 1: org.apk.student_service.StudentResponse +} +var file_student_proto_depIdxs = []int32{ + 0, // 0: org.apk.student_service.StudentService.GetStudent:input_type -> org.apk.student_service.StudentRequest + 0, // 1: org.apk.student_service.StudentService.GetStudentStream:input_type -> org.apk.student_service.StudentRequest + 0, // 2: org.apk.student_service.StudentService.SendStudentStream:input_type -> org.apk.student_service.StudentRequest + 0, // 3: org.apk.student_service.StudentService.SendAndGetStudentStream:input_type -> org.apk.student_service.StudentRequest + 1, // 4: org.apk.student_service.StudentService.GetStudent:output_type -> org.apk.student_service.StudentResponse + 1, // 5: org.apk.student_service.StudentService.GetStudentStream:output_type -> org.apk.student_service.StudentResponse + 1, // 6: org.apk.student_service.StudentService.SendStudentStream:output_type -> org.apk.student_service.StudentResponse + 1, // 7: org.apk.student_service.StudentService.SendAndGetStudentStream:output_type -> org.apk.student_service.StudentResponse 4, // [4:8] is the sub-list for method output_type 0, // [0:4] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name @@ -199,13 +201,13 @@ var file_student_default_version_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for field type_name } -func init() { file_student_default_version_proto_init() } -func file_student_default_version_proto_init() { - if File_student_default_version_proto != nil { +func init() { file_student_proto_init() } +func file_student_proto_init() { + if File_student_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_student_default_version_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_student_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*StudentRequest); i { case 0: return &v.state @@ -217,7 +219,7 @@ func file_student_default_version_proto_init() { return nil } } - file_student_default_version_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_student_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*StudentResponse); i { case 0: return &v.state @@ -234,18 +236,18 @@ func file_student_default_version_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_student_default_version_proto_rawDesc, + RawDescriptor: file_student_proto_rawDesc, NumEnums: 0, NumMessages: 2, NumExtensions: 0, NumServices: 1, }, - GoTypes: file_student_default_version_proto_goTypes, - DependencyIndexes: file_student_default_version_proto_depIdxs, - MessageInfos: file_student_default_version_proto_msgTypes, + GoTypes: file_student_proto_goTypes, + DependencyIndexes: file_student_proto_depIdxs, + MessageInfos: file_student_proto_msgTypes, }.Build() - File_student_default_version_proto = out.File - file_student_default_version_proto_rawDesc = nil - file_student_default_version_proto_goTypes = nil - file_student_default_version_proto_depIdxs = nil -} \ No newline at end of file + File_student_proto = out.File + file_student_proto_rawDesc = nil + file_student_proto_goTypes = nil + file_student_proto_depIdxs = nil +} diff --git a/test/integration/integration/utils/grpc-code/student_default_version/student_default_version_grpc.pb.go b/test/integration/integration/utils/grpc-code/student_default_version/student_default_version_grpc.pb.go index c2ca3f998..6bf5503af 100644 --- a/test/integration/integration/utils/grpc-code/student_default_version/student_default_version_grpc.pb.go +++ b/test/integration/integration/utils/grpc-code/student_default_version/student_default_version_grpc.pb.go @@ -1,8 +1,8 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v3.12.4 -// source: student_default_version.proto +// - protoc-gen-go-grpc v1.5.1 +// - protoc v5.28.0 +// source: student.proto package student_default_version @@ -15,14 +15,14 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( - StudentService_GetStudent_FullMethodName = "/dineth.grpc.api.student.StudentService/GetStudent" - StudentService_GetStudentStream_FullMethodName = "/dineth.grpc.api.student.StudentService/GetStudentStream" - StudentService_SendStudentStream_FullMethodName = "/dineth.grpc.api.student.StudentService/SendStudentStream" - StudentService_SendAndGetStudentStream_FullMethodName = "/dineth.grpc.api.student.StudentService/SendAndGetStudentStream" + StudentService_GetStudent_FullMethodName = "/org.apk.student_service.StudentService/GetStudent" + StudentService_GetStudentStream_FullMethodName = "/org.apk.student_service.StudentService/GetStudentStream" + StudentService_SendStudentStream_FullMethodName = "/org.apk.student_service.StudentService/SendStudentStream" + StudentService_SendAndGetStudentStream_FullMethodName = "/org.apk.student_service.StudentService/SendAndGetStudentStream" ) // StudentServiceClient is the client API for StudentService service. @@ -30,9 +30,9 @@ const ( // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type StudentServiceClient interface { GetStudent(ctx context.Context, in *StudentRequest, opts ...grpc.CallOption) (*StudentResponse, error) - GetStudentStream(ctx context.Context, in *StudentRequest, opts ...grpc.CallOption) (StudentService_GetStudentStreamClient, error) - SendStudentStream(ctx context.Context, opts ...grpc.CallOption) (StudentService_SendStudentStreamClient, error) - SendAndGetStudentStream(ctx context.Context, opts ...grpc.CallOption) (StudentService_SendAndGetStudentStreamClient, error) + GetStudentStream(ctx context.Context, in *StudentRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[StudentResponse], error) + SendStudentStream(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[StudentRequest, StudentResponse], error) + SendAndGetStudentStream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[StudentRequest, StudentResponse], error) } type studentServiceClient struct { @@ -44,20 +44,22 @@ func NewStudentServiceClient(cc grpc.ClientConnInterface) StudentServiceClient { } func (c *studentServiceClient) GetStudent(ctx context.Context, in *StudentRequest, opts ...grpc.CallOption) (*StudentResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(StudentResponse) - err := c.cc.Invoke(ctx, StudentService_GetStudent_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, StudentService_GetStudent_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *studentServiceClient) GetStudentStream(ctx context.Context, in *StudentRequest, opts ...grpc.CallOption) (StudentService_GetStudentStreamClient, error) { - stream, err := c.cc.NewStream(ctx, &StudentService_ServiceDesc.Streams[0], StudentService_GetStudentStream_FullMethodName, opts...) +func (c *studentServiceClient) GetStudentStream(ctx context.Context, in *StudentRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[StudentResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &StudentService_ServiceDesc.Streams[0], StudentService_GetStudentStream_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &studentServiceGetStudentStreamClient{stream} + x := &grpc.GenericClientStream[StudentRequest, StudentResponse]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -67,116 +69,67 @@ func (c *studentServiceClient) GetStudentStream(ctx context.Context, in *Student return x, nil } -type StudentService_GetStudentStreamClient interface { - Recv() (*StudentResponse, error) - grpc.ClientStream -} - -type studentServiceGetStudentStreamClient struct { - grpc.ClientStream -} - -func (x *studentServiceGetStudentStreamClient) Recv() (*StudentResponse, error) { - m := new(StudentResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type StudentService_GetStudentStreamClient = grpc.ServerStreamingClient[StudentResponse] -func (c *studentServiceClient) SendStudentStream(ctx context.Context, opts ...grpc.CallOption) (StudentService_SendStudentStreamClient, error) { - stream, err := c.cc.NewStream(ctx, &StudentService_ServiceDesc.Streams[1], StudentService_SendStudentStream_FullMethodName, opts...) +func (c *studentServiceClient) SendStudentStream(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[StudentRequest, StudentResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &StudentService_ServiceDesc.Streams[1], StudentService_SendStudentStream_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &studentServiceSendStudentStreamClient{stream} + x := &grpc.GenericClientStream[StudentRequest, StudentResponse]{ClientStream: stream} return x, nil } -type StudentService_SendStudentStreamClient interface { - Send(*StudentRequest) error - CloseAndRecv() (*StudentResponse, error) - grpc.ClientStream -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type StudentService_SendStudentStreamClient = grpc.ClientStreamingClient[StudentRequest, StudentResponse] -type studentServiceSendStudentStreamClient struct { - grpc.ClientStream -} - -func (x *studentServiceSendStudentStreamClient) Send(m *StudentRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *studentServiceSendStudentStreamClient) CloseAndRecv() (*StudentResponse, error) { - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - m := new(StudentResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *studentServiceClient) SendAndGetStudentStream(ctx context.Context, opts ...grpc.CallOption) (StudentService_SendAndGetStudentStreamClient, error) { - stream, err := c.cc.NewStream(ctx, &StudentService_ServiceDesc.Streams[2], StudentService_SendAndGetStudentStream_FullMethodName, opts...) +func (c *studentServiceClient) SendAndGetStudentStream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[StudentRequest, StudentResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &StudentService_ServiceDesc.Streams[2], StudentService_SendAndGetStudentStream_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &studentServiceSendAndGetStudentStreamClient{stream} + x := &grpc.GenericClientStream[StudentRequest, StudentResponse]{ClientStream: stream} return x, nil } -type StudentService_SendAndGetStudentStreamClient interface { - Send(*StudentRequest) error - Recv() (*StudentResponse, error) - grpc.ClientStream -} - -type studentServiceSendAndGetStudentStreamClient struct { - grpc.ClientStream -} - -func (x *studentServiceSendAndGetStudentStreamClient) Send(m *StudentRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *studentServiceSendAndGetStudentStreamClient) Recv() (*StudentResponse, error) { - m := new(StudentResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type StudentService_SendAndGetStudentStreamClient = grpc.BidiStreamingClient[StudentRequest, StudentResponse] // StudentServiceServer is the server API for StudentService service. // All implementations must embed UnimplementedStudentServiceServer -// for forward compatibility +// for forward compatibility. type StudentServiceServer interface { GetStudent(context.Context, *StudentRequest) (*StudentResponse, error) - GetStudentStream(*StudentRequest, StudentService_GetStudentStreamServer) error - SendStudentStream(StudentService_SendStudentStreamServer) error - SendAndGetStudentStream(StudentService_SendAndGetStudentStreamServer) error + GetStudentStream(*StudentRequest, grpc.ServerStreamingServer[StudentResponse]) error + SendStudentStream(grpc.ClientStreamingServer[StudentRequest, StudentResponse]) error + SendAndGetStudentStream(grpc.BidiStreamingServer[StudentRequest, StudentResponse]) error mustEmbedUnimplementedStudentServiceServer() } -// UnimplementedStudentServiceServer must be embedded to have forward compatible implementations. -type UnimplementedStudentServiceServer struct { -} +// UnimplementedStudentServiceServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedStudentServiceServer struct{} func (UnimplementedStudentServiceServer) GetStudent(context.Context, *StudentRequest) (*StudentResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetStudent not implemented") } -func (UnimplementedStudentServiceServer) GetStudentStream(*StudentRequest, StudentService_GetStudentStreamServer) error { +func (UnimplementedStudentServiceServer) GetStudentStream(*StudentRequest, grpc.ServerStreamingServer[StudentResponse]) error { return status.Errorf(codes.Unimplemented, "method GetStudentStream not implemented") } -func (UnimplementedStudentServiceServer) SendStudentStream(StudentService_SendStudentStreamServer) error { +func (UnimplementedStudentServiceServer) SendStudentStream(grpc.ClientStreamingServer[StudentRequest, StudentResponse]) error { return status.Errorf(codes.Unimplemented, "method SendStudentStream not implemented") } -func (UnimplementedStudentServiceServer) SendAndGetStudentStream(StudentService_SendAndGetStudentStreamServer) error { +func (UnimplementedStudentServiceServer) SendAndGetStudentStream(grpc.BidiStreamingServer[StudentRequest, StudentResponse]) error { return status.Errorf(codes.Unimplemented, "method SendAndGetStudentStream not implemented") } func (UnimplementedStudentServiceServer) mustEmbedUnimplementedStudentServiceServer() {} +func (UnimplementedStudentServiceServer) testEmbeddedByValue() {} // UnsafeStudentServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to StudentServiceServer will @@ -186,6 +139,13 @@ type UnsafeStudentServiceServer interface { } func RegisterStudentServiceServer(s grpc.ServiceRegistrar, srv StudentServiceServer) { + // If the following call pancis, it indicates UnimplementedStudentServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&StudentService_ServiceDesc, srv) } @@ -212,79 +172,31 @@ func _StudentService_GetStudentStream_Handler(srv interface{}, stream grpc.Serve if err := stream.RecvMsg(m); err != nil { return err } - return srv.(StudentServiceServer).GetStudentStream(m, &studentServiceGetStudentStreamServer{stream}) -} - -type StudentService_GetStudentStreamServer interface { - Send(*StudentResponse) error - grpc.ServerStream + return srv.(StudentServiceServer).GetStudentStream(m, &grpc.GenericServerStream[StudentRequest, StudentResponse]{ServerStream: stream}) } -type studentServiceGetStudentStreamServer struct { - grpc.ServerStream -} - -func (x *studentServiceGetStudentStreamServer) Send(m *StudentResponse) error { - return x.ServerStream.SendMsg(m) -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type StudentService_GetStudentStreamServer = grpc.ServerStreamingServer[StudentResponse] func _StudentService_SendStudentStream_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(StudentServiceServer).SendStudentStream(&studentServiceSendStudentStreamServer{stream}) + return srv.(StudentServiceServer).SendStudentStream(&grpc.GenericServerStream[StudentRequest, StudentResponse]{ServerStream: stream}) } -type StudentService_SendStudentStreamServer interface { - SendAndClose(*StudentResponse) error - Recv() (*StudentRequest, error) - grpc.ServerStream -} - -type studentServiceSendStudentStreamServer struct { - grpc.ServerStream -} - -func (x *studentServiceSendStudentStreamServer) SendAndClose(m *StudentResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *studentServiceSendStudentStreamServer) Recv() (*StudentRequest, error) { - m := new(StudentRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type StudentService_SendStudentStreamServer = grpc.ClientStreamingServer[StudentRequest, StudentResponse] func _StudentService_SendAndGetStudentStream_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(StudentServiceServer).SendAndGetStudentStream(&studentServiceSendAndGetStudentStreamServer{stream}) -} - -type StudentService_SendAndGetStudentStreamServer interface { - Send(*StudentResponse) error - Recv() (*StudentRequest, error) - grpc.ServerStream -} - -type studentServiceSendAndGetStudentStreamServer struct { - grpc.ServerStream + return srv.(StudentServiceServer).SendAndGetStudentStream(&grpc.GenericServerStream[StudentRequest, StudentResponse]{ServerStream: stream}) } -func (x *studentServiceSendAndGetStudentStreamServer) Send(m *StudentResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *studentServiceSendAndGetStudentStreamServer) Recv() (*StudentRequest, error) { - m := new(StudentRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type StudentService_SendAndGetStudentStreamServer = grpc.BidiStreamingServer[StudentRequest, StudentResponse] // StudentService_ServiceDesc is the grpc.ServiceDesc for StudentService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var StudentService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "dineth.grpc.api.student.StudentService", + ServiceName: "org.apk.student_service.StudentService", HandlerType: (*StudentServiceServer)(nil), Methods: []grpc.MethodDesc{ { @@ -310,5 +222,5 @@ var StudentService_ServiceDesc = grpc.ServiceDesc{ ClientStreams: true, }, }, - Metadata: "student_default_version.proto", -} \ No newline at end of file + Metadata: "student.proto", +}