diff --git a/.gitignore b/.gitignore index 8b2580f..8761bf4 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ pkg/ .vscode/ .vs/slnx.sqlite .vs/microservices-demo/v15/.suo +.idea diff --git a/kubernetes-manifests/adsservice.yaml b/kubernetes-manifests/adservice.yaml similarity index 91% rename from kubernetes-manifests/adsservice.yaml rename to kubernetes-manifests/adservice.yaml index 096c4e2..70faa9d 100644 --- a/kubernetes-manifests/adsservice.yaml +++ b/kubernetes-manifests/adservice.yaml @@ -15,17 +15,17 @@ apiVersion: extensions/v1beta1 kind: Deployment metadata: - name: adsservice + name: adservice spec: template: metadata: labels: - app: adsservice + app: adservice spec: terminationGracePeriodSeconds: 5 containers: - name: server - image: gcr.io/istio-next/adsservice + image: gcr.io/opencensus-java-stats-demo-app/adservice ports: - containerPort: 9555 env: @@ -56,11 +56,11 @@ spec: apiVersion: v1 kind: Service metadata: - name: adsservice + name: adservice spec: type: ClusterIP selector: - app: adsservice + app: adservice ports: - name: grpc port: 9555 diff --git a/kubernetes-manifests/cartservice.yaml b/kubernetes-manifests/cartservice.yaml index 178b8dd..cbaf823 100644 --- a/kubernetes-manifests/cartservice.yaml +++ b/kubernetes-manifests/cartservice.yaml @@ -25,7 +25,7 @@ spec: terminationGracePeriodSeconds: 5 containers: - name: server - image: gcr.io/microservices-demo-app/cartservice + image: gcr.io/opencensus-java-stats-demo-app/cartservice ports: - containerPort: 7070 env: diff --git a/kubernetes-manifests/checkoutservice.yaml b/kubernetes-manifests/checkoutservice.yaml index b78048a..0c4379e 100644 --- a/kubernetes-manifests/checkoutservice.yaml +++ b/kubernetes-manifests/checkoutservice.yaml @@ -24,7 +24,7 @@ spec: spec: containers: - name: server - image: gcr.io/microservices-demo-app/checkoutservice + image: gcr.io/opencensus-java-stats-demo-app/checkoutservice ports: - containerPort: 5050 readinessProbe: diff --git a/kubernetes-manifests/currencyservice.yaml b/kubernetes-manifests/currencyservice.yaml index b08121c..932336e 100644 --- a/kubernetes-manifests/currencyservice.yaml +++ b/kubernetes-manifests/currencyservice.yaml @@ -25,7 +25,7 @@ spec: terminationGracePeriodSeconds: 5 containers: - name: server - image: gcr.io/microservices-demo-app/currencyservice + image: gcr.io/opencensus-java-stats-demo-app/currencyservice ports: - name: grpc containerPort: 7000 diff --git a/kubernetes-manifests/emailservice.yaml b/kubernetes-manifests/emailservice.yaml index 83e9c77..9ffca24 100644 --- a/kubernetes-manifests/emailservice.yaml +++ b/kubernetes-manifests/emailservice.yaml @@ -25,7 +25,7 @@ spec: terminationGracePeriodSeconds: 5 containers: - name: server - image: gcr.io/microservices-demo-app/emailservice + image: gcr.io/opencensus-java-stats-demo-app/emailservice ports: - containerPort: 8080 readinessProbe: diff --git a/kubernetes-manifests/frontend.yaml b/kubernetes-manifests/frontend.yaml index 4f62e77..532c878 100644 --- a/kubernetes-manifests/frontend.yaml +++ b/kubernetes-manifests/frontend.yaml @@ -24,7 +24,7 @@ spec: spec: containers: - name: server - image: gcr.io/microservices-demo-app/frontend + image: gcr.io/opencensus-java-stats-demo-app/frontend ports: - containerPort: 8080 readinessProbe: diff --git a/kubernetes-manifests/loadgenerator.yaml b/kubernetes-manifests/loadgenerator.yaml index ee84c3a..9ff26a6 100644 --- a/kubernetes-manifests/loadgenerator.yaml +++ b/kubernetes-manifests/loadgenerator.yaml @@ -38,7 +38,7 @@ spec: value: "frontend:80" containers: - name: main - image: gcr.io/microservices-demo-app/loadgenerator + image: gcr.io/opencensus-java-stats-demo-app/loadgenerator env: - name: FRONTEND_ADDR value: "frontend:80" diff --git a/kubernetes-manifests/paymentservice.yaml b/kubernetes-manifests/paymentservice.yaml index 8664d3c..be4c875 100644 --- a/kubernetes-manifests/paymentservice.yaml +++ b/kubernetes-manifests/paymentservice.yaml @@ -25,7 +25,7 @@ spec: terminationGracePeriodSeconds: 5 containers: - name: server - image: gcr.io/microservices-demo-app/paymentservice + image: gcr.io/opencensus-java-stats-demo-app/paymentservice ports: - containerPort: 50051 readinessProbe: diff --git a/kubernetes-manifests/productcatalogservice.yaml b/kubernetes-manifests/productcatalogservice.yaml index 45b5f88..1d1074f 100644 --- a/kubernetes-manifests/productcatalogservice.yaml +++ b/kubernetes-manifests/productcatalogservice.yaml @@ -25,7 +25,7 @@ spec: terminationGracePeriodSeconds: 5 containers: - name: server - image: gcr.io/microservices-demo-app/productcatalogservice + image: gcr.io/opencensus-java-stats-demo-app/productcatalogservice ports: - containerPort: 3550 readinessProbe: diff --git a/kubernetes-manifests/recommendationservice.yaml b/kubernetes-manifests/recommendationservice.yaml index 18a7103..18ab9c2 100644 --- a/kubernetes-manifests/recommendationservice.yaml +++ b/kubernetes-manifests/recommendationservice.yaml @@ -25,7 +25,7 @@ spec: terminationGracePeriodSeconds: 5 containers: - name: server - image: gcr.io/microservices-demo-app/recommendationservice + image: gcr.io/opencensus-java-stats-demo-app/recommendationservice ports: - containerPort: 8080 readinessProbe: diff --git a/kubernetes-manifests/shippingservice.yaml b/kubernetes-manifests/shippingservice.yaml index dd78165..e2389dc 100644 --- a/kubernetes-manifests/shippingservice.yaml +++ b/kubernetes-manifests/shippingservice.yaml @@ -24,7 +24,7 @@ spec: spec: containers: - name: server - image: gcr.io/microservices-demo-app/shippingservice + image: gcr.io/opencensus-java-stats-demo-app/shippingservice ports: - containerPort: 50051 readinessProbe: diff --git a/pb/demo.proto b/pb/demo.proto index 11b8c29..09e5e4d 100644 --- a/pb/demo.proto +++ b/pb/demo.proto @@ -218,18 +218,18 @@ message PlaceOrderResponse { OrderResult order = 1; } -// ------------Ads service------------------ +// ------------Ad service------------------ -service AdsService { - rpc GetAds(AdsRequest) returns (AdsResponse) {} +service AdService { + rpc GetAds(AdRequest) returns (AdResponse) {} } -message AdsRequest { +message AdRequest { // List of important key words from the current page describing the context. repeated string context_keys = 1; } -message AdsResponse { +message AdResponse { repeated Ad ads = 1; } diff --git a/skaffold-adservice.yaml b/skaffold-adservice.yaml new file mode 100644 index 0000000..0947916 --- /dev/null +++ b/skaffold-adservice.yaml @@ -0,0 +1,26 @@ +# Copyright 2018 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: skaffold/v1alpha2 +kind: Config +build: + tagPolicy: + gitCommit: {} + artifacts: + - imageName: gcr.io/opencensus-java-stats-demo-app/adservice + workspace: src/adservice +deploy: + kubectl: + manifests: + - ./kubernetes-manifests/**.yaml diff --git a/skaffold.yaml b/skaffold.yaml index 250ca96..893d511 100644 --- a/skaffold.yaml +++ b/skaffold.yaml @@ -18,27 +18,27 @@ build: tagPolicy: gitCommit: {} artifacts: - - imageName: gcr.io/microservices-demo-app/emailservice + - imageName: gcr.io/opencensus-java-stats-demo-app/emailservice workspace: src/emailservice - - imageName: gcr.io/microservices-demo-app/productcatalogservice + - imageName: gcr.io/opencensus-java-stats-demo-app/productcatalogservice workspace: src/productcatalogservice - - imageName: gcr.io/microservices-demo-app/recommendationservice + - imageName: gcr.io/opencensus-java-stats-demo-app/recommendationservice workspace: src/recommendationservice - - imageName: gcr.io/microservices-demo-app/shippingservice + - imageName: gcr.io/opencensus-java-stats-demo-app/shippingservice workspace: src/shippingservice - - imageName: gcr.io/microservices-demo-app/checkoutservice + - imageName: gcr.io/opencensus-java-stats-demo-app/checkoutservice workspace: src/checkoutservice - - imageName: gcr.io/microservices-demo-app/paymentservice + - imageName: gcr.io/opencensus-java-stats-demo-app/paymentservice workspace: src/paymentservice - - imageName: gcr.io/microservices-demo-app/currencyservice + - imageName: gcr.io/opencensus-java-stats-demo-app/currencyservice workspace: src/currencyservice - - imageName: gcr.io/microservices-demo-app/cartservice + - imageName: gcr.io/opencensus-java-stats-demo-app/cartservice workspace: src/cartservice - - imageName: gcr.io/istio-next/adsservice - workspace: src/adsservice - - imageName: gcr.io/microservices-demo-app/frontend + - imageName: gcr.io/opencensus-java-stats-demo-app/adservice + workspace: src/adservice + - imageName: gcr.io/opencensus-java-stats-demo-app/frontend workspace: src/frontend - - imageName: gcr.io/microservices-demo-app/loadgenerator + - imageName: gcr.io/opencensus-java-stats-demo-app/loadgenerator workspace: src/loadgenerator deploy: kubectl: diff --git a/src/adsservice/.gitignore b/src/adservice/.gitignore similarity index 69% rename from src/adsservice/.gitignore rename to src/adservice/.gitignore index 69caab2..1809715 100644 --- a/src/adsservice/.gitignore +++ b/src/adservice/.gitignore @@ -4,7 +4,5 @@ .gradle/** .idea/** build/** -gradle/** -gradlew.bat diff --git a/src/adservice/Dockerfile b/src/adservice/Dockerfile new file mode 100644 index 0000000..fe65dad --- /dev/null +++ b/src/adservice/Dockerfile @@ -0,0 +1,13 @@ +# adsservice +FROM openjdk:8 +RUN apt-get update && apt-get install net-tools telnet +WORKDIR /app +COPY ["build.gradle", "gradlew", "./"] +COPY gradle gradle +RUN ./gradlew downloadRepos + +COPY . . +RUN ./gradlew installDist +EXPOSE 9555 +ENTRYPOINT ["/app/build/install/hipstershop/bin/AdService"] +#ENTRYPOINT ["tail", "-f", "/dev/null"] diff --git a/src/adsservice/build.gradle b/src/adservice/build.gradle similarity index 50% rename from src/adsservice/build.gradle rename to src/adservice/build.gradle index b6554c2..32d6dbc 100644 --- a/src/adsservice/build.gradle +++ b/src/adservice/build.gradle @@ -1,4 +1,4 @@ -description = 'OpenCensus Examples' +description = 'Ad Service' buildscript { repositories { @@ -34,19 +34,28 @@ tasks.withType(JavaCompile) { targetCompatibility = '1.8' } -dependencies { - compile "com.google.api.grpc:proto-google-common-protos:1.11.0", - "io.opencensus:opencensus-exporter-stats-prometheus:${opencensusVersion}", - "io.opencensus:opencensus-exporter-stats-stackdriver:${opencensusVersion}", - "io.opencensus:opencensus-exporter-trace-stackdriver:${opencensusVersion}", - "io.opencensus:opencensus-exporter-trace-logging:${opencensusVersion}", - "io.grpc:grpc-protobuf:${grpcVersion}", - "io.grpc:grpc-stub:${grpcVersion}", - "io.grpc:grpc-netty:${grpcVersion}", - "io.prometheus:simpleclient_httpserver:${prometheusVersion}" +ext { + speed = project.hasProperty('speed') ? project.getProperty('speed') : false + offlineCompile = new File("$buildDir/output/lib") +} - runtime "io.opencensus:opencensus-impl:${opencensusVersion}", - "io.netty:netty-tcnative-boringssl-static:2.0.8.Final" +dependencies { + if (speed) { + compile fileTree(dir: offlineCompile, include: '*.jar') + } else { + compile "com.google.api.grpc:proto-google-common-protos:1.11.0", + "io.opencensus:opencensus-exporter-stats-prometheus:${opencensusVersion}", + "io.opencensus:opencensus-exporter-stats-stackdriver:${opencensusVersion}", + "io.opencensus:opencensus-exporter-trace-stackdriver:${opencensusVersion}", + "io.opencensus:opencensus-exporter-trace-logging:${opencensusVersion}", + "io.grpc:grpc-protobuf:${grpcVersion}", + "io.grpc:grpc-stub:${grpcVersion}", + "io.grpc:grpc-netty:${grpcVersion}", + "io.prometheus:simpleclient_httpserver:${prometheusVersion}" + + runtime "io.opencensus:opencensus-impl:${opencensusVersion}", + "io.netty:netty-tcnative-boringssl-static:2.0.8.Final" + } } protobuf { @@ -71,7 +80,7 @@ sourceSets { main { java { srcDirs 'hipstershop' - srcDirs 'build/generated/source/proto/main/java' + srcDirs 'build/generated/source/proto/main/java/hipstershop' srcDirs 'build/generated/source/proto/main/grpc/hipstershop' } } @@ -82,22 +91,31 @@ apply plugin: 'application' startScripts.enabled = false -task adsService(type: CreateStartScripts) { - mainClassName = 'hipstershop.AdsService' - applicationName = 'AdsService' +// This to cache dependencies during Docker image building. First build will take time. +// Subsequent build will be incremental. +task downloadRepos(type: Copy) { + from configurations.compile + into offlineCompile + from configurations.runtime + into offlineCompile +} + +task adService(type: CreateStartScripts) { + mainClassName = 'hipstershop.AdService' + applicationName = 'AdService' outputDir = new File(project.buildDir, 'tmp') classpath = jar.outputs.files + project.configurations.runtime } -task adsServiceClient(type: CreateStartScripts) { - mainClassName = 'hipstershop.AdsServiceClient' - applicationName = 'AdsServiceClient' +task adServiceClient(type: CreateStartScripts) { + mainClassName = 'hipstershop.AdServiceClient' + applicationName = 'AdServiceClient' outputDir = new File(project.buildDir, 'tmp') classpath = jar.outputs.files + project.configurations.runtime } applicationDistribution.into('bin') { - from(adsService) - from(adsServiceClient) + from(adService) + from(adServiceClient) fileMode = 0755 } diff --git a/src/adservice/genproto.sh b/src/adservice/genproto.sh new file mode 100755 index 0000000..36525e0 --- /dev/null +++ b/src/adservice/genproto.sh @@ -0,0 +1,22 @@ +#!/bin/bash -eu +# +# Copyright 2018 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#!/bin/bash -e + +# protos are needed in adservice folder for compiling during Docker build. + +mkdir -p proto && \ +cp ../../pb/demo.proto src/main/proto diff --git a/src/adservice/gradle/wrapper/gradle-wrapper.jar b/src/adservice/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..01b8bf6 Binary files /dev/null and b/src/adservice/gradle/wrapper/gradle-wrapper.jar differ diff --git a/src/adservice/gradle/wrapper/gradle-wrapper.properties b/src/adservice/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..933b647 --- /dev/null +++ b/src/adservice/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-bin.zip diff --git a/src/adsservice/gradlew b/src/adservice/gradlew similarity index 100% rename from src/adsservice/gradlew rename to src/adservice/gradlew diff --git a/src/adservice/gradlew.bat b/src/adservice/gradlew.bat new file mode 100644 index 0000000..e95643d --- /dev/null +++ b/src/adservice/gradlew.bat @@ -0,0 +1,84 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/src/adservice/settings.gradle b/src/adservice/settings.gradle new file mode 100644 index 0000000..0bbe011 --- /dev/null +++ b/src/adservice/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'hipstershop' diff --git a/src/adservice/src/main/java/hipstershop/AdService.java b/src/adservice/src/main/java/hipstershop/AdService.java new file mode 100644 index 0000000..0ff91cb --- /dev/null +++ b/src/adservice/src/main/java/hipstershop/AdService.java @@ -0,0 +1,212 @@ +/* + * Copyright 2018, Google LLC. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package hipstershop; + +import com.google.common.collect.ImmutableMap; +import hipstershop.Demo.Ad; +import hipstershop.Demo.AdRequest; +import hipstershop.Demo.AdResponse; +import io.grpc.Server; +import io.grpc.ServerBuilder; +import io.grpc.StatusRuntimeException; +import io.grpc.stub.StreamObserver; +import io.opencensus.common.Duration; +import io.opencensus.common.Scope; +import io.opencensus.contrib.grpc.metrics.RpcViews; +import io.opencensus.exporter.stats.prometheus.PrometheusStatsCollector; +import io.opencensus.exporter.trace.logging.LoggingTraceExporter; +import io.opencensus.exporter.stats.stackdriver.StackdriverStatsConfiguration; +import io.opencensus.exporter.stats.stackdriver.StackdriverStatsExporter; +import io.opencensus.exporter.trace.stackdriver.StackdriverTraceConfiguration; +import io.opencensus.exporter.trace.stackdriver.StackdriverTraceExporter; +import io.opencensus.trace.AttributeValue; +import io.opencensus.trace.BlankSpan; +import io.opencensus.trace.Span; +import io.opencensus.trace.SpanBuilder; +import io.opencensus.trace.Status.CanonicalCode; +import io.opencensus.trace.Tracer; +import io.opencensus.trace.Tracing; +import io.opencensus.trace.samplers.Samplers; +import java.io.IOException; +import java.rmi.server.ExportException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.logging.Level; +import java.util.logging.Logger; + +public class AdService { + private static final Logger logger = Logger.getLogger(AdService.class.getName()); + + private static final Tracer tracer = Tracing.getTracer(); + + private int MAX_ADS_TO_SERVE = 2; + private Server server; + + static final AdService service = new AdService(); + private void start() throws IOException { + int port = Integer.parseInt(System.getenv("PORT")); + server = ServerBuilder.forPort(port).addService(new AdServiceImpl()).build().start(); + logger.info("Ad Service started, listening on " + port); + Runtime.getRuntime() + .addShutdownHook( + new Thread() { + @Override + public void run() { + // Use stderr here since the logger may have been reset by its JVM shutdown hook. + System.err.println("*** shutting down gRPC ads server since JVM is shutting down"); + AdService.this.stop(); + System.err.println("*** server shut down"); + } + }); + } + + private void stop() { + if (server != null) { + server.shutdown(); + } + } + + static class AdServiceImpl extends hipstershop.AdServiceGrpc.AdServiceImplBase { + + /** + * Retrieves ads based on context provided in the request {@code AdRequest}. + * + * @param req the request containing context. + * @param responseObserver the stream observer which gets notified with the value of + * {@code AdResponse} + */ + @Override + public void getAds(AdRequest req, StreamObserver responseObserver) { + AdService service = AdService.getInstance(); + Span parentSpan = tracer.getCurrentSpan(); + SpanBuilder spanBuilder = + tracer + .spanBuilderWithExplicitParent("Retrieve Ads", parentSpan) + .setRecordEvents(true) + .setSampler(Samplers.alwaysSample()); + try (Scope scope = spanBuilder.startScopedSpan()) { + Span span = tracer.getCurrentSpan(); + span.putAttribute("method", AttributeValue.stringAttributeValue("getAds")); + List ads = new ArrayList<>(); + if (req.getContextKeysCount() > 0) { + span.addAnnotation( + "Constructing Ads using context", + ImmutableMap.of( + "Context Keys", + AttributeValue.stringAttributeValue(req.getContextKeysList().toString()), + "Context Keys length", + AttributeValue.longAttributeValue(req.getContextKeysCount()))); + for (int i = 0; i < req.getContextKeysCount(); i++) { + Ad ad = service.getAdsByKey(req.getContextKeys(i)); + if (ad != null) { + ads.add(ad); + } + } + } else { + span.addAnnotation("No Context provided. Constructing random Ads."); + ads = service.getDefaultAds(); + } + if (ads.isEmpty()) { + // Serve default ads. + span.addAnnotation("No Ads found based on context. Constructing random Ads."); + ads = service.getDefaultAds(); + } + AdResponse reply = AdResponse.newBuilder().addAllAds(ads).build(); + responseObserver.onNext(reply); + responseObserver.onCompleted(); + } catch (StatusRuntimeException e) { + logger.log(Level.WARNING, "GetAds Failed", e.getStatus()); + return; + } + } + } + + static final HashMap cacheMap = new HashMap(); + + Ad getAdsByKey(String key) { + return cacheMap.get(key); + } + + + public List getDefaultAds() { + List ads = new ArrayList<>(MAX_ADS_TO_SERVE); + Object[] keys = cacheMap.keySet().toArray(); + for (int i=0; i responseObserver) { - logger.info("Servicing getAds"); - AdsService service = AdsService.getInstance(); - Span span = tracer.getCurrentSpan(); - span.putAttribute("method", AttributeValue.stringAttributeValue("getAds")); - span.addAnnotation( - "Constructing Ads Request.", - ImmutableMap.of( - "Context Keys", AttributeValue.stringAttributeValue(req.getContextKeysList().toString()), - "Context Keys length", AttributeValue.longAttributeValue(req.getContextKeysCount()))); - List ads = new ArrayList<>(); - if (req.getContextKeysCount() > 0) { - span.addAnnotation("Getting Ads by context."); - for (int i = 0; i cacheMap = new HashMap(); - - Ads getAdsByKey(String key) { - return cacheMap.get(key); - } - - - public List getDefaultAds() { - List ads = new ArrayList<>(); - Iterator iterator = cacheMap.entrySet().iterator(); - while (iterator.hasNext()) { - Map.Entry pair = (Map.Entry)iterator.next(); - ads.add((Ads)pair.getValue()); - if (ads.size() >= MAX_ADS_TO_SERVE) { - break; - } - } - return ads; - } - - public static AdsService getInstance() { - return service; - } - - /** Await termination on the main thread since the grpc library uses daemon threads. */ - private void blockUntilShutdown() throws InterruptedException { - if (server != null) { - server.awaitTermination(); - } - } - - static void initializeAds() { - String adsUrl = System.getenv("ADS_URL"); - cacheMap.put("camera", Ads.newBuilder().setRedirectUrl(adsUrl + "/camera") - .setText("MyPro camera for sale. 50% off.").build()); - cacheMap.put("bike", Ads.newBuilder().setRedirectUrl(adsUrl + "/bike") - .setText("ZoomZoom bike for sale. 10% off.").build()); - cacheMap.put("kitchen", Ads.newBuilder().setRedirectUrl(adsUrl + "/kitchen") - .setText("CutPro knife for sale. Buy one, get second set for free").build()); - logger.info("Default Ads initialized"); - } - - /** Main launches the server from the command line. */ - public static void main(String[] args) throws IOException, InterruptedException { - // Add final keyword to pass checkStyle. - final String cloudProjectId = System.getenv("GCP_PROJECT_ID"); - logger.info("GCP Project ID is " + cloudProjectId); - - initializeAds(); - - // Registers all RPC views. - RpcViews.registerAllViews(); - - // Registers logging trace exporter. - LoggingTraceExporter.register(); - - - // Registers Stackdriver exporters. - if (cloudProjectId != null) { - StackdriverTraceExporter.createAndRegister( - StackdriverTraceConfiguration.builder().setProjectId(cloudProjectId).build()); - StackdriverStatsExporter.createAndRegister( - StackdriverStatsConfiguration.builder() - .setProjectId(cloudProjectId) - .setExportInterval(Duration.create(15, 0)) - .build()); - } - - // Register Prometheus exporters and export metrics to a Prometheus HTTPServer. - PrometheusStatsCollector.createAndRegister(); - - // Start the RPC server. You shouldn't see any output from gRPC before this. - logger.info("AdsService starting."); - final AdsService service = AdsService.getInstance(); - service.start(); - service.blockUntilShutdown(); - } -} \ No newline at end of file diff --git a/src/adsservice/src/main/proto/demo.proto b/src/adsservice/src/main/proto/demo.proto deleted file mode 120000 index f3c47fb..0000000 --- a/src/adsservice/src/main/proto/demo.proto +++ /dev/null @@ -1 +0,0 @@ -../../../../../pb/demo.proto \ No newline at end of file diff --git a/src/frontend/genproto/demo.pb.go b/src/frontend/genproto/demo.pb.go index 5808777..e63e268 100644 --- a/src/frontend/genproto/demo.pb.go +++ b/src/frontend/genproto/demo.pb.go @@ -24,8 +24,8 @@ var _ = math.Inf const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type CartItem struct { - ProductId string `protobuf:"bytes,1,opt,name=product_id,json=productId" json:"product_id,omitempty"` - Quantity int32 `protobuf:"varint,2,opt,name=quantity" json:"quantity,omitempty"` + ProductId string `protobuf:"bytes,1,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` + Quantity int32 `protobuf:"varint,2,opt,name=quantity,proto3" json:"quantity,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -35,7 +35,7 @@ func (m *CartItem) Reset() { *m = CartItem{} } func (m *CartItem) String() string { return proto.CompactTextString(m) } func (*CartItem) ProtoMessage() {} func (*CartItem) Descriptor() ([]byte, []int) { - return fileDescriptor_demo_c812a73334c7ff0d, []int{0} + return fileDescriptor_demo_88bb8fdac9cd6be5, []int{0} } func (m *CartItem) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CartItem.Unmarshal(m, b) @@ -70,8 +70,8 @@ func (m *CartItem) GetQuantity() int32 { } type AddItemRequest struct { - UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId" json:"user_id,omitempty"` - Item *CartItem `protobuf:"bytes,2,opt,name=item" json:"item,omitempty"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + Item *CartItem `protobuf:"bytes,2,opt,name=item,proto3" json:"item,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -81,7 +81,7 @@ func (m *AddItemRequest) Reset() { *m = AddItemRequest{} } func (m *AddItemRequest) String() string { return proto.CompactTextString(m) } func (*AddItemRequest) ProtoMessage() {} func (*AddItemRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_demo_c812a73334c7ff0d, []int{1} + return fileDescriptor_demo_88bb8fdac9cd6be5, []int{1} } func (m *AddItemRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddItemRequest.Unmarshal(m, b) @@ -116,7 +116,7 @@ func (m *AddItemRequest) GetItem() *CartItem { } type EmptyCartRequest struct { - UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId" json:"user_id,omitempty"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -126,7 +126,7 @@ func (m *EmptyCartRequest) Reset() { *m = EmptyCartRequest{} } func (m *EmptyCartRequest) String() string { return proto.CompactTextString(m) } func (*EmptyCartRequest) ProtoMessage() {} func (*EmptyCartRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_demo_c812a73334c7ff0d, []int{2} + return fileDescriptor_demo_88bb8fdac9cd6be5, []int{2} } func (m *EmptyCartRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_EmptyCartRequest.Unmarshal(m, b) @@ -154,7 +154,7 @@ func (m *EmptyCartRequest) GetUserId() string { } type GetCartRequest struct { - UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId" json:"user_id,omitempty"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -164,7 +164,7 @@ func (m *GetCartRequest) Reset() { *m = GetCartRequest{} } func (m *GetCartRequest) String() string { return proto.CompactTextString(m) } func (*GetCartRequest) ProtoMessage() {} func (*GetCartRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_demo_c812a73334c7ff0d, []int{3} + return fileDescriptor_demo_88bb8fdac9cd6be5, []int{3} } func (m *GetCartRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetCartRequest.Unmarshal(m, b) @@ -192,8 +192,8 @@ func (m *GetCartRequest) GetUserId() string { } type Cart struct { - UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId" json:"user_id,omitempty"` - Items []*CartItem `protobuf:"bytes,2,rep,name=items" json:"items,omitempty"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + Items []*CartItem `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -203,7 +203,7 @@ func (m *Cart) Reset() { *m = Cart{} } func (m *Cart) String() string { return proto.CompactTextString(m) } func (*Cart) ProtoMessage() {} func (*Cart) Descriptor() ([]byte, []int) { - return fileDescriptor_demo_c812a73334c7ff0d, []int{4} + return fileDescriptor_demo_88bb8fdac9cd6be5, []int{4} } func (m *Cart) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Cart.Unmarshal(m, b) @@ -247,7 +247,7 @@ func (m *Empty) Reset() { *m = Empty{} } func (m *Empty) String() string { return proto.CompactTextString(m) } func (*Empty) ProtoMessage() {} func (*Empty) Descriptor() ([]byte, []int) { - return fileDescriptor_demo_c812a73334c7ff0d, []int{5} + return fileDescriptor_demo_88bb8fdac9cd6be5, []int{5} } func (m *Empty) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Empty.Unmarshal(m, b) @@ -268,8 +268,8 @@ func (m *Empty) XXX_DiscardUnknown() { var xxx_messageInfo_Empty proto.InternalMessageInfo type ListRecommendationsRequest struct { - UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId" json:"user_id,omitempty"` - ProductIds []string `protobuf:"bytes,2,rep,name=product_ids,json=productIds" json:"product_ids,omitempty"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + ProductIds []string `protobuf:"bytes,2,rep,name=product_ids,json=productIds,proto3" json:"product_ids,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -279,7 +279,7 @@ func (m *ListRecommendationsRequest) Reset() { *m = ListRecommendationsR func (m *ListRecommendationsRequest) String() string { return proto.CompactTextString(m) } func (*ListRecommendationsRequest) ProtoMessage() {} func (*ListRecommendationsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_demo_c812a73334c7ff0d, []int{6} + return fileDescriptor_demo_88bb8fdac9cd6be5, []int{6} } func (m *ListRecommendationsRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ListRecommendationsRequest.Unmarshal(m, b) @@ -314,7 +314,7 @@ func (m *ListRecommendationsRequest) GetProductIds() []string { } type ListRecommendationsResponse struct { - ProductIds []string `protobuf:"bytes,1,rep,name=product_ids,json=productIds" json:"product_ids,omitempty"` + ProductIds []string `protobuf:"bytes,1,rep,name=product_ids,json=productIds,proto3" json:"product_ids,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -324,7 +324,7 @@ func (m *ListRecommendationsResponse) Reset() { *m = ListRecommendations func (m *ListRecommendationsResponse) String() string { return proto.CompactTextString(m) } func (*ListRecommendationsResponse) ProtoMessage() {} func (*ListRecommendationsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_demo_c812a73334c7ff0d, []int{7} + return fileDescriptor_demo_88bb8fdac9cd6be5, []int{7} } func (m *ListRecommendationsResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ListRecommendationsResponse.Unmarshal(m, b) @@ -352,11 +352,11 @@ func (m *ListRecommendationsResponse) GetProductIds() []string { } type Product struct { - Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` - Picture string `protobuf:"bytes,4,opt,name=picture" json:"picture,omitempty"` - PriceUsd *Money `protobuf:"bytes,5,opt,name=price_usd,json=priceUsd" json:"price_usd,omitempty"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Picture string `protobuf:"bytes,4,opt,name=picture,proto3" json:"picture,omitempty"` + PriceUsd *Money `protobuf:"bytes,5,opt,name=price_usd,json=priceUsd,proto3" json:"price_usd,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -366,7 +366,7 @@ func (m *Product) Reset() { *m = Product{} } func (m *Product) String() string { return proto.CompactTextString(m) } func (*Product) ProtoMessage() {} func (*Product) Descriptor() ([]byte, []int) { - return fileDescriptor_demo_c812a73334c7ff0d, []int{8} + return fileDescriptor_demo_88bb8fdac9cd6be5, []int{8} } func (m *Product) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Product.Unmarshal(m, b) @@ -422,7 +422,7 @@ func (m *Product) GetPriceUsd() *Money { } type ListProductsResponse struct { - Products []*Product `protobuf:"bytes,1,rep,name=products" json:"products,omitempty"` + Products []*Product `protobuf:"bytes,1,rep,name=products,proto3" json:"products,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -432,7 +432,7 @@ func (m *ListProductsResponse) Reset() { *m = ListProductsResponse{} } func (m *ListProductsResponse) String() string { return proto.CompactTextString(m) } func (*ListProductsResponse) ProtoMessage() {} func (*ListProductsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_demo_c812a73334c7ff0d, []int{9} + return fileDescriptor_demo_88bb8fdac9cd6be5, []int{9} } func (m *ListProductsResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ListProductsResponse.Unmarshal(m, b) @@ -460,7 +460,7 @@ func (m *ListProductsResponse) GetProducts() []*Product { } type GetProductRequest struct { - Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -470,7 +470,7 @@ func (m *GetProductRequest) Reset() { *m = GetProductRequest{} } func (m *GetProductRequest) String() string { return proto.CompactTextString(m) } func (*GetProductRequest) ProtoMessage() {} func (*GetProductRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_demo_c812a73334c7ff0d, []int{10} + return fileDescriptor_demo_88bb8fdac9cd6be5, []int{10} } func (m *GetProductRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetProductRequest.Unmarshal(m, b) @@ -498,7 +498,7 @@ func (m *GetProductRequest) GetId() string { } type SearchProductsRequest struct { - Query string `protobuf:"bytes,1,opt,name=query" json:"query,omitempty"` + Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -508,7 +508,7 @@ func (m *SearchProductsRequest) Reset() { *m = SearchProductsRequest{} } func (m *SearchProductsRequest) String() string { return proto.CompactTextString(m) } func (*SearchProductsRequest) ProtoMessage() {} func (*SearchProductsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_demo_c812a73334c7ff0d, []int{11} + return fileDescriptor_demo_88bb8fdac9cd6be5, []int{11} } func (m *SearchProductsRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SearchProductsRequest.Unmarshal(m, b) @@ -536,7 +536,7 @@ func (m *SearchProductsRequest) GetQuery() string { } type SearchProductsResponse struct { - Results []*Product `protobuf:"bytes,1,rep,name=results" json:"results,omitempty"` + Results []*Product `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -546,7 +546,7 @@ func (m *SearchProductsResponse) Reset() { *m = SearchProductsResponse{} func (m *SearchProductsResponse) String() string { return proto.CompactTextString(m) } func (*SearchProductsResponse) ProtoMessage() {} func (*SearchProductsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_demo_c812a73334c7ff0d, []int{12} + return fileDescriptor_demo_88bb8fdac9cd6be5, []int{12} } func (m *SearchProductsResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SearchProductsResponse.Unmarshal(m, b) @@ -574,8 +574,8 @@ func (m *SearchProductsResponse) GetResults() []*Product { } type GetQuoteRequest struct { - Address *Address `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"` - Items []*CartItem `protobuf:"bytes,2,rep,name=items" json:"items,omitempty"` + Address *Address `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Items []*CartItem `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -585,7 +585,7 @@ func (m *GetQuoteRequest) Reset() { *m = GetQuoteRequest{} } func (m *GetQuoteRequest) String() string { return proto.CompactTextString(m) } func (*GetQuoteRequest) ProtoMessage() {} func (*GetQuoteRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_demo_c812a73334c7ff0d, []int{13} + return fileDescriptor_demo_88bb8fdac9cd6be5, []int{13} } func (m *GetQuoteRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetQuoteRequest.Unmarshal(m, b) @@ -620,7 +620,7 @@ func (m *GetQuoteRequest) GetItems() []*CartItem { } type GetQuoteResponse struct { - CostUsd *Money `protobuf:"bytes,1,opt,name=cost_usd,json=costUsd" json:"cost_usd,omitempty"` + CostUsd *Money `protobuf:"bytes,1,opt,name=cost_usd,json=costUsd,proto3" json:"cost_usd,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -630,7 +630,7 @@ func (m *GetQuoteResponse) Reset() { *m = GetQuoteResponse{} } func (m *GetQuoteResponse) String() string { return proto.CompactTextString(m) } func (*GetQuoteResponse) ProtoMessage() {} func (*GetQuoteResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_demo_c812a73334c7ff0d, []int{14} + return fileDescriptor_demo_88bb8fdac9cd6be5, []int{14} } func (m *GetQuoteResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetQuoteResponse.Unmarshal(m, b) @@ -658,8 +658,8 @@ func (m *GetQuoteResponse) GetCostUsd() *Money { } type ShipOrderRequest struct { - Address *Address `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"` - Items []*CartItem `protobuf:"bytes,2,rep,name=items" json:"items,omitempty"` + Address *Address `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Items []*CartItem `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -669,7 +669,7 @@ func (m *ShipOrderRequest) Reset() { *m = ShipOrderRequest{} } func (m *ShipOrderRequest) String() string { return proto.CompactTextString(m) } func (*ShipOrderRequest) ProtoMessage() {} func (*ShipOrderRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_demo_c812a73334c7ff0d, []int{15} + return fileDescriptor_demo_88bb8fdac9cd6be5, []int{15} } func (m *ShipOrderRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ShipOrderRequest.Unmarshal(m, b) @@ -704,7 +704,7 @@ func (m *ShipOrderRequest) GetItems() []*CartItem { } type ShipOrderResponse struct { - TrackingId string `protobuf:"bytes,1,opt,name=tracking_id,json=trackingId" json:"tracking_id,omitempty"` + TrackingId string `protobuf:"bytes,1,opt,name=tracking_id,json=trackingId,proto3" json:"tracking_id,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -714,7 +714,7 @@ func (m *ShipOrderResponse) Reset() { *m = ShipOrderResponse{} } func (m *ShipOrderResponse) String() string { return proto.CompactTextString(m) } func (*ShipOrderResponse) ProtoMessage() {} func (*ShipOrderResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_demo_c812a73334c7ff0d, []int{16} + return fileDescriptor_demo_88bb8fdac9cd6be5, []int{16} } func (m *ShipOrderResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ShipOrderResponse.Unmarshal(m, b) @@ -742,11 +742,11 @@ func (m *ShipOrderResponse) GetTrackingId() string { } type Address struct { - StreetAddress string `protobuf:"bytes,1,opt,name=street_address,json=streetAddress" json:"street_address,omitempty"` - City string `protobuf:"bytes,2,opt,name=city" json:"city,omitempty"` - State string `protobuf:"bytes,3,opt,name=state" json:"state,omitempty"` - Country string `protobuf:"bytes,4,opt,name=country" json:"country,omitempty"` - ZipCode int32 `protobuf:"varint,5,opt,name=zip_code,json=zipCode" json:"zip_code,omitempty"` + StreetAddress string `protobuf:"bytes,1,opt,name=street_address,json=streetAddress,proto3" json:"street_address,omitempty"` + City string `protobuf:"bytes,2,opt,name=city,proto3" json:"city,omitempty"` + State string `protobuf:"bytes,3,opt,name=state,proto3" json:"state,omitempty"` + Country string `protobuf:"bytes,4,opt,name=country,proto3" json:"country,omitempty"` + ZipCode int32 `protobuf:"varint,5,opt,name=zip_code,json=zipCode,proto3" json:"zip_code,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -756,7 +756,7 @@ func (m *Address) Reset() { *m = Address{} } func (m *Address) String() string { return proto.CompactTextString(m) } func (*Address) ProtoMessage() {} func (*Address) Descriptor() ([]byte, []int) { - return fileDescriptor_demo_c812a73334c7ff0d, []int{17} + return fileDescriptor_demo_88bb8fdac9cd6be5, []int{17} } func (m *Address) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Address.Unmarshal(m, b) @@ -814,17 +814,17 @@ func (m *Address) GetZipCode() int32 { // Represents an amount of money with its currency type. type Money struct { // The 3-letter currency code defined in ISO 4217. - CurrencyCode string `protobuf:"bytes,1,opt,name=currency_code,json=currencyCode" json:"currency_code,omitempty"` + CurrencyCode string `protobuf:"bytes,1,opt,name=currency_code,json=currencyCode,proto3" json:"currency_code,omitempty"` // The whole units of the amount. // For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. - Units int64 `protobuf:"varint,2,opt,name=units" json:"units,omitempty"` + Units int64 `protobuf:"varint,2,opt,name=units,proto3" json:"units,omitempty"` // Number of nano (10^-9) units of the amount. // The value must be between -999,999,999 and +999,999,999 inclusive. // If `units` is positive, `nanos` must be positive or zero. // If `units` is zero, `nanos` can be positive, zero, or negative. // If `units` is negative, `nanos` must be negative or zero. // For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. - Nanos int32 `protobuf:"varint,3,opt,name=nanos" json:"nanos,omitempty"` + Nanos int32 `protobuf:"varint,3,opt,name=nanos,proto3" json:"nanos,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -834,7 +834,7 @@ func (m *Money) Reset() { *m = Money{} } func (m *Money) String() string { return proto.CompactTextString(m) } func (*Money) ProtoMessage() {} func (*Money) Descriptor() ([]byte, []int) { - return fileDescriptor_demo_c812a73334c7ff0d, []int{18} + return fileDescriptor_demo_88bb8fdac9cd6be5, []int{18} } func (m *Money) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Money.Unmarshal(m, b) @@ -877,7 +877,7 @@ func (m *Money) GetNanos() int32 { type GetSupportedCurrenciesResponse struct { // The 3-letter currency code defined in ISO 4217. - CurrencyCodes []string `protobuf:"bytes,1,rep,name=currency_codes,json=currencyCodes" json:"currency_codes,omitempty"` + CurrencyCodes []string `protobuf:"bytes,1,rep,name=currency_codes,json=currencyCodes,proto3" json:"currency_codes,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -887,7 +887,7 @@ func (m *GetSupportedCurrenciesResponse) Reset() { *m = GetSupportedCurr func (m *GetSupportedCurrenciesResponse) String() string { return proto.CompactTextString(m) } func (*GetSupportedCurrenciesResponse) ProtoMessage() {} func (*GetSupportedCurrenciesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_demo_c812a73334c7ff0d, []int{19} + return fileDescriptor_demo_88bb8fdac9cd6be5, []int{19} } func (m *GetSupportedCurrenciesResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetSupportedCurrenciesResponse.Unmarshal(m, b) @@ -915,9 +915,9 @@ func (m *GetSupportedCurrenciesResponse) GetCurrencyCodes() []string { } type CurrencyConversionRequest struct { - From *Money `protobuf:"bytes,1,opt,name=from" json:"from,omitempty"` + From *Money `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` // The 3-letter currency code defined in ISO 4217. - ToCode string `protobuf:"bytes,2,opt,name=to_code,json=toCode" json:"to_code,omitempty"` + ToCode string `protobuf:"bytes,2,opt,name=to_code,json=toCode,proto3" json:"to_code,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -927,7 +927,7 @@ func (m *CurrencyConversionRequest) Reset() { *m = CurrencyConversionReq func (m *CurrencyConversionRequest) String() string { return proto.CompactTextString(m) } func (*CurrencyConversionRequest) ProtoMessage() {} func (*CurrencyConversionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_demo_c812a73334c7ff0d, []int{20} + return fileDescriptor_demo_88bb8fdac9cd6be5, []int{20} } func (m *CurrencyConversionRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CurrencyConversionRequest.Unmarshal(m, b) @@ -962,10 +962,10 @@ func (m *CurrencyConversionRequest) GetToCode() string { } type CreditCardInfo struct { - CreditCardNumber string `protobuf:"bytes,1,opt,name=credit_card_number,json=creditCardNumber" json:"credit_card_number,omitempty"` - CreditCardCvv int32 `protobuf:"varint,2,opt,name=credit_card_cvv,json=creditCardCvv" json:"credit_card_cvv,omitempty"` - CreditCardExpirationYear int32 `protobuf:"varint,3,opt,name=credit_card_expiration_year,json=creditCardExpirationYear" json:"credit_card_expiration_year,omitempty"` - CreditCardExpirationMonth int32 `protobuf:"varint,4,opt,name=credit_card_expiration_month,json=creditCardExpirationMonth" json:"credit_card_expiration_month,omitempty"` + CreditCardNumber string `protobuf:"bytes,1,opt,name=credit_card_number,json=creditCardNumber,proto3" json:"credit_card_number,omitempty"` + CreditCardCvv int32 `protobuf:"varint,2,opt,name=credit_card_cvv,json=creditCardCvv,proto3" json:"credit_card_cvv,omitempty"` + CreditCardExpirationYear int32 `protobuf:"varint,3,opt,name=credit_card_expiration_year,json=creditCardExpirationYear,proto3" json:"credit_card_expiration_year,omitempty"` + CreditCardExpirationMonth int32 `protobuf:"varint,4,opt,name=credit_card_expiration_month,json=creditCardExpirationMonth,proto3" json:"credit_card_expiration_month,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -975,7 +975,7 @@ func (m *CreditCardInfo) Reset() { *m = CreditCardInfo{} } func (m *CreditCardInfo) String() string { return proto.CompactTextString(m) } func (*CreditCardInfo) ProtoMessage() {} func (*CreditCardInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_demo_c812a73334c7ff0d, []int{21} + return fileDescriptor_demo_88bb8fdac9cd6be5, []int{21} } func (m *CreditCardInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CreditCardInfo.Unmarshal(m, b) @@ -1024,8 +1024,8 @@ func (m *CreditCardInfo) GetCreditCardExpirationMonth() int32 { } type ChargeRequest struct { - Amount *Money `protobuf:"bytes,1,opt,name=amount" json:"amount,omitempty"` - CreditCard *CreditCardInfo `protobuf:"bytes,2,opt,name=credit_card,json=creditCard" json:"credit_card,omitempty"` + Amount *Money `protobuf:"bytes,1,opt,name=amount,proto3" json:"amount,omitempty"` + CreditCard *CreditCardInfo `protobuf:"bytes,2,opt,name=credit_card,json=creditCard,proto3" json:"credit_card,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -1035,7 +1035,7 @@ func (m *ChargeRequest) Reset() { *m = ChargeRequest{} } func (m *ChargeRequest) String() string { return proto.CompactTextString(m) } func (*ChargeRequest) ProtoMessage() {} func (*ChargeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_demo_c812a73334c7ff0d, []int{22} + return fileDescriptor_demo_88bb8fdac9cd6be5, []int{22} } func (m *ChargeRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ChargeRequest.Unmarshal(m, b) @@ -1070,7 +1070,7 @@ func (m *ChargeRequest) GetCreditCard() *CreditCardInfo { } type ChargeResponse struct { - TransactionId string `protobuf:"bytes,1,opt,name=transaction_id,json=transactionId" json:"transaction_id,omitempty"` + TransactionId string `protobuf:"bytes,1,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -1080,7 +1080,7 @@ func (m *ChargeResponse) Reset() { *m = ChargeResponse{} } func (m *ChargeResponse) String() string { return proto.CompactTextString(m) } func (*ChargeResponse) ProtoMessage() {} func (*ChargeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_demo_c812a73334c7ff0d, []int{23} + return fileDescriptor_demo_88bb8fdac9cd6be5, []int{23} } func (m *ChargeResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ChargeResponse.Unmarshal(m, b) @@ -1108,8 +1108,8 @@ func (m *ChargeResponse) GetTransactionId() string { } type OrderItem struct { - Item *CartItem `protobuf:"bytes,1,opt,name=item" json:"item,omitempty"` - Cost *Money `protobuf:"bytes,2,opt,name=cost" json:"cost,omitempty"` + Item *CartItem `protobuf:"bytes,1,opt,name=item,proto3" json:"item,omitempty"` + Cost *Money `protobuf:"bytes,2,opt,name=cost,proto3" json:"cost,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -1119,7 +1119,7 @@ func (m *OrderItem) Reset() { *m = OrderItem{} } func (m *OrderItem) String() string { return proto.CompactTextString(m) } func (*OrderItem) ProtoMessage() {} func (*OrderItem) Descriptor() ([]byte, []int) { - return fileDescriptor_demo_c812a73334c7ff0d, []int{24} + return fileDescriptor_demo_88bb8fdac9cd6be5, []int{24} } func (m *OrderItem) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OrderItem.Unmarshal(m, b) @@ -1154,11 +1154,11 @@ func (m *OrderItem) GetCost() *Money { } type OrderResult struct { - OrderId string `protobuf:"bytes,1,opt,name=order_id,json=orderId" json:"order_id,omitempty"` - ShippingTrackingId string `protobuf:"bytes,2,opt,name=shipping_tracking_id,json=shippingTrackingId" json:"shipping_tracking_id,omitempty"` - ShippingCost *Money `protobuf:"bytes,3,opt,name=shipping_cost,json=shippingCost" json:"shipping_cost,omitempty"` - ShippingAddress *Address `protobuf:"bytes,4,opt,name=shipping_address,json=shippingAddress" json:"shipping_address,omitempty"` - Items []*OrderItem `protobuf:"bytes,5,rep,name=items" json:"items,omitempty"` + OrderId string `protobuf:"bytes,1,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"` + ShippingTrackingId string `protobuf:"bytes,2,opt,name=shipping_tracking_id,json=shippingTrackingId,proto3" json:"shipping_tracking_id,omitempty"` + ShippingCost *Money `protobuf:"bytes,3,opt,name=shipping_cost,json=shippingCost,proto3" json:"shipping_cost,omitempty"` + ShippingAddress *Address `protobuf:"bytes,4,opt,name=shipping_address,json=shippingAddress,proto3" json:"shipping_address,omitempty"` + Items []*OrderItem `protobuf:"bytes,5,rep,name=items,proto3" json:"items,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -1168,7 +1168,7 @@ func (m *OrderResult) Reset() { *m = OrderResult{} } func (m *OrderResult) String() string { return proto.CompactTextString(m) } func (*OrderResult) ProtoMessage() {} func (*OrderResult) Descriptor() ([]byte, []int) { - return fileDescriptor_demo_c812a73334c7ff0d, []int{25} + return fileDescriptor_demo_88bb8fdac9cd6be5, []int{25} } func (m *OrderResult) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OrderResult.Unmarshal(m, b) @@ -1224,8 +1224,8 @@ func (m *OrderResult) GetItems() []*OrderItem { } type SendOrderConfirmationRequest struct { - Email string `protobuf:"bytes,1,opt,name=email" json:"email,omitempty"` - Order *OrderResult `protobuf:"bytes,2,opt,name=order" json:"order,omitempty"` + Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"` + Order *OrderResult `protobuf:"bytes,2,opt,name=order,proto3" json:"order,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -1235,7 +1235,7 @@ func (m *SendOrderConfirmationRequest) Reset() { *m = SendOrderConfirmat func (m *SendOrderConfirmationRequest) String() string { return proto.CompactTextString(m) } func (*SendOrderConfirmationRequest) ProtoMessage() {} func (*SendOrderConfirmationRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_demo_c812a73334c7ff0d, []int{26} + return fileDescriptor_demo_88bb8fdac9cd6be5, []int{26} } func (m *SendOrderConfirmationRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SendOrderConfirmationRequest.Unmarshal(m, b) @@ -1270,11 +1270,11 @@ func (m *SendOrderConfirmationRequest) GetOrder() *OrderResult { } type PlaceOrderRequest struct { - UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId" json:"user_id,omitempty"` - UserCurrency string `protobuf:"bytes,2,opt,name=user_currency,json=userCurrency" json:"user_currency,omitempty"` - Address *Address `protobuf:"bytes,3,opt,name=address" json:"address,omitempty"` - Email string `protobuf:"bytes,5,opt,name=email" json:"email,omitempty"` - CreditCard *CreditCardInfo `protobuf:"bytes,6,opt,name=credit_card,json=creditCard" json:"credit_card,omitempty"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + UserCurrency string `protobuf:"bytes,2,opt,name=user_currency,json=userCurrency,proto3" json:"user_currency,omitempty"` + Address *Address `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"` + Email string `protobuf:"bytes,5,opt,name=email,proto3" json:"email,omitempty"` + CreditCard *CreditCardInfo `protobuf:"bytes,6,opt,name=credit_card,json=creditCard,proto3" json:"credit_card,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -1284,7 +1284,7 @@ func (m *PlaceOrderRequest) Reset() { *m = PlaceOrderRequest{} } func (m *PlaceOrderRequest) String() string { return proto.CompactTextString(m) } func (*PlaceOrderRequest) ProtoMessage() {} func (*PlaceOrderRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_demo_c812a73334c7ff0d, []int{27} + return fileDescriptor_demo_88bb8fdac9cd6be5, []int{27} } func (m *PlaceOrderRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PlaceOrderRequest.Unmarshal(m, b) @@ -1340,7 +1340,7 @@ func (m *PlaceOrderRequest) GetCreditCard() *CreditCardInfo { } type PlaceOrderResponse struct { - Order *OrderResult `protobuf:"bytes,1,opt,name=order" json:"order,omitempty"` + Order *OrderResult `protobuf:"bytes,1,opt,name=order,proto3" json:"order,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -1350,7 +1350,7 @@ func (m *PlaceOrderResponse) Reset() { *m = PlaceOrderResponse{} } func (m *PlaceOrderResponse) String() string { return proto.CompactTextString(m) } func (*PlaceOrderResponse) ProtoMessage() {} func (*PlaceOrderResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_demo_c812a73334c7ff0d, []int{28} + return fileDescriptor_demo_88bb8fdac9cd6be5, []int{28} } func (m *PlaceOrderResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PlaceOrderResponse.Unmarshal(m, b) @@ -1377,77 +1377,77 @@ func (m *PlaceOrderResponse) GetOrder() *OrderResult { return nil } -type AdsRequest struct { +type AdRequest struct { // List of important key words from the current page describing the context. - ContextKeys []string `protobuf:"bytes,1,rep,name=context_keys,json=contextKeys" json:"context_keys,omitempty"` + ContextKeys []string `protobuf:"bytes,1,rep,name=context_keys,json=contextKeys,proto3" json:"context_keys,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } -func (m *AdsRequest) Reset() { *m = AdsRequest{} } -func (m *AdsRequest) String() string { return proto.CompactTextString(m) } -func (*AdsRequest) ProtoMessage() {} -func (*AdsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_demo_c812a73334c7ff0d, []int{29} +func (m *AdRequest) Reset() { *m = AdRequest{} } +func (m *AdRequest) String() string { return proto.CompactTextString(m) } +func (*AdRequest) ProtoMessage() {} +func (*AdRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_demo_88bb8fdac9cd6be5, []int{29} } -func (m *AdsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AdsRequest.Unmarshal(m, b) +func (m *AdRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AdRequest.Unmarshal(m, b) } -func (m *AdsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AdsRequest.Marshal(b, m, deterministic) +func (m *AdRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AdRequest.Marshal(b, m, deterministic) } -func (dst *AdsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AdsRequest.Merge(dst, src) +func (dst *AdRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AdRequest.Merge(dst, src) } -func (m *AdsRequest) XXX_Size() int { - return xxx_messageInfo_AdsRequest.Size(m) +func (m *AdRequest) XXX_Size() int { + return xxx_messageInfo_AdRequest.Size(m) } -func (m *AdsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AdsRequest.DiscardUnknown(m) +func (m *AdRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AdRequest.DiscardUnknown(m) } -var xxx_messageInfo_AdsRequest proto.InternalMessageInfo +var xxx_messageInfo_AdRequest proto.InternalMessageInfo -func (m *AdsRequest) GetContextKeys() []string { +func (m *AdRequest) GetContextKeys() []string { if m != nil { return m.ContextKeys } return nil } -type AdsResponse struct { - Ads []*Ad `protobuf:"bytes,1,rep,name=ads" json:"ads,omitempty"` +type AdResponse struct { + Ads []*Ad `protobuf:"bytes,1,rep,name=ads,proto3" json:"ads,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } -func (m *AdsResponse) Reset() { *m = AdsResponse{} } -func (m *AdsResponse) String() string { return proto.CompactTextString(m) } -func (*AdsResponse) ProtoMessage() {} -func (*AdsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_demo_c812a73334c7ff0d, []int{30} +func (m *AdResponse) Reset() { *m = AdResponse{} } +func (m *AdResponse) String() string { return proto.CompactTextString(m) } +func (*AdResponse) ProtoMessage() {} +func (*AdResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_demo_88bb8fdac9cd6be5, []int{30} } -func (m *AdsResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AdsResponse.Unmarshal(m, b) +func (m *AdResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AdResponse.Unmarshal(m, b) } -func (m *AdsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AdsResponse.Marshal(b, m, deterministic) +func (m *AdResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AdResponse.Marshal(b, m, deterministic) } -func (dst *AdsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_AdsResponse.Merge(dst, src) +func (dst *AdResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AdResponse.Merge(dst, src) } -func (m *AdsResponse) XXX_Size() int { - return xxx_messageInfo_AdsResponse.Size(m) +func (m *AdResponse) XXX_Size() int { + return xxx_messageInfo_AdResponse.Size(m) } -func (m *AdsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_AdsResponse.DiscardUnknown(m) +func (m *AdResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AdResponse.DiscardUnknown(m) } -var xxx_messageInfo_AdsResponse proto.InternalMessageInfo +var xxx_messageInfo_AdResponse proto.InternalMessageInfo -func (m *AdsResponse) GetAds() []*Ad { +func (m *AdResponse) GetAds() []*Ad { if m != nil { return m.Ads } @@ -1456,9 +1456,9 @@ func (m *AdsResponse) GetAds() []*Ad { type Ad struct { // url to redirect to when an ad is clicked. - RedirectUrl string `protobuf:"bytes,1,opt,name=redirect_url,json=redirectUrl" json:"redirect_url,omitempty"` + RedirectUrl string `protobuf:"bytes,1,opt,name=redirect_url,json=redirectUrl,proto3" json:"redirect_url,omitempty"` // short advertisement text to display. - Text string `protobuf:"bytes,2,opt,name=text" json:"text,omitempty"` + Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -1468,7 +1468,7 @@ func (m *Ad) Reset() { *m = Ad{} } func (m *Ad) String() string { return proto.CompactTextString(m) } func (*Ad) ProtoMessage() {} func (*Ad) Descriptor() ([]byte, []int) { - return fileDescriptor_demo_c812a73334c7ff0d, []int{31} + return fileDescriptor_demo_88bb8fdac9cd6be5, []int{31} } func (m *Ad) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Ad.Unmarshal(m, b) @@ -1532,8 +1532,8 @@ func init() { proto.RegisterType((*SendOrderConfirmationRequest)(nil), "hipstershop.SendOrderConfirmationRequest") proto.RegisterType((*PlaceOrderRequest)(nil), "hipstershop.PlaceOrderRequest") proto.RegisterType((*PlaceOrderResponse)(nil), "hipstershop.PlaceOrderResponse") - proto.RegisterType((*AdsRequest)(nil), "hipstershop.AdsRequest") - proto.RegisterType((*AdsResponse)(nil), "hipstershop.AdsResponse") + proto.RegisterType((*AdRequest)(nil), "hipstershop.AdRequest") + proto.RegisterType((*AdResponse)(nil), "hipstershop.AdResponse") proto.RegisterType((*Ad)(nil), "hipstershop.Ad") } @@ -2255,165 +2255,165 @@ var _CheckoutService_serviceDesc = grpc.ServiceDesc{ Metadata: "demo.proto", } -// AdsServiceClient is the client API for AdsService service. +// AdServiceClient is the client API for AdService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type AdsServiceClient interface { - GetAds(ctx context.Context, in *AdsRequest, opts ...grpc.CallOption) (*AdsResponse, error) +type AdServiceClient interface { + GetAds(ctx context.Context, in *AdRequest, opts ...grpc.CallOption) (*AdResponse, error) } -type adsServiceClient struct { +type adServiceClient struct { cc *grpc.ClientConn } -func NewAdsServiceClient(cc *grpc.ClientConn) AdsServiceClient { - return &adsServiceClient{cc} +func NewAdServiceClient(cc *grpc.ClientConn) AdServiceClient { + return &adServiceClient{cc} } -func (c *adsServiceClient) GetAds(ctx context.Context, in *AdsRequest, opts ...grpc.CallOption) (*AdsResponse, error) { - out := new(AdsResponse) - err := c.cc.Invoke(ctx, "/hipstershop.AdsService/GetAds", in, out, opts...) +func (c *adServiceClient) GetAds(ctx context.Context, in *AdRequest, opts ...grpc.CallOption) (*AdResponse, error) { + out := new(AdResponse) + err := c.cc.Invoke(ctx, "/hipstershop.AdService/GetAds", in, out, opts...) if err != nil { return nil, err } return out, nil } -// AdsServiceServer is the server API for AdsService service. -type AdsServiceServer interface { - GetAds(context.Context, *AdsRequest) (*AdsResponse, error) +// AdServiceServer is the server API for AdService service. +type AdServiceServer interface { + GetAds(context.Context, *AdRequest) (*AdResponse, error) } -func RegisterAdsServiceServer(s *grpc.Server, srv AdsServiceServer) { - s.RegisterService(&_AdsService_serviceDesc, srv) +func RegisterAdServiceServer(s *grpc.Server, srv AdServiceServer) { + s.RegisterService(&_AdService_serviceDesc, srv) } -func _AdsService_GetAds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AdsRequest) +func _AdService_GetAds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AdRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(AdsServiceServer).GetAds(ctx, in) + return srv.(AdServiceServer).GetAds(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/hipstershop.AdsService/GetAds", + FullMethod: "/hipstershop.AdService/GetAds", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AdsServiceServer).GetAds(ctx, req.(*AdsRequest)) + return srv.(AdServiceServer).GetAds(ctx, req.(*AdRequest)) } return interceptor(ctx, in, info, handler) } -var _AdsService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "hipstershop.AdsService", - HandlerType: (*AdsServiceServer)(nil), +var _AdService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "hipstershop.AdService", + HandlerType: (*AdServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetAds", - Handler: _AdsService_GetAds_Handler, + Handler: _AdService_GetAds_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "demo.proto", } -func init() { proto.RegisterFile("demo.proto", fileDescriptor_demo_c812a73334c7ff0d) } +func init() { proto.RegisterFile("demo.proto", fileDescriptor_demo_88bb8fdac9cd6be5) } -var fileDescriptor_demo_c812a73334c7ff0d = []byte{ - // 1484 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0xdd, 0x72, 0x13, 0xb7, - 0x17, 0xcf, 0x26, 0x71, 0x1c, 0x1f, 0xc7, 0x76, 0xa2, 0x7f, 0x02, 0x66, 0xc3, 0x47, 0x50, 0x06, - 0xfe, 0x50, 0x20, 0x30, 0x69, 0x67, 0xb8, 0x00, 0x4a, 0x33, 0x26, 0x63, 0x3c, 0x40, 0xa1, 0x1b, - 0xe8, 0xd0, 0xa1, 0x53, 0xcf, 0xb2, 0x12, 0x78, 0x4b, 0x76, 0xb5, 0x48, 0xda, 0x0c, 0xe6, 0xb2, - 0x7d, 0x80, 0xde, 0xf7, 0x11, 0xfa, 0x02, 0x7d, 0x87, 0xde, 0xf7, 0x15, 0xfa, 0x1c, 0x1d, 0x69, - 0x57, 0xfb, 0x65, 0x3b, 0x81, 0x9b, 0xde, 0xad, 0xa4, 0x9f, 0xce, 0xf9, 0x9d, 0xa3, 0xf3, 0x65, - 0x03, 0x10, 0x1a, 0xb0, 0x9d, 0x88, 0x33, 0xc9, 0x50, 0x73, 0xe4, 0x47, 0x42, 0x52, 0x2e, 0x46, - 0x2c, 0xc2, 0xfb, 0xb0, 0xdc, 0x73, 0xb9, 0x1c, 0x48, 0x1a, 0xa0, 0x73, 0x00, 0x11, 0x67, 0x24, - 0xf6, 0xe4, 0xd0, 0x27, 0x5d, 0x6b, 0xcb, 0xba, 0xd2, 0x70, 0x1a, 0xe9, 0xce, 0x80, 0x20, 0x1b, - 0x96, 0xdf, 0xc7, 0x6e, 0x28, 0x7d, 0x39, 0xee, 0xce, 0x6f, 0x59, 0x57, 0x6a, 0x4e, 0xb6, 0xc6, - 0xcf, 0xa1, 0xbd, 0x47, 0x88, 0x92, 0xe2, 0xd0, 0xf7, 0x31, 0x15, 0x12, 0x9d, 0x86, 0x7a, 0x2c, - 0x28, 0xc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30, - 0x04, 0x8b, 0x9e, 0x29, 0x63, 0x0d, 0x47, 0x7f, 0xab, 0x00, 0x10, 0xd2, 0x95, 0x34, 0x8d, 0xf7, - 0x64, 0xa1, 0x22, 0xdd, 0x63, 0x71, 0x28, 0xf9, 0xd8, 0x44, 0x7a, 0xba, 0x44, 0x67, 0x60, 0xf9, - 0xa3, 0x1f, 0x0d, 0x3d, 0x46, 0xa8, 0x0e, 0xf4, 0x9a, 0x53, 0xff, 0xe8, 0x47, 0x3d, 0x46, 0x28, - 0x7e, 0x09, 0x35, 0xed, 0x4a, 0xb4, 0x0d, 0x2d, 0x2f, 0xe6, 0x9c, 0x86, 0xde, 0x38, 0x01, 0x26, - 0x6c, 0x56, 0xcc, 0xa6, 0x42, 0x2b, 0xc5, 0x71, 0xe8, 0x4b, 0xa1, 0xd9, 0x2c, 0x38, 0xc9, 0x42, - 0xed, 0x86, 0x6e, 0xc8, 0x84, 0xa6, 0x53, 0x73, 0x92, 0x05, 0xee, 0xc3, 0xf9, 0x3e, 0x95, 0x07, - 0x71, 0x14, 0x31, 0x2e, 0x29, 0xe9, 0x25, 0x72, 0x7c, 0x9a, 0xc7, 0xe5, 0x25, 0x68, 0x97, 0x54, - 0x9a, 0x82, 0xd0, 0x2a, 0xea, 0x14, 0xf8, 0x47, 0x38, 0xd3, 0xcb, 0x36, 0xc2, 0x23, 0xca, 0x85, - 0xcf, 0x42, 0xf3, 0xc8, 0x97, 0x61, 0xf1, 0x0d, 0x67, 0xc1, 0x31, 0x31, 0xa2, 0xcf, 0x55, 0x49, - 0x93, 0x2c, 0x31, 0x2c, 0xf1, 0xe4, 0x92, 0x64, 0xda, 0x01, 0xff, 0x58, 0xd0, 0xee, 0x71, 0x4a, - 0x7c, 0x55, 0x8f, 0xc9, 0x20, 0x7c, 0xc3, 0xd0, 0x75, 0x40, 0x9e, 0xde, 0x19, 0x7a, 0x2e, 0x27, - 0xc3, 0x30, 0x0e, 0x5e, 0x53, 0x9e, 0xfa, 0x63, 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, 0x0a, - 0x97, 0xc5, 0x78, 0x77, 0xf2, 0xc0, 0x08, 0x7b, 0xbd, 0xa4, 0xff, 0xc1, 0xf8, 0xf2, 0xdf, 0x00, - 0x00, 0x00, 0xff, 0xff, 0x0d, 0x93, 0x0f, 0x58, 0xcf, 0x10, 0x00, 0x00, +var fileDescriptor_demo_88bb8fdac9cd6be5 = []byte{ + // 1483 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0xdd, 0x72, 0xd3, 0xc6, + 0x17, 0x8f, 0x92, 0x38, 0x8e, 0x8f, 0x63, 0x27, 0xd9, 0x7f, 0x12, 0x8c, 0xc2, 0x47, 0xd8, 0x0c, + 0xfc, 0xa1, 0x80, 0x61, 0xd2, 0xce, 0x70, 0x01, 0x2d, 0xcd, 0x98, 0x8c, 0xf1, 0x14, 0x0a, 0x55, + 0xa0, 0x43, 0x87, 0x4e, 0x3d, 0x42, 0xbb, 0x60, 0x95, 0x48, 0x2b, 0x76, 0x57, 0x19, 0xcc, 0x65, + 0xfb, 0x00, 0xbd, 0xef, 0x23, 0xf4, 0x05, 0xfa, 0x0e, 0xbd, 0xef, 0x2b, 0xf4, 0x39, 0x3a, 0xbb, + 0xd2, 0xea, 0xcb, 0x76, 0x02, 0x37, 0xbd, 0xf3, 0x9e, 0xfd, 0xe9, 0x9c, 0xdf, 0x39, 0x7b, 0xbe, + 0x12, 0x00, 0x42, 0x03, 0xd6, 0x8d, 0x38, 0x93, 0x0c, 0x35, 0x47, 0x7e, 0x24, 0x24, 0xe5, 0x62, + 0xc4, 0x22, 0x7c, 0x00, 0xcb, 0x3d, 0x97, 0xcb, 0x81, 0xa4, 0x01, 0x3a, 0x0f, 0x10, 0x71, 0x46, + 0x62, 0x4f, 0x0e, 0x7d, 0xd2, 0xb1, 0x76, 0xac, 0xab, 0x0d, 0xa7, 0x91, 0x4a, 0x06, 0x04, 0xd9, + 0x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xea, 0xbd, 0x65, 0x71, 0xe6, + 0xc1, 0x13, 0x80, 0xbc, 0xef, 0x56, 0xb2, 0x7b, 0x62, 0xce, 0xd8, 0x17, 0x67, 0xde, 0x67, 0xde, + 0x3c, 0x54, 0x2d, 0xd8, 0x68, 0xbf, 0x0b, 0x4b, 0x7d, 0xb5, 0x83, 0x0b, 0xb4, 0x55, 0x6d, 0xa7, + 0xa9, 0xc6, 0x33, 0x13, 0x72, 0xa3, 0xe9, 0xd5, 0x92, 0xfe, 0xe7, 0xc5, 0xe7, 0xff, 0x06, 0x00, + 0x00, 0xff, 0xff, 0x22, 0xc9, 0xfe, 0x20, 0xca, 0x10, 0x00, 0x00, } diff --git a/src/frontend/rpc.go b/src/frontend/rpc.go index 806c771..bdc1237 100644 --- a/src/frontend/rpc.go +++ b/src/frontend/rpc.go @@ -116,20 +116,20 @@ func (fe *frontendServer) getRecommendations(ctx context.Context, userID string, } func (fe *frontendServer) getAd(ctx context.Context) ([]*pb.Ad, error) { - return []*pb.Ad{ - &pb.Ad{ - Text: "Try this OG insta camera from 1960s!", - RedirectUrl: "https://en.wikipedia.org/wiki/Instant_camera#Polaroid_cameras", - }, - &pb.Ad{ - Text: "Check out the new instagrammy vacation destinations!", - RedirectUrl: "https://en.wikipedia.org/wiki/Italy", - }, - }, nil + //return []*pb.Ad{ + // &pb.Ad{ + // Text: "Try this OG insta camera from 1960s!", + // RedirectUrl: "https://en.wikipedia.org/wiki/Instant_camera#Polaroid_cameras", + // }, + // &pb.Ad{ + // Text: "Check out the new instagrammy vacation destinations!", + // RedirectUrl: "https://en.wikipedia.org/wiki/Italy", + // }, + //}, nil // TODO(rghetia): uncomment below and revove the code above - // resp, err := pb.NewAdsServiceClient(fe.adSvcConn).GetAds(ctx, &pb.AdsRequest{ - // ContextKeys: nil, - // }) - // return resp.GetAds(), errors.Wrap(err, "failed to get ads") + resp, err := pb.NewAdServiceClient(fe.adSvcConn).GetAds(ctx, &pb.AdRequest{ + ContextKeys: nil, + }) + return resp.GetAds(), errors.Wrap(err, "failed to get ads") }