From 5047334ebfd07f267467ee98eda427cc77567fba Mon Sep 17 00:00:00 2001 From: Andreas Zitzelsberger Date: Tue, 2 Aug 2022 15:45:58 +0200 Subject: [PATCH 01/12] Local run target added to Makefile --- grpc-beer-service/Makefile | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/grpc-beer-service/Makefile b/grpc-beer-service/Makefile index 5df82cd..e9f748e 100644 --- a/grpc-beer-service/Makefile +++ b/grpc-beer-service/Makefile @@ -2,12 +2,21 @@ NAME = grpc-beer-service default: build +.PHONY: run +run: + HOST=127.0.0.1 PORT=9090 ./grpc-beer-service + +.PHONY: build image: @docker build -t lreimer/$(NAME) . -build: +.PHONY: build +build: grpc-beer-service + +grpc-beer-service: @buf generate - @go build + @go build +.PHONY: build clean: @rm -f $(NAME) \ No newline at end of file From 9587a75a55b828cf11d142ea2314683f03de6725 Mon Sep 17 00:00:00 2001 From: Andreas Zitzelsberger Date: Tue, 2 Aug 2022 16:02:52 +0200 Subject: [PATCH 02/12] Java, Quarkus, Gradle updated - Java 17 - Quarkus 2.11.1 - Gradle 7.5 --- micronaut-beer-grpc/build.gradle | 4 ++-- micronaut-beer-grpc/gradle/wrapper/gradle-wrapper.properties | 2 +- micronaut-beer-rest/build.gradle | 4 ++-- micronaut-beer-rest/gradle/wrapper/gradle-wrapper.properties | 2 +- quarkus-beer-grpc/build.gradle | 4 ++-- quarkus-beer-grpc/gradle.properties | 4 ++-- .../src/main/java/hands/on/grpc/HelloResource.java | 3 ++- quarkus-beer-rest/build.gradle | 4 ++-- quarkus-beer-rest/gradle.properties | 4 ++-- 9 files changed, 16 insertions(+), 15 deletions(-) diff --git a/micronaut-beer-grpc/build.gradle b/micronaut-beer-grpc/build.gradle index 0e2b9b9..153aa3c 100644 --- a/micronaut-beer-grpc/build.gradle +++ b/micronaut-beer-grpc/build.gradle @@ -32,8 +32,8 @@ application { mainClass.set("hands.on.grpc.Application") } java { - sourceCompatibility = JavaVersion.toVersion("11") - targetCompatibility = JavaVersion.toVersion("11") + sourceCompatibility = VERSION_17 + targetCompatibility = VERSION_17 } tasks { jib { diff --git a/micronaut-beer-grpc/gradle/wrapper/gradle-wrapper.properties b/micronaut-beer-grpc/gradle/wrapper/gradle-wrapper.properties index aa991fc..8049c68 100644 --- a/micronaut-beer-grpc/gradle/wrapper/gradle-wrapper.properties +++ b/micronaut-beer-grpc/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/micronaut-beer-rest/build.gradle b/micronaut-beer-rest/build.gradle index 0954e0b..f7c55ef 100644 --- a/micronaut-beer-rest/build.gradle +++ b/micronaut-beer-rest/build.gradle @@ -31,8 +31,8 @@ application { mainClass.set("hands.on.grpc.Application") } java { - sourceCompatibility = JavaVersion.toVersion("11") - targetCompatibility = JavaVersion.toVersion("11") + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } tasks { diff --git a/micronaut-beer-rest/gradle/wrapper/gradle-wrapper.properties b/micronaut-beer-rest/gradle/wrapper/gradle-wrapper.properties index aa991fc..8049c68 100644 --- a/micronaut-beer-rest/gradle/wrapper/gradle-wrapper.properties +++ b/micronaut-beer-rest/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/quarkus-beer-grpc/build.gradle b/quarkus-beer-grpc/build.gradle index 4d7f9f6..5eed150 100644 --- a/quarkus-beer-grpc/build.gradle +++ b/quarkus-beer-grpc/build.gradle @@ -23,8 +23,8 @@ group 'hands.on.grpc' version '1.0.0-SNAPSHOT' java { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } compileJava { diff --git a/quarkus-beer-grpc/gradle.properties b/quarkus-beer-grpc/gradle.properties index d51f8cc..cea8720 100644 --- a/quarkus-beer-grpc/gradle.properties +++ b/quarkus-beer-grpc/gradle.properties @@ -1,6 +1,6 @@ #Gradle properties quarkusPluginId=io.quarkus -quarkusPluginVersion=2.7.4.Final +quarkusPluginVersion=2.11.1.Final quarkusPlatformGroupId=io.quarkus.platform quarkusPlatformArtifactId=quarkus-bom -quarkusPlatformVersion=2.7.4.Final \ No newline at end of file +quarkusPlatformVersion=2.11.1.Final \ No newline at end of file diff --git a/quarkus-beer-grpc/src/main/java/hands/on/grpc/HelloResource.java b/quarkus-beer-grpc/src/main/java/hands/on/grpc/HelloResource.java index 4cbcaf3..ea3cbc4 100644 --- a/quarkus-beer-grpc/src/main/java/hands/on/grpc/HelloResource.java +++ b/quarkus-beer-grpc/src/main/java/hands/on/grpc/HelloResource.java @@ -11,7 +11,8 @@ @Path("/hello") public class HelloResource { - @GrpcClient("greeter") + //@GrpcClient("greeter") + @GrpcClient HelloGrpcGrpc.HelloGrpcBlockingStub stub; @GET diff --git a/quarkus-beer-rest/build.gradle b/quarkus-beer-rest/build.gradle index 347aa6c..40f55df 100644 --- a/quarkus-beer-rest/build.gradle +++ b/quarkus-beer-rest/build.gradle @@ -30,8 +30,8 @@ group 'hands.on.grpc' version '1.0.0-SNAPSHOT' java { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } compileJava { diff --git a/quarkus-beer-rest/gradle.properties b/quarkus-beer-rest/gradle.properties index d51f8cc..cea8720 100644 --- a/quarkus-beer-rest/gradle.properties +++ b/quarkus-beer-rest/gradle.properties @@ -1,6 +1,6 @@ #Gradle properties quarkusPluginId=io.quarkus -quarkusPluginVersion=2.7.4.Final +quarkusPluginVersion=2.11.1.Final quarkusPlatformGroupId=io.quarkus.platform quarkusPlatformArtifactId=quarkus-bom -quarkusPlatformVersion=2.7.4.Final \ No newline at end of file +quarkusPlatformVersion=2.11.1.Final \ No newline at end of file From d7a129bbdaccc2c8d3ffb87a4493b3dc3d9f630e Mon Sep 17 00:00:00 2001 From: Andreas Zitzelsberger Date: Tue, 9 Aug 2022 09:57:00 +0200 Subject: [PATCH 03/12] Micronaut build.gradle fixed --- micronaut-beer-grpc/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/micronaut-beer-grpc/build.gradle b/micronaut-beer-grpc/build.gradle index 153aa3c..29a4c48 100644 --- a/micronaut-beer-grpc/build.gradle +++ b/micronaut-beer-grpc/build.gradle @@ -32,8 +32,8 @@ application { mainClass.set("hands.on.grpc.Application") } java { - sourceCompatibility = VERSION_17 - targetCompatibility = VERSION_17 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } tasks { jib { From d7f85886e8ff0950b523b851c4c4484777556889 Mon Sep 17 00:00:00 2001 From: Andreas Zitzelsberger Date: Tue, 9 Aug 2022 10:08:56 +0200 Subject: [PATCH 04/12] lreimer github references changed to qaware --- Tiltfile | 16 +++++++------- grpc-beer-client/Makefile | 2 +- grpc-beer-client/buf.yaml | 2 +- grpc-beer-client/go.mod | 2 +- grpc-beer-client/k8s/cronjob.yaml | 2 +- grpc-beer-client/main.go | 2 +- grpc-beer-client/proto/beer.proto | 2 +- grpc-beer-envoy/Makefile | 2 +- grpc-beer-envoy/k8s/deployment.yaml | 2 +- grpc-beer-gateway/Makefile | 2 +- grpc-beer-gateway/buf.yaml | 2 +- grpc-beer-gateway/go.mod | 2 +- grpc-beer-gateway/k8s/deployment.yaml | 2 +- grpc-beer-gateway/main.go | 2 +- grpc-beer-gateway/openapiv2/beer.swagger.json | 4 ++-- grpc-beer-gateway/proto/beer.proto | 6 ++--- grpc-beer-javascript/buf.yaml | 2 +- grpc-beer-javascript/package.json | 6 ++--- grpc-beer-javascript/proto/beer.proto | 2 +- grpc-beer-nginx/k8s/deployment.yaml | 2 +- grpc-beer-service/Makefile | 2 +- grpc-beer-service/beer.go | 2 +- grpc-beer-service/buf.yaml | 2 +- grpc-beer-service/go.mod | 2 +- grpc-beer-service/k8s/deployment.yaml | 2 +- grpc-beer-service/main.go | 2 +- grpc-beer-service/proto/beer.proto | 2 +- grpc-beer-service/server.go | 2 +- micronaut-beer-grpc/build.gradle | 2 +- micronaut-beer-grpc/k8s/deployment.yaml | 2 +- micronaut-beer-rest/build.gradle | 2 +- micronaut-beer-rest/k8s/deployment.yaml | 2 +- quarkus-beer-grpc/k8s/deployment.yaml | 2 +- quarkus-beer-rest/k8s/deployment.yaml | 2 +- rest-beer-golang/Makefile | 2 +- rest-beer-golang/go.mod | 2 +- rest-beer-golang/k8s/deployment.yaml | 2 +- rest-beer-service/Makefile | 2 +- rest-beer-service/buf.yaml | 2 +- rest-beer-service/go.mod | 2 +- rest-beer-service/k8s/deployment.yaml | 2 +- rest-beer-service/main.go | 2 +- rest-beer-service/proto/beer.proto | 2 +- skaffold.yaml | 22 +++++++++---------- 44 files changed, 66 insertions(+), 66 deletions(-) diff --git a/Tiltfile b/Tiltfile index 03f7ff9..465723a 100644 --- a/Tiltfile +++ b/Tiltfile @@ -1,11 +1,11 @@ # -*- mode: Python -*- -update_settings(suppress_unused_image_warnings=["lreimer/micronaut-beer-grpc", "lreimer/quarkus-beer-grpc"]) +update_settings(suppress_unused_image_warnings=["qaware/micronaut-beer-grpc", "qaware/quarkus-beer-grpc"]) # for the Quarkus beer services # local_resource('quarkus-beer-grpc-build', './gradlew assemble', dir='quarkus-beer-grpc', # deps=['./quarkus-beer-grpc/build.gradle', './quarkus-beer-grpc/src/'], labels=['Quarkus']) -# docker_build('lreimer/quarkus-beer-grpc', './quarkus-beer-grpc/', +# docker_build('qaware/quarkus-beer-grpc', './quarkus-beer-grpc/', # dockerfile='quarkus-beer-grpc/src/main/docker/Dockerfile.jvm', only=['./build/']) # k8s_yaml(['quarkus-beer-grpc/k8s/deployment.yaml', 'quarkus-beer-grpc/k8s/service.yaml']) @@ -14,35 +14,35 @@ update_settings(suppress_unused_image_warnings=["lreimer/micronaut-beer-grpc", " # local_resource('quarkus-beer-rest-build', './gradlew assemble', dir='quarkus-beer-rest', # deps=['./quarkus-beer-rest/build.gradle', './quarkus-beer-rest/src/'], labels=['Quarkus']) -# docker_build('lreimer/quarkus-beer-rest', './quarkus-beer-rest/', +# docker_build('qaware/quarkus-beer-rest', './quarkus-beer-rest/', # dockerfile='quarkus-beer-rest/src/main/docker/Dockerfile.jvm', only=['./build/']) # k8s_yaml(['quarkus-beer-rest/k8s/deployment.yaml', 'quarkus-beer-rest/k8s/service.yaml']) # k8s_resource(workload='rest-beer-service', port_forwards=[port_forward(18080, 8080, 'REST API')], labels=['Quarkus']) # for the Micronaut beer service -custom_build('lreimer/micronaut-beer-grpc', 'cd micronaut-beer-grpc && ./gradlew jibDockerBuild --image $EXPECTED_REF', +custom_build('qaware/micronaut-beer-grpc', 'cd micronaut-beer-grpc && ./gradlew jibDockerBuild --image $EXPECTED_REF', ['./micronaut-beer-grpc/build.gradle', './micronaut-beer-grpc/src/']) k8s_yaml(['micronaut-beer-grpc/k8s/deployment.yaml', 'micronaut-beer-grpc/k8s/service.yaml']) k8s_resource(workload='grpc-beer-service', port_forwards=[port_forward(19090, 9090, 'gRPC API')], labels=['Micronaut']) -custom_build('lreimer/micronaut-beer-rest', 'cd micronaut-beer-rest && ./gradlew jibDockerBuild --image $EXPECTED_REF', +custom_build('qaware/micronaut-beer-rest', 'cd micronaut-beer-rest && ./gradlew jibDockerBuild --image $EXPECTED_REF', ['./micronaut-beer-rest/build.gradle', './micronaut-beer-rest/src/']) k8s_yaml(['micronaut-beer-rest/k8s/deployment.yaml', 'micronaut-beer-rest/k8s/service.yaml']) k8s_resource(workload='rest-beer-service', port_forwards=[port_forward(18080, 8080, 'REST API')], labels=['Micronaut']) # the gRPC beer Gateway -docker_build('lreimer/grpc-beer-gateway', './grpc-beer-gateway/', dockerfile='grpc-beer-gateway/Dockerfile') +docker_build('qaware/grpc-beer-gateway', './grpc-beer-gateway/', dockerfile='grpc-beer-gateway/Dockerfile') k8s_yaml(['grpc-beer-gateway/k8s/deployment.yaml', 'grpc-beer-gateway/k8s/service.yaml']) k8s_resource(workload='grpc-beer-gateway', port_forwards=[port_forward(18090, 8090, 'REST API')], labels=['gRPC']) # the gRPC beer Envoy -docker_build('lreimer/grpc-beer-envoy', './grpc-beer-envoy/', dockerfile='grpc-beer-envoy/Dockerfile') +docker_build('qaware/grpc-beer-envoy', './grpc-beer-envoy/', dockerfile='grpc-beer-envoy/Dockerfile') k8s_yaml(['grpc-beer-envoy/k8s/deployment.yaml', 'grpc-beer-envoy/k8s/service.yaml']) k8s_resource(workload='grpc-beer-envoy', port_forwards=[port_forward(18091, 8091, 'gRPC Web')], labels=['gRPC']) # the gRPC beer Nginx -docker_build('lreimer/grpc-beer-nginx', './grpc-beer-nginx/', dockerfile='grpc-beer-nginx/Dockerfile') +docker_build('qaware/grpc-beer-nginx', './grpc-beer-nginx/', dockerfile='grpc-beer-nginx/Dockerfile') k8s_yaml(['grpc-beer-nginx/k8s/deployment.yaml', 'grpc-beer-nginx/k8s/service.yaml']) k8s_resource(workload='grpc-beer-nginx', port_forwards=[port_forward(18888, 8888, 'gRPC Proxy')], labels=['gRPC']) diff --git a/grpc-beer-client/Makefile b/grpc-beer-client/Makefile index 6739e44..d315e68 100644 --- a/grpc-beer-client/Makefile +++ b/grpc-beer-client/Makefile @@ -3,7 +3,7 @@ NAME = grpc-beer-client default: build image: - @docker build -t lreimer/$(NAME) . + @docker build -t qaware/$(NAME) . build: @buf generate diff --git a/grpc-beer-client/buf.yaml b/grpc-beer-client/buf.yaml index c4d9275..191f6e8 100644 --- a/grpc-beer-client/buf.yaml +++ b/grpc-beer-client/buf.yaml @@ -1,5 +1,5 @@ version: v1beta1 -name: github.com/lreimer/from-rest-to-grpc +name: github.com/qaware/from-rest-to-grpc deps: - buf.build/beta/googleapis build: diff --git a/grpc-beer-client/go.mod b/grpc-beer-client/go.mod index ea7a05e..582e518 100644 --- a/grpc-beer-client/go.mod +++ b/grpc-beer-client/go.mod @@ -1,4 +1,4 @@ -module github.com/lreimer/from-rest-to-grpc/grpc-beer-client +module github.com/qaware/from-rest-to-grpc/grpc-beer-client go 1.17 diff --git a/grpc-beer-client/k8s/cronjob.yaml b/grpc-beer-client/k8s/cronjob.yaml index c4261fd..2ca73ac 100644 --- a/grpc-beer-client/k8s/cronjob.yaml +++ b/grpc-beer-client/k8s/cronjob.yaml @@ -10,7 +10,7 @@ spec: spec: containers: - name: grpc-beer-client - image: lreimer/grpc-beer-client + image: qaware/grpc-beer-client resources: requests: memory: "64Mi" diff --git a/grpc-beer-client/main.go b/grpc-beer-client/main.go index 13a4c0f..7a12243 100644 --- a/grpc-beer-client/main.go +++ b/grpc-beer-client/main.go @@ -6,7 +6,7 @@ import ( "os" "time" - pb "github.com/lreimer/from-rest-to-grpc/grpc-beer-client/proto" + pb "github.com/qaware/from-rest-to-grpc/grpc-beer-client/proto" "google.golang.org/grpc" "google.golang.org/protobuf/types/known/emptypb" ) diff --git a/grpc-beer-client/proto/beer.proto b/grpc-beer-client/proto/beer.proto index 136e269..e3d55f6 100644 --- a/grpc-beer-client/proto/beer.proto +++ b/grpc-beer-client/proto/beer.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -option go_package = "github.com/lreimer/from-rest-to-grpc/grpc-beer-client/proto"; +option go_package = "github.com/qaware/from-rest-to-grpc/grpc-beer-client/proto"; import "google/protobuf/empty.proto"; package beer; diff --git a/grpc-beer-envoy/Makefile b/grpc-beer-envoy/Makefile index d9e7cb4..cc23df1 100644 --- a/grpc-beer-envoy/Makefile +++ b/grpc-beer-envoy/Makefile @@ -3,4 +3,4 @@ NAME = grpc-beer-envoy default: image image: - @docker build -t lreimer/$(NAME) . + @docker build -t qaware/$(NAME) . diff --git a/grpc-beer-envoy/k8s/deployment.yaml b/grpc-beer-envoy/k8s/deployment.yaml index 83f8e13..b3a7276 100644 --- a/grpc-beer-envoy/k8s/deployment.yaml +++ b/grpc-beer-envoy/k8s/deployment.yaml @@ -14,7 +14,7 @@ spec: spec: containers: - name: grpc-beer-envoy - image: lreimer/grpc-beer-envoy + image: qaware/grpc-beer-envoy resources: requests: memory: "64Mi" diff --git a/grpc-beer-gateway/Makefile b/grpc-beer-gateway/Makefile index d110227..405ffed 100644 --- a/grpc-beer-gateway/Makefile +++ b/grpc-beer-gateway/Makefile @@ -3,7 +3,7 @@ NAME = grpc-beer-gateway default: build image: - @docker build -t lreimer/$(NAME) . + @docker build -t qaware/$(NAME) . build: @buf generate diff --git a/grpc-beer-gateway/buf.yaml b/grpc-beer-gateway/buf.yaml index fd88cee..ba2e0d7 100644 --- a/grpc-beer-gateway/buf.yaml +++ b/grpc-beer-gateway/buf.yaml @@ -1,5 +1,5 @@ version: v1beta1 -name: github.com/lreimer/from-rest-to-grpc +name: github.com/qaware/from-rest-to-grpc deps: - buf.build/beta/googleapis - buf.build/grpc-ecosystem/grpc-gateway diff --git a/grpc-beer-gateway/go.mod b/grpc-beer-gateway/go.mod index 4d5c1e7..2fa216d 100644 --- a/grpc-beer-gateway/go.mod +++ b/grpc-beer-gateway/go.mod @@ -1,4 +1,4 @@ -module github.com/lreimer/from-rest-to-grpc/grpc-beer-gateway +module github.com/qaware/from-rest-to-grpc/grpc-beer-gateway go 1.17 diff --git a/grpc-beer-gateway/k8s/deployment.yaml b/grpc-beer-gateway/k8s/deployment.yaml index 8099e2d..f4b28e4 100644 --- a/grpc-beer-gateway/k8s/deployment.yaml +++ b/grpc-beer-gateway/k8s/deployment.yaml @@ -14,7 +14,7 @@ spec: spec: containers: - name: grpc-beer-gateway - image: lreimer/grpc-beer-gateway + image: qaware/grpc-beer-gateway resources: requests: memory: "64Mi" diff --git a/grpc-beer-gateway/main.go b/grpc-beer-gateway/main.go index a4c19ce..5c55d83 100644 --- a/grpc-beer-gateway/main.go +++ b/grpc-beer-gateway/main.go @@ -9,7 +9,7 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "google.golang.org/grpc" - gw "github.com/lreimer/from-rest-to-grpc/grpc-beer-gateway/proto" + gw "github.com/qaware/from-rest-to-grpc/grpc-beer-gateway/proto" ) func main() { diff --git a/grpc-beer-gateway/openapiv2/beer.swagger.json b/grpc-beer-gateway/openapiv2/beer.swagger.json index a494c99..279a8ac 100644 --- a/grpc-beer-gateway/openapiv2/beer.swagger.json +++ b/grpc-beer-gateway/openapiv2/beer.swagger.json @@ -10,7 +10,7 @@ }, "license": { "name": "MIT", - "url": "https://github.com/lreimer/from-rest-to-grpc/blob/master/LICENSE" + "url": "https://github.com/qaware/from-rest-to-grpc/blob/master/LICENSE" } }, "tags": [ @@ -275,6 +275,6 @@ }, "externalDocs": { "description": "Beer Service gRPC Gateway", - "url": "https://github.com/lreimer/from-rest-to-grpc/grpc-beer-gateway" + "url": "https://github.com/qaware/from-rest-to-grpc/grpc-beer-gateway" } } diff --git a/grpc-beer-gateway/proto/beer.proto b/grpc-beer-gateway/proto/beer.proto index c625fd0..5904816 100644 --- a/grpc-beer-gateway/proto/beer.proto +++ b/grpc-beer-gateway/proto/beer.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -option go_package = "github.com/lreimer/from-rest-to-grpc/grpc-beer-gateway/proto"; +option go_package = "github.com/qaware/from-rest-to-grpc/grpc-beer-gateway/proto"; import "google/protobuf/empty.proto"; import "google/api/annotations.proto"; @@ -55,11 +55,11 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { }; license: { name: "MIT"; - url: "https://github.com/lreimer/from-rest-to-grpc/blob/master/LICENSE"; + url: "https://github.com/qaware/from-rest-to-grpc/blob/master/LICENSE"; }; }; external_docs: { - url: "https://github.com/lreimer/from-rest-to-grpc/grpc-beer-gateway"; + url: "https://github.com/qaware/from-rest-to-grpc/grpc-beer-gateway"; description: "Beer Service gRPC Gateway"; } schemes: HTTP; diff --git a/grpc-beer-javascript/buf.yaml b/grpc-beer-javascript/buf.yaml index c4d9275..191f6e8 100644 --- a/grpc-beer-javascript/buf.yaml +++ b/grpc-beer-javascript/buf.yaml @@ -1,5 +1,5 @@ version: v1beta1 -name: github.com/lreimer/from-rest-to-grpc +name: github.com/qaware/from-rest-to-grpc deps: - buf.build/beta/googleapis build: diff --git a/grpc-beer-javascript/package.json b/grpc-beer-javascript/package.json index 9883be0..e71c8ae 100644 --- a/grpc-beer-javascript/package.json +++ b/grpc-beer-javascript/package.json @@ -8,7 +8,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/lreimer/from-rest-to-grpc.git" + "url": "git+https://github.com/qaware/from-rest-to-grpc.git" }, "keywords": [ "grpc-web" @@ -16,9 +16,9 @@ "author": "M.-Leander Reimer", "license": "MIT", "bugs": { - "url": "https://github.com/lreimer/from-rest-to-grpc/issues" + "url": "https://github.com/qaware/from-rest-to-grpc/issues" }, - "homepage": "https://github.com/lreimer/from-rest-to-grpc", + "homepage": "https://github.com/qaware/from-rest-to-grpc", "dependencies": { "google-protobuf": "^3.20.1", "grpc-web": "^1.3.0" diff --git a/grpc-beer-javascript/proto/beer.proto b/grpc-beer-javascript/proto/beer.proto index 9234f8f..3d83030 100644 --- a/grpc-beer-javascript/proto/beer.proto +++ b/grpc-beer-javascript/proto/beer.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -option go_package = "github.com/lreimer/from-rest-to-grpc/grpc-beer-service/proto"; +option go_package = "github.com/qaware/from-rest-to-grpc/grpc-beer-service/proto"; import "google/protobuf/empty.proto"; package beer; diff --git a/grpc-beer-nginx/k8s/deployment.yaml b/grpc-beer-nginx/k8s/deployment.yaml index 70e4946..1482cab 100644 --- a/grpc-beer-nginx/k8s/deployment.yaml +++ b/grpc-beer-nginx/k8s/deployment.yaml @@ -14,7 +14,7 @@ spec: spec: containers: - name: grpc-beer-nginx - image: lreimer/grpc-beer-nginx + image: qaware/grpc-beer-nginx resources: requests: memory: "32Mi" diff --git a/grpc-beer-service/Makefile b/grpc-beer-service/Makefile index e9f748e..023dda3 100644 --- a/grpc-beer-service/Makefile +++ b/grpc-beer-service/Makefile @@ -8,7 +8,7 @@ run: .PHONY: build image: - @docker build -t lreimer/$(NAME) . + @docker build -t qaware/$(NAME) . .PHONY: build build: grpc-beer-service diff --git a/grpc-beer-service/beer.go b/grpc-beer-service/beer.go index 46333ab..0841452 100644 --- a/grpc-beer-service/beer.go +++ b/grpc-beer-service/beer.go @@ -1,7 +1,7 @@ package main import ( - pb "github.com/lreimer/from-rest-to-grpc/grpc-beer-service/proto" + pb "github.com/qaware/from-rest-to-grpc/grpc-beer-service/proto" ) var beers = map[string]*pb.Beer{ diff --git a/grpc-beer-service/buf.yaml b/grpc-beer-service/buf.yaml index c4d9275..191f6e8 100644 --- a/grpc-beer-service/buf.yaml +++ b/grpc-beer-service/buf.yaml @@ -1,5 +1,5 @@ version: v1beta1 -name: github.com/lreimer/from-rest-to-grpc +name: github.com/qaware/from-rest-to-grpc deps: - buf.build/beta/googleapis build: diff --git a/grpc-beer-service/go.mod b/grpc-beer-service/go.mod index 0e0861b..7ff3c5b 100644 --- a/grpc-beer-service/go.mod +++ b/grpc-beer-service/go.mod @@ -1,4 +1,4 @@ -module github.com/lreimer/from-rest-to-grpc/grpc-beer-service +module github.com/qaware/from-rest-to-grpc/grpc-beer-service go 1.17 diff --git a/grpc-beer-service/k8s/deployment.yaml b/grpc-beer-service/k8s/deployment.yaml index 8ef17d0..ab2f7d3 100644 --- a/grpc-beer-service/k8s/deployment.yaml +++ b/grpc-beer-service/k8s/deployment.yaml @@ -14,7 +14,7 @@ spec: spec: containers: - name: grpc-beer-service - image: lreimer/grpc-beer-service + image: qaware/grpc-beer-service resources: requests: memory: "64Mi" diff --git a/grpc-beer-service/main.go b/grpc-beer-service/main.go index 5652c8f..b3fba2c 100644 --- a/grpc-beer-service/main.go +++ b/grpc-beer-service/main.go @@ -5,7 +5,7 @@ import ( "net" "os" - pb "github.com/lreimer/from-rest-to-grpc/grpc-beer-service/proto" + pb "github.com/qaware/from-rest-to-grpc/grpc-beer-service/proto" "google.golang.org/grpc" ) diff --git a/grpc-beer-service/proto/beer.proto b/grpc-beer-service/proto/beer.proto index 9234f8f..3d83030 100644 --- a/grpc-beer-service/proto/beer.proto +++ b/grpc-beer-service/proto/beer.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -option go_package = "github.com/lreimer/from-rest-to-grpc/grpc-beer-service/proto"; +option go_package = "github.com/qaware/from-rest-to-grpc/grpc-beer-service/proto"; import "google/protobuf/empty.proto"; package beer; diff --git a/grpc-beer-service/server.go b/grpc-beer-service/server.go index fc17b1e..cff0e07 100644 --- a/grpc-beer-service/server.go +++ b/grpc-beer-service/server.go @@ -4,7 +4,7 @@ import ( "context" "log" - pb "github.com/lreimer/from-rest-to-grpc/grpc-beer-service/proto" + pb "github.com/qaware/from-rest-to-grpc/grpc-beer-service/proto" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/types/known/emptypb" diff --git a/micronaut-beer-grpc/build.gradle b/micronaut-beer-grpc/build.gradle index 29a4c48..e6fad5a 100644 --- a/micronaut-beer-grpc/build.gradle +++ b/micronaut-beer-grpc/build.gradle @@ -38,7 +38,7 @@ java { tasks { jib { to { - image = "lreimer/micronaut-beer-grpc" + image = "qaware/micronaut-beer-grpc" } } } diff --git a/micronaut-beer-grpc/k8s/deployment.yaml b/micronaut-beer-grpc/k8s/deployment.yaml index 0444134..0a7407a 100644 --- a/micronaut-beer-grpc/k8s/deployment.yaml +++ b/micronaut-beer-grpc/k8s/deployment.yaml @@ -14,7 +14,7 @@ spec: spec: containers: - name: grpc-beer-service - image: lreimer/micronaut-beer-grpc + image: qaware/micronaut-beer-grpc resources: requests: memory: "128Mi" diff --git a/micronaut-beer-rest/build.gradle b/micronaut-beer-rest/build.gradle index f7c55ef..7da3749 100644 --- a/micronaut-beer-rest/build.gradle +++ b/micronaut-beer-rest/build.gradle @@ -38,7 +38,7 @@ java { tasks { jib { to { - image = "lreimer/micronaut-beer-rest" + image = "qaware/micronaut-beer-rest" } } } diff --git a/micronaut-beer-rest/k8s/deployment.yaml b/micronaut-beer-rest/k8s/deployment.yaml index d673c7f..974a93f 100644 --- a/micronaut-beer-rest/k8s/deployment.yaml +++ b/micronaut-beer-rest/k8s/deployment.yaml @@ -14,7 +14,7 @@ spec: spec: containers: - name: rest-beer-service - image: lreimer/micronaut-beer-rest + image: qaware/micronaut-beer-rest resources: requests: memory: "128Mi" diff --git a/quarkus-beer-grpc/k8s/deployment.yaml b/quarkus-beer-grpc/k8s/deployment.yaml index 59e83d5..4ca4116 100644 --- a/quarkus-beer-grpc/k8s/deployment.yaml +++ b/quarkus-beer-grpc/k8s/deployment.yaml @@ -14,7 +14,7 @@ spec: spec: containers: - name: grpc-beer-service - image: lreimer/quarkus-beer-grpc + image: qaware/quarkus-beer-grpc resources: requests: memory: "128Mi" diff --git a/quarkus-beer-rest/k8s/deployment.yaml b/quarkus-beer-rest/k8s/deployment.yaml index 6d0d597..d356183 100644 --- a/quarkus-beer-rest/k8s/deployment.yaml +++ b/quarkus-beer-rest/k8s/deployment.yaml @@ -14,7 +14,7 @@ spec: spec: containers: - name: rest-beer-service - image: lreimer/quarkus-beer-rest + image: qaware/quarkus-beer-rest resources: requests: memory: "128Mi" diff --git a/rest-beer-golang/Makefile b/rest-beer-golang/Makefile index 139f783..068aaae 100644 --- a/rest-beer-golang/Makefile +++ b/rest-beer-golang/Makefile @@ -3,7 +3,7 @@ NAME = rest-beer-golang default: build image: - @docker build -t lreimer/$(NAME) . + @docker build -t qaware/$(NAME) . build: @go build diff --git a/rest-beer-golang/go.mod b/rest-beer-golang/go.mod index 61cc07d..0055628 100644 --- a/rest-beer-golang/go.mod +++ b/rest-beer-golang/go.mod @@ -1,3 +1,3 @@ -module github.com/lreimer/from-rest-to-grpc/rest-beer-golang +module github.com/qaware/from-rest-to-grpc/rest-beer-golang go 1.17 diff --git a/rest-beer-golang/k8s/deployment.yaml b/rest-beer-golang/k8s/deployment.yaml index 27a525a..740ee01 100644 --- a/rest-beer-golang/k8s/deployment.yaml +++ b/rest-beer-golang/k8s/deployment.yaml @@ -14,7 +14,7 @@ spec: spec: containers: - name: rest-beer-golang - image: lreimer/rest-beer-golang + image: qaware/rest-beer-golang resources: requests: memory: "64Mi" diff --git a/rest-beer-service/Makefile b/rest-beer-service/Makefile index 392a206..e54b840 100644 --- a/rest-beer-service/Makefile +++ b/rest-beer-service/Makefile @@ -3,7 +3,7 @@ NAME = rest-beer-service default: build image: - @docker build -t lreimer/$(NAME) . + @docker build -t qaware/$(NAME) . build: @buf generate diff --git a/rest-beer-service/buf.yaml b/rest-beer-service/buf.yaml index c4d9275..191f6e8 100644 --- a/rest-beer-service/buf.yaml +++ b/rest-beer-service/buf.yaml @@ -1,5 +1,5 @@ version: v1beta1 -name: github.com/lreimer/from-rest-to-grpc +name: github.com/qaware/from-rest-to-grpc deps: - buf.build/beta/googleapis build: diff --git a/rest-beer-service/go.mod b/rest-beer-service/go.mod index f3658e5..1bc59e5 100644 --- a/rest-beer-service/go.mod +++ b/rest-beer-service/go.mod @@ -1,4 +1,4 @@ -module github.com/lreimer/from-rest-to-grpc/rest-beer-service +module github.com/qaware/from-rest-to-grpc/rest-beer-service go 1.17 diff --git a/rest-beer-service/k8s/deployment.yaml b/rest-beer-service/k8s/deployment.yaml index 6ab2287..566be39 100644 --- a/rest-beer-service/k8s/deployment.yaml +++ b/rest-beer-service/k8s/deployment.yaml @@ -14,7 +14,7 @@ spec: spec: containers: - name: rest-beer-service - image: lreimer/rest-beer-service + image: qaware/rest-beer-service resources: requests: memory: "64Mi" diff --git a/rest-beer-service/main.go b/rest-beer-service/main.go index 0747fa7..7c91401 100644 --- a/rest-beer-service/main.go +++ b/rest-beer-service/main.go @@ -5,7 +5,7 @@ import ( "os" "github.com/gin-gonic/gin" - "github.com/lreimer/from-rest-to-grpc/rest-beer-service/proto" + "github.com/qaware/from-rest-to-grpc/rest-beer-service/proto" ) func main() { diff --git a/rest-beer-service/proto/beer.proto b/rest-beer-service/proto/beer.proto index f990968..2deb3a4 100644 --- a/rest-beer-service/proto/beer.proto +++ b/rest-beer-service/proto/beer.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -option go_package = "github.com/lreimer/from-rest-to-grpc/rest-beer-service/proto"; +option go_package = "github.com/qaware/from-rest-to-grpc/rest-beer-service/proto"; package beer; message Beer { diff --git a/skaffold.yaml b/skaffold.yaml index 53806bb..3867527 100644 --- a/skaffold.yaml +++ b/skaffold.yaml @@ -8,41 +8,41 @@ build: gitCommit: {} artifacts: # for the Golang demo - # - image: lreimer/grpc-beer-client + # - image: qaware/grpc-beer-client # context: grpc-beer-client/ - # - image: lreimer/rest-beer-golang + # - image: qaware/rest-beer-golang # context: rest-beer-golang/ - # - image: lreimer/rest-beer-service + # - image: qaware/rest-beer-service # context: rest-beer-service/ - # - image: lreimer/grpc-beer-service + # - image: qaware/grpc-beer-service # context: grpc-beer-service/ # for the Quarkus demo - - image: lreimer/quarkus-beer-rest + - image: qaware/quarkus-beer-rest context: quarkus-beer-rest/ docker: dockerfile: quarkus-beer-rest/src/main/docker/Dockerfile.jvm - - image: lreimer/quarkus-beer-grpc + - image: qaware/quarkus-beer-grpc context: quarkus-beer-grpc/ docker: dockerfile: quarkus-beer-grpc/src/main/docker/Dockerfile.jvm # for the Micronaut demo - - image: lreimer/micronaut-beer-rest + - image: qaware/micronaut-beer-rest context: micronaut-beer-rest/ jib: type: gradle - - image: lreimer/micronaut-beer-grpc + - image: qaware/micronaut-beer-grpc context: micronaut-beer-grpc/ jib: type: gradle # for gRPC ecosystem demo - - image: lreimer/grpc-beer-gateway + - image: qaware/grpc-beer-gateway context: grpc-beer-gateway/ - - image: lreimer/grpc-beer-nginx + - image: qaware/grpc-beer-nginx context: grpc-beer-nginx/ - - image: lreimer/grpc-beer-envoy + - image: qaware/grpc-beer-envoy context: grpc-beer-envoy/ local: # push: false From 837be208dfe919dbbb064ad2184b87f23bf1f1b0 Mon Sep 17 00:00:00 2001 From: Andreas Zitzelsberger Date: Tue, 9 Aug 2022 10:45:57 +0200 Subject: [PATCH 05/12] Phony targets fixed --- grpc-beer-service/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grpc-beer-service/Makefile b/grpc-beer-service/Makefile index 023dda3..12f6805 100644 --- a/grpc-beer-service/Makefile +++ b/grpc-beer-service/Makefile @@ -6,7 +6,7 @@ default: build run: HOST=127.0.0.1 PORT=9090 ./grpc-beer-service -.PHONY: build +.PHONY: image image: @docker build -t qaware/$(NAME) . @@ -17,6 +17,6 @@ grpc-beer-service: @buf generate @go build -.PHONY: build +.PHONY: clean clean: @rm -f $(NAME) \ No newline at end of file From 0ad900610a4ffeb7c8130d67e52a9b8938a81b07 Mon Sep 17 00:00:00 2001 From: Andreas Zitzelsberger Date: Tue, 9 Aug 2022 10:48:30 +0200 Subject: [PATCH 06/12] Auto-generated gRPC go bindings removed from Git --- grpc-beer-service/.gitignore | 1 + grpc-beer-service/proto/beer.pb.go | 675 ------------------------ grpc-beer-service/proto/beer_grpc.pb.go | 256 --------- 3 files changed, 1 insertion(+), 931 deletions(-) create mode 100644 grpc-beer-service/.gitignore delete mode 100644 grpc-beer-service/proto/beer.pb.go delete mode 100644 grpc-beer-service/proto/beer_grpc.pb.go diff --git a/grpc-beer-service/.gitignore b/grpc-beer-service/.gitignore new file mode 100644 index 0000000..f220b8d --- /dev/null +++ b/grpc-beer-service/.gitignore @@ -0,0 +1 @@ +proto/*.pb.go \ No newline at end of file diff --git a/grpc-beer-service/proto/beer.pb.go b/grpc-beer-service/proto/beer.pb.go deleted file mode 100644 index d7c1c50..0000000 --- a/grpc-beer-service/proto/beer.pb.go +++ /dev/null @@ -1,675 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.1 -// protoc v3.17.3 -// source: beer.proto - -package proto - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - emptypb "google.golang.org/protobuf/types/known/emptypb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Beer_BeerType int32 - -const ( - Beer_IndianPaleAle Beer_BeerType = 0 - Beer_SessionIpa Beer_BeerType = 1 - Beer_Lager Beer_BeerType = 2 -) - -// Enum value maps for Beer_BeerType. -var ( - Beer_BeerType_name = map[int32]string{ - 0: "IndianPaleAle", - 1: "SessionIpa", - 2: "Lager", - } - Beer_BeerType_value = map[string]int32{ - "IndianPaleAle": 0, - "SessionIpa": 1, - "Lager": 2, - } -) - -func (x Beer_BeerType) Enum() *Beer_BeerType { - p := new(Beer_BeerType) - *p = x - return p -} - -func (x Beer_BeerType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Beer_BeerType) Descriptor() protoreflect.EnumDescriptor { - return file_beer_proto_enumTypes[0].Descriptor() -} - -func (Beer_BeerType) Type() protoreflect.EnumType { - return &file_beer_proto_enumTypes[0] -} - -func (x Beer_BeerType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Beer_BeerType.Descriptor instead. -func (Beer_BeerType) EnumDescriptor() ([]byte, []int) { - return file_beer_proto_rawDescGZIP(), []int{0, 0} -} - -type Beer struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Asin string `protobuf:"bytes,1,opt,name=asin,proto3" json:"asin,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Brand string `protobuf:"bytes,3,opt,name=brand,proto3" json:"brand,omitempty"` - Country string `protobuf:"bytes,4,opt,name=country,proto3" json:"country,omitempty"` - Alcohol float32 `protobuf:"fixed32,5,opt,name=alcohol,proto3" json:"alcohol,omitempty"` - Type Beer_BeerType `protobuf:"varint,6,opt,name=type,proto3,enum=beer.Beer_BeerType" json:"type,omitempty"` -} - -func (x *Beer) Reset() { - *x = Beer{} - if protoimpl.UnsafeEnabled { - mi := &file_beer_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Beer) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Beer) ProtoMessage() {} - -func (x *Beer) ProtoReflect() protoreflect.Message { - mi := &file_beer_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Beer.ProtoReflect.Descriptor instead. -func (*Beer) Descriptor() ([]byte, []int) { - return file_beer_proto_rawDescGZIP(), []int{0} -} - -func (x *Beer) GetAsin() string { - if x != nil { - return x.Asin - } - return "" -} - -func (x *Beer) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Beer) GetBrand() string { - if x != nil { - return x.Brand - } - return "" -} - -func (x *Beer) GetCountry() string { - if x != nil { - return x.Country - } - return "" -} - -func (x *Beer) GetAlcohol() float32 { - if x != nil { - return x.Alcohol - } - return 0 -} - -func (x *Beer) GetType() Beer_BeerType { - if x != nil { - return x.Type - } - return Beer_IndianPaleAle -} - -type GetBeersResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Beers []*Beer `protobuf:"bytes,1,rep,name=beers,proto3" json:"beers,omitempty"` -} - -func (x *GetBeersResponse) Reset() { - *x = GetBeersResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_beer_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetBeersResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetBeersResponse) ProtoMessage() {} - -func (x *GetBeersResponse) ProtoReflect() protoreflect.Message { - mi := &file_beer_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetBeersResponse.ProtoReflect.Descriptor instead. -func (*GetBeersResponse) Descriptor() ([]byte, []int) { - return file_beer_proto_rawDescGZIP(), []int{1} -} - -func (x *GetBeersResponse) GetBeers() []*Beer { - if x != nil { - return x.Beers - } - return nil -} - -type GetBeerRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Asin string `protobuf:"bytes,1,opt,name=asin,proto3" json:"asin,omitempty"` -} - -func (x *GetBeerRequest) Reset() { - *x = GetBeerRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_beer_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetBeerRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetBeerRequest) ProtoMessage() {} - -func (x *GetBeerRequest) ProtoReflect() protoreflect.Message { - mi := &file_beer_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetBeerRequest.ProtoReflect.Descriptor instead. -func (*GetBeerRequest) Descriptor() ([]byte, []int) { - return file_beer_proto_rawDescGZIP(), []int{2} -} - -func (x *GetBeerRequest) GetAsin() string { - if x != nil { - return x.Asin - } - return "" -} - -type GetBeerResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Beer *Beer `protobuf:"bytes,1,opt,name=beer,proto3" json:"beer,omitempty"` -} - -func (x *GetBeerResponse) Reset() { - *x = GetBeerResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_beer_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetBeerResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetBeerResponse) ProtoMessage() {} - -func (x *GetBeerResponse) ProtoReflect() protoreflect.Message { - mi := &file_beer_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetBeerResponse.ProtoReflect.Descriptor instead. -func (*GetBeerResponse) Descriptor() ([]byte, []int) { - return file_beer_proto_rawDescGZIP(), []int{3} -} - -func (x *GetBeerResponse) GetBeer() *Beer { - if x != nil { - return x.Beer - } - return nil -} - -type CreateBeerRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Beer *Beer `protobuf:"bytes,1,opt,name=beer,proto3" json:"beer,omitempty"` -} - -func (x *CreateBeerRequest) Reset() { - *x = CreateBeerRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_beer_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateBeerRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateBeerRequest) ProtoMessage() {} - -func (x *CreateBeerRequest) ProtoReflect() protoreflect.Message { - mi := &file_beer_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateBeerRequest.ProtoReflect.Descriptor instead. -func (*CreateBeerRequest) Descriptor() ([]byte, []int) { - return file_beer_proto_rawDescGZIP(), []int{4} -} - -func (x *CreateBeerRequest) GetBeer() *Beer { - if x != nil { - return x.Beer - } - return nil -} - -type UpdateBeerRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Asin string `protobuf:"bytes,1,opt,name=asin,proto3" json:"asin,omitempty"` - Beer *Beer `protobuf:"bytes,2,opt,name=beer,proto3" json:"beer,omitempty"` -} - -func (x *UpdateBeerRequest) Reset() { - *x = UpdateBeerRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_beer_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateBeerRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateBeerRequest) ProtoMessage() {} - -func (x *UpdateBeerRequest) ProtoReflect() protoreflect.Message { - mi := &file_beer_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateBeerRequest.ProtoReflect.Descriptor instead. -func (*UpdateBeerRequest) Descriptor() ([]byte, []int) { - return file_beer_proto_rawDescGZIP(), []int{5} -} - -func (x *UpdateBeerRequest) GetAsin() string { - if x != nil { - return x.Asin - } - return "" -} - -func (x *UpdateBeerRequest) GetBeer() *Beer { - if x != nil { - return x.Beer - } - return nil -} - -type DeleteBeerRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Asin string `protobuf:"bytes,1,opt,name=asin,proto3" json:"asin,omitempty"` -} - -func (x *DeleteBeerRequest) Reset() { - *x = DeleteBeerRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_beer_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteBeerRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteBeerRequest) ProtoMessage() {} - -func (x *DeleteBeerRequest) ProtoReflect() protoreflect.Message { - mi := &file_beer_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteBeerRequest.ProtoReflect.Descriptor instead. -func (*DeleteBeerRequest) Descriptor() ([]byte, []int) { - return file_beer_proto_rawDescGZIP(), []int{6} -} - -func (x *DeleteBeerRequest) GetAsin() string { - if x != nil { - return x.Asin - } - return "" -} - -var File_beer_proto protoreflect.FileDescriptor - -var file_beer_proto_rawDesc = []byte{ - 0x0a, 0x0a, 0x62, 0x65, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x62, 0x65, - 0x65, 0x72, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0xdb, 0x01, 0x0a, 0x04, 0x42, 0x65, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x73, 0x69, 0x6e, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x73, 0x69, 0x6e, 0x12, 0x12, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x14, 0x0a, 0x05, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, - 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, - 0x12, 0x18, 0x0a, 0x07, 0x61, 0x6c, 0x63, 0x6f, 0x68, 0x6f, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x02, 0x52, 0x07, 0x61, 0x6c, 0x63, 0x6f, 0x68, 0x6f, 0x6c, 0x12, 0x27, 0x0a, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x62, 0x65, 0x65, 0x72, 0x2e, - 0x42, 0x65, 0x65, 0x72, 0x2e, 0x42, 0x65, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, - 0x79, 0x70, 0x65, 0x22, 0x38, 0x0a, 0x08, 0x42, 0x65, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x11, 0x0a, 0x0d, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x50, 0x61, 0x6c, 0x65, 0x41, 0x6c, 0x65, - 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x70, 0x61, - 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x4c, 0x61, 0x67, 0x65, 0x72, 0x10, 0x02, 0x22, 0x34, 0x0a, - 0x10, 0x47, 0x65, 0x74, 0x42, 0x65, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x20, 0x0a, 0x05, 0x62, 0x65, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x0a, 0x2e, 0x62, 0x65, 0x65, 0x72, 0x2e, 0x42, 0x65, 0x65, 0x72, 0x52, 0x05, 0x62, 0x65, - 0x65, 0x72, 0x73, 0x22, 0x24, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x42, 0x65, 0x65, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x73, 0x69, 0x6e, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x73, 0x69, 0x6e, 0x22, 0x31, 0x0a, 0x0f, 0x47, 0x65, 0x74, - 0x42, 0x65, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x04, - 0x62, 0x65, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x62, 0x65, 0x65, - 0x72, 0x2e, 0x42, 0x65, 0x65, 0x72, 0x52, 0x04, 0x62, 0x65, 0x65, 0x72, 0x22, 0x33, 0x0a, 0x11, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x1e, 0x0a, 0x04, 0x62, 0x65, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0a, 0x2e, 0x62, 0x65, 0x65, 0x72, 0x2e, 0x42, 0x65, 0x65, 0x72, 0x52, 0x04, 0x62, 0x65, 0x65, - 0x72, 0x22, 0x47, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x65, 0x65, 0x72, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x73, 0x69, 0x6e, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x73, 0x69, 0x6e, 0x12, 0x1e, 0x0a, 0x04, 0x62, 0x65, - 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x62, 0x65, 0x65, 0x72, 0x2e, - 0x42, 0x65, 0x65, 0x72, 0x52, 0x04, 0x62, 0x65, 0x65, 0x72, 0x22, 0x27, 0x0a, 0x11, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x42, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x12, 0x0a, 0x04, 0x61, 0x73, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, - 0x73, 0x69, 0x6e, 0x32, 0xc8, 0x02, 0x0a, 0x0b, 0x42, 0x65, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x12, 0x3c, 0x0a, 0x08, 0x41, 0x6c, 0x6c, 0x42, 0x65, 0x65, 0x72, 0x73, 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, 0x16, 0x2e, 0x62, 0x65, 0x65, 0x72, 0x2e, 0x47, - 0x65, 0x74, 0x42, 0x65, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x12, 0x38, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x42, 0x65, 0x65, 0x72, 0x12, 0x14, 0x2e, 0x62, - 0x65, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x62, 0x65, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x65, 0x65, - 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x0a, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x65, 0x65, 0x72, 0x12, 0x17, 0x2e, 0x62, 0x65, 0x65, 0x72, - 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x0a, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x65, 0x65, 0x72, 0x12, 0x17, 0x2e, 0x62, 0x65, 0x65, - 0x72, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x3f, 0x0a, - 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x65, 0x65, 0x72, 0x12, 0x17, 0x2e, 0x62, 0x65, - 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x42, 0x3e, - 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x72, 0x65, - 0x69, 0x6d, 0x65, 0x72, 0x2f, 0x66, 0x72, 0x6f, 0x6d, 0x2d, 0x72, 0x65, 0x73, 0x74, 0x2d, 0x74, - 0x6f, 0x2d, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x62, 0x65, 0x65, 0x72, - 0x2d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_beer_proto_rawDescOnce sync.Once - file_beer_proto_rawDescData = file_beer_proto_rawDesc -) - -func file_beer_proto_rawDescGZIP() []byte { - file_beer_proto_rawDescOnce.Do(func() { - file_beer_proto_rawDescData = protoimpl.X.CompressGZIP(file_beer_proto_rawDescData) - }) - return file_beer_proto_rawDescData -} - -var file_beer_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_beer_proto_msgTypes = make([]protoimpl.MessageInfo, 7) -var file_beer_proto_goTypes = []interface{}{ - (Beer_BeerType)(0), // 0: beer.Beer.BeerType - (*Beer)(nil), // 1: beer.Beer - (*GetBeersResponse)(nil), // 2: beer.GetBeersResponse - (*GetBeerRequest)(nil), // 3: beer.GetBeerRequest - (*GetBeerResponse)(nil), // 4: beer.GetBeerResponse - (*CreateBeerRequest)(nil), // 5: beer.CreateBeerRequest - (*UpdateBeerRequest)(nil), // 6: beer.UpdateBeerRequest - (*DeleteBeerRequest)(nil), // 7: beer.DeleteBeerRequest - (*emptypb.Empty)(nil), // 8: google.protobuf.Empty -} -var file_beer_proto_depIdxs = []int32{ - 0, // 0: beer.Beer.type:type_name -> beer.Beer.BeerType - 1, // 1: beer.GetBeersResponse.beers:type_name -> beer.Beer - 1, // 2: beer.GetBeerResponse.beer:type_name -> beer.Beer - 1, // 3: beer.CreateBeerRequest.beer:type_name -> beer.Beer - 1, // 4: beer.UpdateBeerRequest.beer:type_name -> beer.Beer - 8, // 5: beer.BeerService.AllBeers:input_type -> google.protobuf.Empty - 3, // 6: beer.BeerService.GetBeer:input_type -> beer.GetBeerRequest - 5, // 7: beer.BeerService.CreateBeer:input_type -> beer.CreateBeerRequest - 6, // 8: beer.BeerService.UpdateBeer:input_type -> beer.UpdateBeerRequest - 7, // 9: beer.BeerService.DeleteBeer:input_type -> beer.DeleteBeerRequest - 2, // 10: beer.BeerService.AllBeers:output_type -> beer.GetBeersResponse - 4, // 11: beer.BeerService.GetBeer:output_type -> beer.GetBeerResponse - 8, // 12: beer.BeerService.CreateBeer:output_type -> google.protobuf.Empty - 8, // 13: beer.BeerService.UpdateBeer:output_type -> google.protobuf.Empty - 8, // 14: beer.BeerService.DeleteBeer:output_type -> google.protobuf.Empty - 10, // [10:15] is the sub-list for method output_type - 5, // [5:10] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name -} - -func init() { file_beer_proto_init() } -func file_beer_proto_init() { - if File_beer_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_beer_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Beer); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_beer_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetBeersResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_beer_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetBeerRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_beer_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetBeerResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_beer_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateBeerRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_beer_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateBeerRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_beer_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteBeerRequest); 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{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_beer_proto_rawDesc, - NumEnums: 1, - NumMessages: 7, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_beer_proto_goTypes, - DependencyIndexes: file_beer_proto_depIdxs, - EnumInfos: file_beer_proto_enumTypes, - MessageInfos: file_beer_proto_msgTypes, - }.Build() - File_beer_proto = out.File - file_beer_proto_rawDesc = nil - file_beer_proto_goTypes = nil - file_beer_proto_depIdxs = nil -} diff --git a/grpc-beer-service/proto/beer_grpc.pb.go b/grpc-beer-service/proto/beer_grpc.pb.go deleted file mode 100644 index fbf7e8b..0000000 --- a/grpc-beer-service/proto/beer_grpc.pb.go +++ /dev/null @@ -1,256 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. - -package proto - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - emptypb "google.golang.org/protobuf/types/known/emptypb" -) - -// 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 - -// BeerServiceClient is the client API for BeerService service. -// -// 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 BeerServiceClient interface { - // Get the list of all beers - AllBeers(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetBeersResponse, error) - // Get a single beer by Asin - GetBeer(ctx context.Context, in *GetBeerRequest, opts ...grpc.CallOption) (*GetBeerResponse, error) - // Create a new beer - CreateBeer(ctx context.Context, in *CreateBeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // Update an existing beer - UpdateBeer(ctx context.Context, in *UpdateBeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // Delete an existing beeer - DeleteBeer(ctx context.Context, in *DeleteBeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) -} - -type beerServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewBeerServiceClient(cc grpc.ClientConnInterface) BeerServiceClient { - return &beerServiceClient{cc} -} - -func (c *beerServiceClient) AllBeers(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetBeersResponse, error) { - out := new(GetBeersResponse) - err := c.cc.Invoke(ctx, "/beer.BeerService/AllBeers", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *beerServiceClient) GetBeer(ctx context.Context, in *GetBeerRequest, opts ...grpc.CallOption) (*GetBeerResponse, error) { - out := new(GetBeerResponse) - err := c.cc.Invoke(ctx, "/beer.BeerService/GetBeer", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *beerServiceClient) CreateBeer(ctx context.Context, in *CreateBeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/beer.BeerService/CreateBeer", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *beerServiceClient) UpdateBeer(ctx context.Context, in *UpdateBeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/beer.BeerService/UpdateBeer", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *beerServiceClient) DeleteBeer(ctx context.Context, in *DeleteBeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/beer.BeerService/DeleteBeer", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// BeerServiceServer is the server API for BeerService service. -// All implementations must embed UnimplementedBeerServiceServer -// for forward compatibility -type BeerServiceServer interface { - // Get the list of all beers - AllBeers(context.Context, *emptypb.Empty) (*GetBeersResponse, error) - // Get a single beer by Asin - GetBeer(context.Context, *GetBeerRequest) (*GetBeerResponse, error) - // Create a new beer - CreateBeer(context.Context, *CreateBeerRequest) (*emptypb.Empty, error) - // Update an existing beer - UpdateBeer(context.Context, *UpdateBeerRequest) (*emptypb.Empty, error) - // Delete an existing beeer - DeleteBeer(context.Context, *DeleteBeerRequest) (*emptypb.Empty, error) - mustEmbedUnimplementedBeerServiceServer() -} - -// UnimplementedBeerServiceServer must be embedded to have forward compatible implementations. -type UnimplementedBeerServiceServer struct { -} - -func (UnimplementedBeerServiceServer) AllBeers(context.Context, *emptypb.Empty) (*GetBeersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AllBeers not implemented") -} -func (UnimplementedBeerServiceServer) GetBeer(context.Context, *GetBeerRequest) (*GetBeerResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetBeer not implemented") -} -func (UnimplementedBeerServiceServer) CreateBeer(context.Context, *CreateBeerRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateBeer not implemented") -} -func (UnimplementedBeerServiceServer) UpdateBeer(context.Context, *UpdateBeerRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateBeer not implemented") -} -func (UnimplementedBeerServiceServer) DeleteBeer(context.Context, *DeleteBeerRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteBeer not implemented") -} -func (UnimplementedBeerServiceServer) mustEmbedUnimplementedBeerServiceServer() {} - -// UnsafeBeerServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to BeerServiceServer will -// result in compilation errors. -type UnsafeBeerServiceServer interface { - mustEmbedUnimplementedBeerServiceServer() -} - -func RegisterBeerServiceServer(s grpc.ServiceRegistrar, srv BeerServiceServer) { - s.RegisterService(&BeerService_ServiceDesc, srv) -} - -func _BeerService_AllBeers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(emptypb.Empty) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BeerServiceServer).AllBeers(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/beer.BeerService/AllBeers", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BeerServiceServer).AllBeers(ctx, req.(*emptypb.Empty)) - } - return interceptor(ctx, in, info, handler) -} - -func _BeerService_GetBeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetBeerRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BeerServiceServer).GetBeer(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/beer.BeerService/GetBeer", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BeerServiceServer).GetBeer(ctx, req.(*GetBeerRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _BeerService_CreateBeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateBeerRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BeerServiceServer).CreateBeer(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/beer.BeerService/CreateBeer", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BeerServiceServer).CreateBeer(ctx, req.(*CreateBeerRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _BeerService_UpdateBeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateBeerRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BeerServiceServer).UpdateBeer(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/beer.BeerService/UpdateBeer", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BeerServiceServer).UpdateBeer(ctx, req.(*UpdateBeerRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _BeerService_DeleteBeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteBeerRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BeerServiceServer).DeleteBeer(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/beer.BeerService/DeleteBeer", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BeerServiceServer).DeleteBeer(ctx, req.(*DeleteBeerRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// BeerService_ServiceDesc is the grpc.ServiceDesc for BeerService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var BeerService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "beer.BeerService", - HandlerType: (*BeerServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "AllBeers", - Handler: _BeerService_AllBeers_Handler, - }, - { - MethodName: "GetBeer", - Handler: _BeerService_GetBeer_Handler, - }, - { - MethodName: "CreateBeer", - Handler: _BeerService_CreateBeer_Handler, - }, - { - MethodName: "UpdateBeer", - Handler: _BeerService_UpdateBeer_Handler, - }, - { - MethodName: "DeleteBeer", - Handler: _BeerService_DeleteBeer_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "beer.proto", -} From 380888a33ff954453b8e1d35fdef273b03038586 Mon Sep 17 00:00:00 2001 From: Andreas Zitzelsberger Date: Tue, 9 Aug 2022 10:51:16 +0200 Subject: [PATCH 07/12] Separate target for PB/gRPC binding generation added --- grpc-beer-service/Makefile | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/grpc-beer-service/Makefile b/grpc-beer-service/Makefile index 12f6805..2c390f2 100644 --- a/grpc-beer-service/Makefile +++ b/grpc-beer-service/Makefile @@ -8,15 +8,18 @@ run: .PHONY: image image: - @docker build -t qaware/$(NAME) . + docker build -t qaware/$(NAME) . .PHONY: build build: grpc-beer-service -grpc-beer-service: - @buf generate - @go build +grpc-beer-service: proto/beer.pb.go + go build + +proto/beer.pb.go: + buf generate .PHONY: clean clean: - @rm -f $(NAME) \ No newline at end of file + rm proto/*.pb.go + rm -f $(NAME) \ No newline at end of file From 0526b59be6f47c7ddd4d8b190a81c2b73aa7bdfd Mon Sep 17 00:00:00 2001 From: Andreas Zitzelsberger Date: Tue, 9 Aug 2022 11:07:15 +0200 Subject: [PATCH 08/12] Dockerfiles update to OpenJDK 17 --- quarkus-beer-grpc/src/main/docker/Dockerfile.jvm | 2 +- quarkus-beer-grpc/src/main/docker/Dockerfile.legacy-jar | 2 +- quarkus-beer-rest/src/main/docker/Dockerfile.jvm | 2 +- quarkus-beer-rest/src/main/docker/Dockerfile.legacy-jar | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/quarkus-beer-grpc/src/main/docker/Dockerfile.jvm b/quarkus-beer-grpc/src/main/docker/Dockerfile.jvm index ce8d52e..98c8d50 100644 --- a/quarkus-beer-grpc/src/main/docker/Dockerfile.jvm +++ b/quarkus-beer-grpc/src/main/docker/Dockerfile.jvm @@ -75,7 +75,7 @@ # accessed directly. (example: "foo.example.com,bar.example.com") # ### -FROM registry.access.redhat.com/ubi8/openjdk-11:1.11 +FROM registry.access.redhat.com/ubi8/openjdk-17:1.14 ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' diff --git a/quarkus-beer-grpc/src/main/docker/Dockerfile.legacy-jar b/quarkus-beer-grpc/src/main/docker/Dockerfile.legacy-jar index f500dc2..a971952 100644 --- a/quarkus-beer-grpc/src/main/docker/Dockerfile.legacy-jar +++ b/quarkus-beer-grpc/src/main/docker/Dockerfile.legacy-jar @@ -75,7 +75,7 @@ # accessed directly. (example: "foo.example.com,bar.example.com") # ### -FROM registry.access.redhat.com/ubi8/openjdk-11:1.11 +FROM registry.access.redhat.com/ubi8/openjdk-17:1.14 ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' diff --git a/quarkus-beer-rest/src/main/docker/Dockerfile.jvm b/quarkus-beer-rest/src/main/docker/Dockerfile.jvm index ede3f88..389f08c 100644 --- a/quarkus-beer-rest/src/main/docker/Dockerfile.jvm +++ b/quarkus-beer-rest/src/main/docker/Dockerfile.jvm @@ -75,7 +75,7 @@ # accessed directly. (example: "foo.example.com,bar.example.com") # ### -FROM registry.access.redhat.com/ubi8/openjdk-11:1.11 +FROM registry.access.redhat.com/ubi8/openjdk-17:1.14 ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' diff --git a/quarkus-beer-rest/src/main/docker/Dockerfile.legacy-jar b/quarkus-beer-rest/src/main/docker/Dockerfile.legacy-jar index ef40855..34afb88 100644 --- a/quarkus-beer-rest/src/main/docker/Dockerfile.legacy-jar +++ b/quarkus-beer-rest/src/main/docker/Dockerfile.legacy-jar @@ -75,7 +75,7 @@ # accessed directly. (example: "foo.example.com,bar.example.com") # ### -FROM registry.access.redhat.com/ubi8/openjdk-11:1.11 +FROM registry.access.redhat.com/ubi8/openjdk-17:1.14 ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' From f422d2c509b924e8c359c1d32738573063746207 Mon Sep 17 00:00:00 2001 From: Andreas Zitzelsberger Date: Tue, 9 Aug 2022 11:49:29 +0200 Subject: [PATCH 09/12] Jib updated to version 3.2.0 --- micronaut-beer-grpc/build.gradle | 2 +- micronaut-beer-rest/build.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/micronaut-beer-grpc/build.gradle b/micronaut-beer-grpc/build.gradle index e6fad5a..b09eb94 100644 --- a/micronaut-beer-grpc/build.gradle +++ b/micronaut-beer-grpc/build.gradle @@ -2,7 +2,7 @@ plugins { id("com.github.johnrengelman.shadow") version "7.1.2" id("io.micronaut.application") version "3.3.2" id("com.google.protobuf") version "0.8.15" - id("com.google.cloud.tools.jib") version "2.8.0" + id("com.google.cloud.tools.jib") version "3.2.0" } version = "1.0.0" diff --git a/micronaut-beer-rest/build.gradle b/micronaut-beer-rest/build.gradle index 7da3749..86f6959 100644 --- a/micronaut-beer-rest/build.gradle +++ b/micronaut-beer-rest/build.gradle @@ -2,7 +2,7 @@ plugins { id("com.github.johnrengelman.shadow") version "7.1.2" id("io.micronaut.application") version "3.3.2" id("com.google.protobuf") version "0.8.15" - id("com.google.cloud.tools.jib") version "2.8.0" + id("com.google.cloud.tools.jib") version "3.2.0" } version = "1.0.0" From d136054bbecb0de73a708fa213a75ef7c44c8c3b Mon Sep 17 00:00:00 2001 From: Andreas Zitzelsberger Date: Tue, 9 Aug 2022 11:49:55 +0200 Subject: [PATCH 10/12] Tiltfile switched to Quarkus --- Tiltfile | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/Tiltfile b/Tiltfile index 465723a..fb2e613 100644 --- a/Tiltfile +++ b/Tiltfile @@ -2,34 +2,34 @@ update_settings(suppress_unused_image_warnings=["qaware/micronaut-beer-grpc", "qaware/quarkus-beer-grpc"]) # for the Quarkus beer services -# local_resource('quarkus-beer-grpc-build', './gradlew assemble', dir='quarkus-beer-grpc', -# deps=['./quarkus-beer-grpc/build.gradle', './quarkus-beer-grpc/src/'], labels=['Quarkus']) +local_resource('quarkus-beer-grpc-build', './gradlew assemble', dir='quarkus-beer-grpc', + deps=['./quarkus-beer-grpc/build.gradle', './quarkus-beer-grpc/src/'], labels=['Quarkus']) -# docker_build('qaware/quarkus-beer-grpc', './quarkus-beer-grpc/', -# dockerfile='quarkus-beer-grpc/src/main/docker/Dockerfile.jvm', only=['./build/']) +docker_build('qaware/quarkus-beer-grpc', './quarkus-beer-grpc/', + dockerfile='quarkus-beer-grpc/src/main/docker/Dockerfile.jvm', only=['./build/']) -# k8s_yaml(['quarkus-beer-grpc/k8s/deployment.yaml', 'quarkus-beer-grpc/k8s/service.yaml']) -# k8s_resource(workload='grpc-beer-service', port_forwards=[port_forward(19090, 9090, 'gRPC API')], labels=['Quarkus']) +k8s_yaml(['quarkus-beer-grpc/k8s/deployment.yaml', 'quarkus-beer-grpc/k8s/service.yaml']) +k8s_resource(workload='grpc-beer-service', port_forwards=[port_forward(19090, 9090, 'gRPC API')], labels=['Quarkus']) -# local_resource('quarkus-beer-rest-build', './gradlew assemble', dir='quarkus-beer-rest', -# deps=['./quarkus-beer-rest/build.gradle', './quarkus-beer-rest/src/'], labels=['Quarkus']) +local_resource('quarkus-beer-rest-build', './gradlew assemble', dir='quarkus-beer-rest', + deps=['./quarkus-beer-rest/build.gradle', './quarkus-beer-rest/src/'], labels=['Quarkus']) -# docker_build('qaware/quarkus-beer-rest', './quarkus-beer-rest/', -# dockerfile='quarkus-beer-rest/src/main/docker/Dockerfile.jvm', only=['./build/']) +docker_build('qaware/quarkus-beer-rest', './quarkus-beer-rest/', + dockerfile='quarkus-beer-rest/src/main/docker/Dockerfile.jvm', only=['./build/']) -# k8s_yaml(['quarkus-beer-rest/k8s/deployment.yaml', 'quarkus-beer-rest/k8s/service.yaml']) -# k8s_resource(workload='rest-beer-service', port_forwards=[port_forward(18080, 8080, 'REST API')], labels=['Quarkus']) +k8s_yaml(['quarkus-beer-rest/k8s/deployment.yaml', 'quarkus-beer-rest/k8s/service.yaml']) +k8s_resource(workload='rest-beer-service', port_forwards=[port_forward(18080, 8080, 'REST API')], labels=['Quarkus']) # for the Micronaut beer service -custom_build('qaware/micronaut-beer-grpc', 'cd micronaut-beer-grpc && ./gradlew jibDockerBuild --image $EXPECTED_REF', - ['./micronaut-beer-grpc/build.gradle', './micronaut-beer-grpc/src/']) -k8s_yaml(['micronaut-beer-grpc/k8s/deployment.yaml', 'micronaut-beer-grpc/k8s/service.yaml']) -k8s_resource(workload='grpc-beer-service', port_forwards=[port_forward(19090, 9090, 'gRPC API')], labels=['Micronaut']) - -custom_build('qaware/micronaut-beer-rest', 'cd micronaut-beer-rest && ./gradlew jibDockerBuild --image $EXPECTED_REF', - ['./micronaut-beer-rest/build.gradle', './micronaut-beer-rest/src/']) -k8s_yaml(['micronaut-beer-rest/k8s/deployment.yaml', 'micronaut-beer-rest/k8s/service.yaml']) -k8s_resource(workload='rest-beer-service', port_forwards=[port_forward(18080, 8080, 'REST API')], labels=['Micronaut']) +# custom_build('qaware/micronaut-beer-grpc', 'cd micronaut-beer-grpc && ./gradlew jibDockerBuild --image $EXPECTED_REF', +# ['./micronaut-beer-grpc/build.gradle', './micronaut-beer-grpc/src/']) +# k8s_yaml(['micronaut-beer-grpc/k8s/deployment.yaml', 'micronaut-beer-grpc/k8s/service.yaml']) +# k8s_resource(workload='grpc-beer-service', port_forwards=[port_forward(19090, 9090, 'gRPC API')], labels=['Micronaut']) +# +# custom_build('qaware/micronaut-beer-rest', 'cd micronaut-beer-rest && ./gradlew jibDockerBuild --image $EXPECTED_REF', +# ['./micronaut-beer-rest/build.gradle', './micronaut-beer-rest/src/']) +# k8s_yaml(['micronaut-beer-rest/k8s/deployment.yaml', 'micronaut-beer-rest/k8s/service.yaml']) +# k8s_resource(workload='rest-beer-service', port_forwards=[port_forward(18080, 8080, 'REST API')], labels=['Micronaut']) # the gRPC beer Gateway docker_build('qaware/grpc-beer-gateway', './grpc-beer-gateway/', dockerfile='grpc-beer-gateway/Dockerfile') From e1e3045a6ca4abc546593255da8e9fc0559d9f0d Mon Sep 17 00:00:00 2001 From: Andreas Zitzelsberger Date: Tue, 9 Aug 2022 18:30:54 +0200 Subject: [PATCH 11/12] Revert "Auto-generated gRPC go bindings removed from Git" This reverts commit 0ad900610a4ffeb7c8130d67e52a9b8938a81b07. --- grpc-beer-service/.gitignore | 1 - grpc-beer-service/proto/beer.pb.go | 675 ++++++++++++++++++++++++ grpc-beer-service/proto/beer_grpc.pb.go | 256 +++++++++ 3 files changed, 931 insertions(+), 1 deletion(-) delete mode 100644 grpc-beer-service/.gitignore create mode 100644 grpc-beer-service/proto/beer.pb.go create mode 100644 grpc-beer-service/proto/beer_grpc.pb.go diff --git a/grpc-beer-service/.gitignore b/grpc-beer-service/.gitignore deleted file mode 100644 index f220b8d..0000000 --- a/grpc-beer-service/.gitignore +++ /dev/null @@ -1 +0,0 @@ -proto/*.pb.go \ No newline at end of file diff --git a/grpc-beer-service/proto/beer.pb.go b/grpc-beer-service/proto/beer.pb.go new file mode 100644 index 0000000..d7c1c50 --- /dev/null +++ b/grpc-beer-service/proto/beer.pb.go @@ -0,0 +1,675 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc v3.17.3 +// source: beer.proto + +package proto + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Beer_BeerType int32 + +const ( + Beer_IndianPaleAle Beer_BeerType = 0 + Beer_SessionIpa Beer_BeerType = 1 + Beer_Lager Beer_BeerType = 2 +) + +// Enum value maps for Beer_BeerType. +var ( + Beer_BeerType_name = map[int32]string{ + 0: "IndianPaleAle", + 1: "SessionIpa", + 2: "Lager", + } + Beer_BeerType_value = map[string]int32{ + "IndianPaleAle": 0, + "SessionIpa": 1, + "Lager": 2, + } +) + +func (x Beer_BeerType) Enum() *Beer_BeerType { + p := new(Beer_BeerType) + *p = x + return p +} + +func (x Beer_BeerType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Beer_BeerType) Descriptor() protoreflect.EnumDescriptor { + return file_beer_proto_enumTypes[0].Descriptor() +} + +func (Beer_BeerType) Type() protoreflect.EnumType { + return &file_beer_proto_enumTypes[0] +} + +func (x Beer_BeerType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Beer_BeerType.Descriptor instead. +func (Beer_BeerType) EnumDescriptor() ([]byte, []int) { + return file_beer_proto_rawDescGZIP(), []int{0, 0} +} + +type Beer struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Asin string `protobuf:"bytes,1,opt,name=asin,proto3" json:"asin,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Brand string `protobuf:"bytes,3,opt,name=brand,proto3" json:"brand,omitempty"` + Country string `protobuf:"bytes,4,opt,name=country,proto3" json:"country,omitempty"` + Alcohol float32 `protobuf:"fixed32,5,opt,name=alcohol,proto3" json:"alcohol,omitempty"` + Type Beer_BeerType `protobuf:"varint,6,opt,name=type,proto3,enum=beer.Beer_BeerType" json:"type,omitempty"` +} + +func (x *Beer) Reset() { + *x = Beer{} + if protoimpl.UnsafeEnabled { + mi := &file_beer_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Beer) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Beer) ProtoMessage() {} + +func (x *Beer) ProtoReflect() protoreflect.Message { + mi := &file_beer_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Beer.ProtoReflect.Descriptor instead. +func (*Beer) Descriptor() ([]byte, []int) { + return file_beer_proto_rawDescGZIP(), []int{0} +} + +func (x *Beer) GetAsin() string { + if x != nil { + return x.Asin + } + return "" +} + +func (x *Beer) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Beer) GetBrand() string { + if x != nil { + return x.Brand + } + return "" +} + +func (x *Beer) GetCountry() string { + if x != nil { + return x.Country + } + return "" +} + +func (x *Beer) GetAlcohol() float32 { + if x != nil { + return x.Alcohol + } + return 0 +} + +func (x *Beer) GetType() Beer_BeerType { + if x != nil { + return x.Type + } + return Beer_IndianPaleAle +} + +type GetBeersResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Beers []*Beer `protobuf:"bytes,1,rep,name=beers,proto3" json:"beers,omitempty"` +} + +func (x *GetBeersResponse) Reset() { + *x = GetBeersResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_beer_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetBeersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBeersResponse) ProtoMessage() {} + +func (x *GetBeersResponse) ProtoReflect() protoreflect.Message { + mi := &file_beer_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetBeersResponse.ProtoReflect.Descriptor instead. +func (*GetBeersResponse) Descriptor() ([]byte, []int) { + return file_beer_proto_rawDescGZIP(), []int{1} +} + +func (x *GetBeersResponse) GetBeers() []*Beer { + if x != nil { + return x.Beers + } + return nil +} + +type GetBeerRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Asin string `protobuf:"bytes,1,opt,name=asin,proto3" json:"asin,omitempty"` +} + +func (x *GetBeerRequest) Reset() { + *x = GetBeerRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_beer_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetBeerRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBeerRequest) ProtoMessage() {} + +func (x *GetBeerRequest) ProtoReflect() protoreflect.Message { + mi := &file_beer_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetBeerRequest.ProtoReflect.Descriptor instead. +func (*GetBeerRequest) Descriptor() ([]byte, []int) { + return file_beer_proto_rawDescGZIP(), []int{2} +} + +func (x *GetBeerRequest) GetAsin() string { + if x != nil { + return x.Asin + } + return "" +} + +type GetBeerResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Beer *Beer `protobuf:"bytes,1,opt,name=beer,proto3" json:"beer,omitempty"` +} + +func (x *GetBeerResponse) Reset() { + *x = GetBeerResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_beer_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetBeerResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBeerResponse) ProtoMessage() {} + +func (x *GetBeerResponse) ProtoReflect() protoreflect.Message { + mi := &file_beer_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetBeerResponse.ProtoReflect.Descriptor instead. +func (*GetBeerResponse) Descriptor() ([]byte, []int) { + return file_beer_proto_rawDescGZIP(), []int{3} +} + +func (x *GetBeerResponse) GetBeer() *Beer { + if x != nil { + return x.Beer + } + return nil +} + +type CreateBeerRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Beer *Beer `protobuf:"bytes,1,opt,name=beer,proto3" json:"beer,omitempty"` +} + +func (x *CreateBeerRequest) Reset() { + *x = CreateBeerRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_beer_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateBeerRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateBeerRequest) ProtoMessage() {} + +func (x *CreateBeerRequest) ProtoReflect() protoreflect.Message { + mi := &file_beer_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateBeerRequest.ProtoReflect.Descriptor instead. +func (*CreateBeerRequest) Descriptor() ([]byte, []int) { + return file_beer_proto_rawDescGZIP(), []int{4} +} + +func (x *CreateBeerRequest) GetBeer() *Beer { + if x != nil { + return x.Beer + } + return nil +} + +type UpdateBeerRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Asin string `protobuf:"bytes,1,opt,name=asin,proto3" json:"asin,omitempty"` + Beer *Beer `protobuf:"bytes,2,opt,name=beer,proto3" json:"beer,omitempty"` +} + +func (x *UpdateBeerRequest) Reset() { + *x = UpdateBeerRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_beer_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateBeerRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateBeerRequest) ProtoMessage() {} + +func (x *UpdateBeerRequest) ProtoReflect() protoreflect.Message { + mi := &file_beer_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateBeerRequest.ProtoReflect.Descriptor instead. +func (*UpdateBeerRequest) Descriptor() ([]byte, []int) { + return file_beer_proto_rawDescGZIP(), []int{5} +} + +func (x *UpdateBeerRequest) GetAsin() string { + if x != nil { + return x.Asin + } + return "" +} + +func (x *UpdateBeerRequest) GetBeer() *Beer { + if x != nil { + return x.Beer + } + return nil +} + +type DeleteBeerRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Asin string `protobuf:"bytes,1,opt,name=asin,proto3" json:"asin,omitempty"` +} + +func (x *DeleteBeerRequest) Reset() { + *x = DeleteBeerRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_beer_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteBeerRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteBeerRequest) ProtoMessage() {} + +func (x *DeleteBeerRequest) ProtoReflect() protoreflect.Message { + mi := &file_beer_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteBeerRequest.ProtoReflect.Descriptor instead. +func (*DeleteBeerRequest) Descriptor() ([]byte, []int) { + return file_beer_proto_rawDescGZIP(), []int{6} +} + +func (x *DeleteBeerRequest) GetAsin() string { + if x != nil { + return x.Asin + } + return "" +} + +var File_beer_proto protoreflect.FileDescriptor + +var file_beer_proto_rawDesc = []byte{ + 0x0a, 0x0a, 0x62, 0x65, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x62, 0x65, + 0x65, 0x72, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0xdb, 0x01, 0x0a, 0x04, 0x42, 0x65, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x73, 0x69, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x73, 0x69, 0x6e, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x14, 0x0a, 0x05, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, + 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, + 0x12, 0x18, 0x0a, 0x07, 0x61, 0x6c, 0x63, 0x6f, 0x68, 0x6f, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x02, 0x52, 0x07, 0x61, 0x6c, 0x63, 0x6f, 0x68, 0x6f, 0x6c, 0x12, 0x27, 0x0a, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x62, 0x65, 0x65, 0x72, 0x2e, + 0x42, 0x65, 0x65, 0x72, 0x2e, 0x42, 0x65, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x22, 0x38, 0x0a, 0x08, 0x42, 0x65, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x11, 0x0a, 0x0d, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x50, 0x61, 0x6c, 0x65, 0x41, 0x6c, 0x65, + 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x70, 0x61, + 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x4c, 0x61, 0x67, 0x65, 0x72, 0x10, 0x02, 0x22, 0x34, 0x0a, + 0x10, 0x47, 0x65, 0x74, 0x42, 0x65, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x20, 0x0a, 0x05, 0x62, 0x65, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x0a, 0x2e, 0x62, 0x65, 0x65, 0x72, 0x2e, 0x42, 0x65, 0x65, 0x72, 0x52, 0x05, 0x62, 0x65, + 0x65, 0x72, 0x73, 0x22, 0x24, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x42, 0x65, 0x65, 0x72, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x73, 0x69, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x73, 0x69, 0x6e, 0x22, 0x31, 0x0a, 0x0f, 0x47, 0x65, 0x74, + 0x42, 0x65, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x04, + 0x62, 0x65, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x62, 0x65, 0x65, + 0x72, 0x2e, 0x42, 0x65, 0x65, 0x72, 0x52, 0x04, 0x62, 0x65, 0x65, 0x72, 0x22, 0x33, 0x0a, 0x11, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x1e, 0x0a, 0x04, 0x62, 0x65, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0a, 0x2e, 0x62, 0x65, 0x65, 0x72, 0x2e, 0x42, 0x65, 0x65, 0x72, 0x52, 0x04, 0x62, 0x65, 0x65, + 0x72, 0x22, 0x47, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x65, 0x65, 0x72, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x73, 0x69, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x73, 0x69, 0x6e, 0x12, 0x1e, 0x0a, 0x04, 0x62, 0x65, + 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x62, 0x65, 0x65, 0x72, 0x2e, + 0x42, 0x65, 0x65, 0x72, 0x52, 0x04, 0x62, 0x65, 0x65, 0x72, 0x22, 0x27, 0x0a, 0x11, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x42, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x12, 0x0a, 0x04, 0x61, 0x73, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, + 0x73, 0x69, 0x6e, 0x32, 0xc8, 0x02, 0x0a, 0x0b, 0x42, 0x65, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x3c, 0x0a, 0x08, 0x41, 0x6c, 0x6c, 0x42, 0x65, 0x65, 0x72, 0x73, 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, 0x16, 0x2e, 0x62, 0x65, 0x65, 0x72, 0x2e, 0x47, + 0x65, 0x74, 0x42, 0x65, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x38, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x42, 0x65, 0x65, 0x72, 0x12, 0x14, 0x2e, 0x62, + 0x65, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x62, 0x65, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x65, 0x65, + 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x0a, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x65, 0x65, 0x72, 0x12, 0x17, 0x2e, 0x62, 0x65, 0x65, 0x72, + 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x0a, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x65, 0x65, 0x72, 0x12, 0x17, 0x2e, 0x62, 0x65, 0x65, + 0x72, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x3f, 0x0a, + 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x65, 0x65, 0x72, 0x12, 0x17, 0x2e, 0x62, 0x65, + 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x42, 0x3e, + 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x72, 0x65, + 0x69, 0x6d, 0x65, 0x72, 0x2f, 0x66, 0x72, 0x6f, 0x6d, 0x2d, 0x72, 0x65, 0x73, 0x74, 0x2d, 0x74, + 0x6f, 0x2d, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x62, 0x65, 0x65, 0x72, + 0x2d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_beer_proto_rawDescOnce sync.Once + file_beer_proto_rawDescData = file_beer_proto_rawDesc +) + +func file_beer_proto_rawDescGZIP() []byte { + file_beer_proto_rawDescOnce.Do(func() { + file_beer_proto_rawDescData = protoimpl.X.CompressGZIP(file_beer_proto_rawDescData) + }) + return file_beer_proto_rawDescData +} + +var file_beer_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_beer_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_beer_proto_goTypes = []interface{}{ + (Beer_BeerType)(0), // 0: beer.Beer.BeerType + (*Beer)(nil), // 1: beer.Beer + (*GetBeersResponse)(nil), // 2: beer.GetBeersResponse + (*GetBeerRequest)(nil), // 3: beer.GetBeerRequest + (*GetBeerResponse)(nil), // 4: beer.GetBeerResponse + (*CreateBeerRequest)(nil), // 5: beer.CreateBeerRequest + (*UpdateBeerRequest)(nil), // 6: beer.UpdateBeerRequest + (*DeleteBeerRequest)(nil), // 7: beer.DeleteBeerRequest + (*emptypb.Empty)(nil), // 8: google.protobuf.Empty +} +var file_beer_proto_depIdxs = []int32{ + 0, // 0: beer.Beer.type:type_name -> beer.Beer.BeerType + 1, // 1: beer.GetBeersResponse.beers:type_name -> beer.Beer + 1, // 2: beer.GetBeerResponse.beer:type_name -> beer.Beer + 1, // 3: beer.CreateBeerRequest.beer:type_name -> beer.Beer + 1, // 4: beer.UpdateBeerRequest.beer:type_name -> beer.Beer + 8, // 5: beer.BeerService.AllBeers:input_type -> google.protobuf.Empty + 3, // 6: beer.BeerService.GetBeer:input_type -> beer.GetBeerRequest + 5, // 7: beer.BeerService.CreateBeer:input_type -> beer.CreateBeerRequest + 6, // 8: beer.BeerService.UpdateBeer:input_type -> beer.UpdateBeerRequest + 7, // 9: beer.BeerService.DeleteBeer:input_type -> beer.DeleteBeerRequest + 2, // 10: beer.BeerService.AllBeers:output_type -> beer.GetBeersResponse + 4, // 11: beer.BeerService.GetBeer:output_type -> beer.GetBeerResponse + 8, // 12: beer.BeerService.CreateBeer:output_type -> google.protobuf.Empty + 8, // 13: beer.BeerService.UpdateBeer:output_type -> google.protobuf.Empty + 8, // 14: beer.BeerService.DeleteBeer:output_type -> google.protobuf.Empty + 10, // [10:15] is the sub-list for method output_type + 5, // [5:10] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_beer_proto_init() } +func file_beer_proto_init() { + if File_beer_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_beer_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Beer); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_beer_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetBeersResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_beer_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetBeerRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_beer_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetBeerResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_beer_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateBeerRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_beer_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateBeerRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_beer_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteBeerRequest); 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{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_beer_proto_rawDesc, + NumEnums: 1, + NumMessages: 7, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_beer_proto_goTypes, + DependencyIndexes: file_beer_proto_depIdxs, + EnumInfos: file_beer_proto_enumTypes, + MessageInfos: file_beer_proto_msgTypes, + }.Build() + File_beer_proto = out.File + file_beer_proto_rawDesc = nil + file_beer_proto_goTypes = nil + file_beer_proto_depIdxs = nil +} diff --git a/grpc-beer-service/proto/beer_grpc.pb.go b/grpc-beer-service/proto/beer_grpc.pb.go new file mode 100644 index 0000000..fbf7e8b --- /dev/null +++ b/grpc-beer-service/proto/beer_grpc.pb.go @@ -0,0 +1,256 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package proto + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// 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 + +// BeerServiceClient is the client API for BeerService service. +// +// 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 BeerServiceClient interface { + // Get the list of all beers + AllBeers(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetBeersResponse, error) + // Get a single beer by Asin + GetBeer(ctx context.Context, in *GetBeerRequest, opts ...grpc.CallOption) (*GetBeerResponse, error) + // Create a new beer + CreateBeer(ctx context.Context, in *CreateBeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Update an existing beer + UpdateBeer(ctx context.Context, in *UpdateBeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Delete an existing beeer + DeleteBeer(ctx context.Context, in *DeleteBeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) +} + +type beerServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewBeerServiceClient(cc grpc.ClientConnInterface) BeerServiceClient { + return &beerServiceClient{cc} +} + +func (c *beerServiceClient) AllBeers(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetBeersResponse, error) { + out := new(GetBeersResponse) + err := c.cc.Invoke(ctx, "/beer.BeerService/AllBeers", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *beerServiceClient) GetBeer(ctx context.Context, in *GetBeerRequest, opts ...grpc.CallOption) (*GetBeerResponse, error) { + out := new(GetBeerResponse) + err := c.cc.Invoke(ctx, "/beer.BeerService/GetBeer", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *beerServiceClient) CreateBeer(ctx context.Context, in *CreateBeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/beer.BeerService/CreateBeer", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *beerServiceClient) UpdateBeer(ctx context.Context, in *UpdateBeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/beer.BeerService/UpdateBeer", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *beerServiceClient) DeleteBeer(ctx context.Context, in *DeleteBeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/beer.BeerService/DeleteBeer", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// BeerServiceServer is the server API for BeerService service. +// All implementations must embed UnimplementedBeerServiceServer +// for forward compatibility +type BeerServiceServer interface { + // Get the list of all beers + AllBeers(context.Context, *emptypb.Empty) (*GetBeersResponse, error) + // Get a single beer by Asin + GetBeer(context.Context, *GetBeerRequest) (*GetBeerResponse, error) + // Create a new beer + CreateBeer(context.Context, *CreateBeerRequest) (*emptypb.Empty, error) + // Update an existing beer + UpdateBeer(context.Context, *UpdateBeerRequest) (*emptypb.Empty, error) + // Delete an existing beeer + DeleteBeer(context.Context, *DeleteBeerRequest) (*emptypb.Empty, error) + mustEmbedUnimplementedBeerServiceServer() +} + +// UnimplementedBeerServiceServer must be embedded to have forward compatible implementations. +type UnimplementedBeerServiceServer struct { +} + +func (UnimplementedBeerServiceServer) AllBeers(context.Context, *emptypb.Empty) (*GetBeersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AllBeers not implemented") +} +func (UnimplementedBeerServiceServer) GetBeer(context.Context, *GetBeerRequest) (*GetBeerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetBeer not implemented") +} +func (UnimplementedBeerServiceServer) CreateBeer(context.Context, *CreateBeerRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateBeer not implemented") +} +func (UnimplementedBeerServiceServer) UpdateBeer(context.Context, *UpdateBeerRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateBeer not implemented") +} +func (UnimplementedBeerServiceServer) DeleteBeer(context.Context, *DeleteBeerRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteBeer not implemented") +} +func (UnimplementedBeerServiceServer) mustEmbedUnimplementedBeerServiceServer() {} + +// UnsafeBeerServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to BeerServiceServer will +// result in compilation errors. +type UnsafeBeerServiceServer interface { + mustEmbedUnimplementedBeerServiceServer() +} + +func RegisterBeerServiceServer(s grpc.ServiceRegistrar, srv BeerServiceServer) { + s.RegisterService(&BeerService_ServiceDesc, srv) +} + +func _BeerService_AllBeers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(emptypb.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BeerServiceServer).AllBeers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/beer.BeerService/AllBeers", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BeerServiceServer).AllBeers(ctx, req.(*emptypb.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _BeerService_GetBeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetBeerRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BeerServiceServer).GetBeer(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/beer.BeerService/GetBeer", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BeerServiceServer).GetBeer(ctx, req.(*GetBeerRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BeerService_CreateBeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateBeerRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BeerServiceServer).CreateBeer(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/beer.BeerService/CreateBeer", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BeerServiceServer).CreateBeer(ctx, req.(*CreateBeerRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BeerService_UpdateBeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateBeerRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BeerServiceServer).UpdateBeer(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/beer.BeerService/UpdateBeer", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BeerServiceServer).UpdateBeer(ctx, req.(*UpdateBeerRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BeerService_DeleteBeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteBeerRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BeerServiceServer).DeleteBeer(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/beer.BeerService/DeleteBeer", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BeerServiceServer).DeleteBeer(ctx, req.(*DeleteBeerRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// BeerService_ServiceDesc is the grpc.ServiceDesc for BeerService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var BeerService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "beer.BeerService", + HandlerType: (*BeerServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "AllBeers", + Handler: _BeerService_AllBeers_Handler, + }, + { + MethodName: "GetBeer", + Handler: _BeerService_GetBeer_Handler, + }, + { + MethodName: "CreateBeer", + Handler: _BeerService_CreateBeer_Handler, + }, + { + MethodName: "UpdateBeer", + Handler: _BeerService_UpdateBeer_Handler, + }, + { + MethodName: "DeleteBeer", + Handler: _BeerService_DeleteBeer_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "beer.proto", +} From e56150219479f325fffb4305e095618e9181aa38 Mon Sep 17 00:00:00 2001 From: Andreas Zitzelsberger Date: Tue, 9 Aug 2022 18:32:17 +0200 Subject: [PATCH 12/12] Proper cleanup and installation of buf deps Generated sources are kept to allow participants to move on should there be obstacles --- grpc-beer-gateway/Makefile | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/grpc-beer-gateway/Makefile b/grpc-beer-gateway/Makefile index 405ffed..deb6c2b 100644 --- a/grpc-beer-gateway/Makefile +++ b/grpc-beer-gateway/Makefile @@ -1,13 +1,36 @@ NAME = grpc-beer-gateway +# This requires Bash version >= 4 +SHELL:= /usr/bin/env bash -O globstar +# This will work with legacy versions of Bash without globstar +# SHELL:= /usr/bin/env bash + default: build +.PHONY: image image: - @docker build -t qaware/$(NAME) . + docker build -t $(NAME) . + +.PHONY: build +build: $(NAME) + +$(NAME): proto/beer.pb.go + go build + +proto/beer.pb.go: + buf generate -build: - @buf generate - @go build +.PHONY: install-grpc-gateway +install-grpc-gateway: + go install \ main !12 ?3 + github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway \ + github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2 \ + google.golang.org/protobuf/cmd/protoc-gen-go \ + google.golang.org/grpc/cmd/protoc-gen-go-grpc +.PHONY: clean clean: - @rm -f $(NAME) \ No newline at end of file + rm -f proto/**/*.pb.go + rm -f proto/**/*.pb.gw.go + rm -rf openapiv2 + rm -f $(NAME) \ No newline at end of file