diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000..58b0e58519 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,38 @@ +.github +docs +internal + +################################### +# shippingservice +./src/shippingservice/target +################################### + +################################### +# currencyservice +./src/currencyservice/client.js +./src/currencyservice/node_modules/ +################################### + +################################### +# featureflagservice +# Common development/test artifacts +./src/featureflagservice/cover/ +./src/featureflagservice/doc/ +./src/featureflagservice/test/ +./src/featureflagservice/tmp/ +./src/featureflagservice/.elixir_ls + +# Mix artifacts +./src/featureflagservice/_build/ +./src/featureflagservice/deps/ +./src/featureflagservice/*.ez + +# Generated on crash by the VM +./src/featureflagservice/erl_crash.dump + +# Static artifacts - These should be fetched and built inside the Docker image +./src/featureflagservice/assets/node_modules/ +./src/featureflagservice/priv/static/assets/ +./src/featureflagservice/priv/static/cache_manifest.json +################################### + diff --git a/.gitignore b/.gitignore index 8c8821d152..a6be92ab50 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ obj/ .idea/ build/ node_modules/ +src/shippingservice/target/ \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 03e5d51e62..62e82559cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,8 +17,8 @@ significant modifications will be credited to OpenTelemetry Authors. ([#26](https://github.com/open-telemetry/opentelemetry-demo-webstore/pull/26)) * Added span attributes to frontend service ([#82](https://github.com/open-telemetry/opentelemetry-demo-webstore/pull/82)) -* Re-implemented email service using Ruby -([#109](https://github.com/open-telemetry/opentelemetry-demo-webstore/pull/109)) +* Rewrote shipping service in Rust +([#35](https://github.com/open-telemetry/opentelemetry-demo-webstore/issues/35)) * Added feature flag service implementation ([#141](https://github.com/open-telemetry/opentelemetry-demo-webstore/pull/141)) * Added additional attributes to productcatalog service diff --git a/docker-compose.yml b/docker-compose.yml index c68e00cb35..a2b34682ed 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -224,7 +224,8 @@ services: image: ${IMAGE_NAME}:${IMAGE_VERSION}-shippingservice container_name: shipping-service build: - context: ./src/shippingservice + context: ./ + dockerfile: ./src/shippingservice/Dockerfile ports: - "${SHIPPING_SERVICE_PORT}" environment: diff --git a/src/loadgenerator/Dockerfile b/src/loadgenerator/Dockerfile index a6efd20b11..0d8970169a 100644 --- a/src/loadgenerator/Dockerfile +++ b/src/loadgenerator/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM python:3.10-slim AS base +FROM python:3.10 AS base WORKDIR /usr/src/app/ diff --git a/src/shippingservice/.dockerignore b/src/shippingservice/.dockerignore index 48b8bf9072..342ee837ac 100644 --- a/src/shippingservice/.dockerignore +++ b/src/shippingservice/.dockerignore @@ -1 +1,2 @@ -vendor/ +target/ +Dockerfile diff --git a/src/shippingservice/Cargo.lock b/src/shippingservice/Cargo.lock new file mode 100644 index 0000000000..6afe17779b --- /dev/null +++ b/src/shippingservice/Cargo.lock @@ -0,0 +1,1482 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "aho-corasick" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +dependencies = [ + "memchr", +] + +[[package]] +name = "anyhow" +version = "1.0.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f9b8508dccb7687a1d6c4ce66b2b0ecef467c94667de27d8d7fe1f8d2a9cdc" + +[[package]] +name = "async-stream" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dad5c83079eae9969be7fadefe640a1c566901f05ff91ab221de4b6f68d9507e" +dependencies = [ + "async-stream-impl", + "futures-core", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10f203db73a71dfa2fb6dd22763990fa26f3d2625a6da2da900d23b87d26be27" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "async-trait" +version = "0.1.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96cf8829f67d2eab0b2dfa42c5d0ef737e0724e4a82b01b3e292456202b19716" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "axum" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc47084705629d09d15060d70a8dbfce479c842303d05929ce29c74c995916ae" +dependencies = [ + "async-trait", + "axum-core", + "bitflags", + "bytes", + "futures-util", + "http", + "http-body", + "hyper", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "serde", + "sync_wrapper", + "tokio", + "tower", + "tower-http", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum-core" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2efed1c501becea07ce48118786ebcf229531d0d3b28edf224a720020d9e106" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http", + "http-body", + "mime", +] + +[[package]] +name = "base64" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bumpalo" +version = "3.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37ccbd214614c6783386c1af30caf03192f17891059cecc394b4fb119e363de3" + +[[package]] +name = "bytes" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" + +[[package]] +name = "cc" +version = "1.0.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cmake" +version = "0.1.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8ad8cef104ac57b68b89df3208164d228503abbdce70f6880ffa3d970e7443a" +dependencies = [ + "cc", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c02a4d71819009c192cf4872265391563fd6a84c81ff2c0f2a7026ca4c1d85c" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d82ee10ce34d7bc12c2122495e7593a9c41347ecdd64185af4ecf72cb1a7f83" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "either" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" + +[[package]] +name = "fastrand" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" +dependencies = [ + "instant", +] + +[[package]] +name = "fixedbitset" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "279fb028e20b3c4c320317955b77c5e0c9701f05a1d309905d6fc702cdc5053e" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "futures" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f73fe65f54d1e12b726f517d3e2135ca3125a437b6d998caf1962961f7172d9e" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" + +[[package]] +name = "futures-executor" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9420b90cfa29e327d0429f19be13e7ddb68fa1cccb09d65e5706b8c7a749b8a6" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" + +[[package]] +name = "futures-sink" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" + +[[package]] +name = "futures-task" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" + +[[package]] +name = "futures-util" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "getrandom" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.10.2+wasi-snapshot-preview1", +] + +[[package]] +name = "h2" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37a82c6d637fc9515a4694bbf1cb2457b79d81ce52b3108bdeea58b07dd34a57" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util 0.7.3", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" + +[[package]] +name = "heck" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "heck" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "http" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "http-range-header" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bfe8eed0a9285ef776bb792479ea3834e8b94e13d615c2f66d03dd50a435a29" + +[[package]] +name = "httparse" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "496ce29bb5a52785b44e0f7ca2847ae0bb839c9bd28f69acac9b99d461c0c04c" + +[[package]] +name = "httpdate" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" + +[[package]] +name = "hyper" +version = "0.14.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42dc3c131584288d375f2d07f822b0cb012d8c6fb899a5b9fdb3cb7eb9b6004f" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-timeout" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" +dependencies = [ + "hyper", + "pin-project-lite", + "tokio", + "tokio-io-timeout", +] + +[[package]] +name = "indexmap" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6012d540c5baa3589337a98ce73408de9b5a25ec9fc2c6fd6be8f0d39e0ca5a" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "itertools" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d" + +[[package]] +name = "js-sys" +version = "0.3.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3fac17f7123a73ca62df411b1bf727ccc805daa070338fda671c86dac1bdc27" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" + +[[package]] +name = "lock_api" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "matchit" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73cbba799671b762df5a175adf59ce145165747bb891505c43d09aefbbf38beb" + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "mime" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" + +[[package]] +name = "mio" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "713d550d9b44d89174e066b7a6217ae06234c10cb47819a88290d2b353c31799" +dependencies = [ + "libc", + "log", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys", +] + +[[package]] +name = "multimap" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" + +[[package]] +name = "num_cpus" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "num_threads" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" +dependencies = [ + "libc", +] + +[[package]] +name = "once_cell" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7709cef83f0c1f58f666e746a08b21e0085f7440fa6a29cc194d68aac97a4225" + +[[package]] +name = "opentelemetry" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6105e89802af13fdf48c49d7646d3b533a70e536d818aae7e78ba0433d01acb8" +dependencies = [ + "async-trait", + "crossbeam-channel", + "futures-channel", + "futures-executor", + "futures-util", + "js-sys", + "lazy_static", + "percent-encoding", + "pin-project", + "rand", + "thiserror", + "tokio", + "tokio-stream", +] + +[[package]] +name = "opentelemetry-otlp" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1a6ca9de4c8b00aa7f1a153bd76cb263287155cec642680d79d98706f3d28a" +dependencies = [ + "async-trait", + "futures", + "futures-util", + "http", + "opentelemetry", + "prost 0.9.0", + "thiserror", + "tokio", + "tonic 0.6.2", + "tonic-build 0.6.2", +] + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-sys", +] + +[[package]] +name = "percent-encoding" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" + +[[package]] +name = "petgraph" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5014253a1331579ce62aa67443b4a658c5e7dd03d4bc6d302b94474888143" +dependencies = [ + "fixedbitset", + "indexmap", +] + +[[package]] +name = "pin-project" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58ad3879ad3baf4e44784bc6a718a8698867bb991f8ce24d1bcbe2cfb4c3a75e" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "744b6f092ba29c3650faf274db506afd39944f48420f6c86b17cfe0ee1cb36bb" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "ppv-lite86" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" + +[[package]] +name = "prettyplease" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f28f53e8b192565862cf99343194579a022eb9c7dd3a8d03134734803c7b3125" +dependencies = [ + "proc-macro2", + "syn", +] + +[[package]] +name = "proc-macro2" +version = "1.0.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c54b25569025b7fc9651de43004ae593a75ad88543b17178aa5e1b9c4f15f56f" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "prost" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "444879275cb4fd84958b1a1d5420d15e6fcf7c235fe47f053c9c2a80aceb6001" +dependencies = [ + "bytes", + "prost-derive 0.9.0", +] + +[[package]] +name = "prost" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71adf41db68aa0daaefc69bb30bcd68ded9b9abaad5d1fbb6304c4fb390e083e" +dependencies = [ + "bytes", + "prost-derive 0.10.1", +] + +[[package]] +name = "prost-build" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62941722fb675d463659e49c4f3fe1fe792ff24fe5bbaa9c08cd3b98a1c354f5" +dependencies = [ + "bytes", + "heck 0.3.3", + "itertools", + "lazy_static", + "log", + "multimap", + "petgraph", + "prost 0.9.0", + "prost-types 0.9.0", + "regex", + "tempfile", + "which", +] + +[[package]] +name = "prost-build" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae5a4388762d5815a9fc0dea33c56b021cdc8dde0c55e0c9ca57197254b0cab" +dependencies = [ + "bytes", + "cfg-if", + "cmake", + "heck 0.4.0", + "itertools", + "lazy_static", + "log", + "multimap", + "petgraph", + "prost 0.10.4", + "prost-types 0.10.1", + "regex", + "tempfile", + "which", +] + +[[package]] +name = "prost-derive" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9cc1a3263e07e0bf68e96268f37665207b49560d98739662cdfaae215c720fe" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "prost-derive" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b670f45da57fb8542ebdbb6105a925fe571b67f9e7ed9f47a06a84e72b4e7cc" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "prost-types" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534b7a0e836e3c482d2693070f982e39e7611da9695d4d1f5a4b186b51faef0a" +dependencies = [ + "bytes", + "prost 0.9.0", +] + +[[package]] +name = "prost-types" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d0a014229361011dc8e69c8a1ec6c2e8d0f2af7c91e3ea3f5b2170298461e68" +dependencies = [ + "bytes", + "prost 0.10.4", +] + +[[package]] +name = "quote" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +dependencies = [ + "getrandom", +] + +[[package]] +name = "redox_syscall" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex" +version = "1.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d83f127d94bdbcda4c8cc2e50f6f84f4b611f69c902699ca385a39c3a75f9ff1" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49b3de9ec5dc0a3417da371aab17d729997c15010e7fd24ff707773a33bddb64" + +[[package]] +name = "remove_dir_all" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +dependencies = [ + "winapi", +] + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "serde" +version = "1.0.137" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61ea8d54c77f8315140a05f4c7237403bf38b72704d031543aa1d16abbf517d1" + +[[package]] +name = "shippingservice" +version = "0.1.0" +dependencies = [ + "log", + "opentelemetry", + "opentelemetry-otlp", + "prost 0.10.4", + "prost-types 0.10.1", + "simplelog", + "tokio", + "tonic 0.7.2", + "tonic-build 0.7.2", + "tonic-health", + "uuid", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +dependencies = [ + "libc", +] + +[[package]] +name = "simplelog" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48dfff04aade74dd495b007c831cd6f4e0cee19c344dd9dc0884c0289b70a786" +dependencies = [ + "log", + "termcolor", + "time", +] + +[[package]] +name = "slab" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb703cfe953bccee95685111adeedb76fabe4e97549a58d16f03ea7b9367bb32" + +[[package]] +name = "smallvec" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc88c725d61fc6c3132893370cac4a0200e3fedf5da8331c570664b1987f5ca2" + +[[package]] +name = "socket2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "syn" +version = "1.0.96" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0748dd251e24453cb8717f0354206b91557e4ec8703673a4b30208f2abaf1ebf" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20518fe4a4c9acf048008599e464deb21beeae3d3578418951a189c235a7a9a8" + +[[package]] +name = "tempfile" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +dependencies = [ + "cfg-if", + "fastrand", + "libc", + "redox_syscall", + "remove_dir_all", + "winapi", +] + +[[package]] +name = "termcolor" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "thiserror" +version = "1.0.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "time" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72c91f41dcb2f096c05f0873d667dceec1087ce5bcf984ec8ffb19acddbb3217" +dependencies = [ + "itoa", + "libc", + "num_threads", + "time-macros", +] + +[[package]] +name = "time-macros" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42657b1a6f4d817cda8e7a0ace261fe0cc946cf3a80314390b22cc61ae080792" + +[[package]] +name = "tokio" +version = "1.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c51a52ed6686dd62c320f9b89299e9dfb46f730c7a48e635c19f21d116cb1439" +dependencies = [ + "bytes", + "libc", + "memchr", + "mio", + "num_cpus", + "once_cell", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "winapi", +] + +[[package]] +name = "tokio-io-timeout" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" +dependencies = [ + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-macros" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-stream" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df54d54117d6fdc4e4fea40fe1e4e566b3505700e148a6827e59b34b0d2600d9" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.6.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "log", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc463cd8deddc3770d20f9852143d50bf6094e640b485cb2e189a2099085ff45" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "tonic" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff08f4649d10a70ffa3522ca559031285d8e421d727ac85c60825761818f5d0a" +dependencies = [ + "async-stream", + "async-trait", + "base64", + "bytes", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-timeout", + "percent-encoding", + "pin-project", + "prost 0.9.0", + "prost-derive 0.9.0", + "tokio", + "tokio-stream", + "tokio-util 0.6.10", + "tower", + "tower-layer", + "tower-service", + "tracing", + "tracing-futures", +] + +[[package]] +name = "tonic" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be9d60db39854b30b835107500cf0aca0b0d14d6e1c3de124217c23a29c2ddb" +dependencies = [ + "async-stream", + "async-trait", + "axum", + "base64", + "bytes", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-timeout", + "percent-encoding", + "pin-project", + "prost 0.10.4", + "prost-derive 0.10.1", + "tokio", + "tokio-stream", + "tokio-util 0.7.3", + "tower", + "tower-layer", + "tower-service", + "tracing", + "tracing-futures", +] + +[[package]] +name = "tonic-build" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9403f1bafde247186684b230dc6f38b5cd514584e8bec1dd32514be4745fa757" +dependencies = [ + "proc-macro2", + "prost-build 0.9.0", + "quote", + "syn", +] + +[[package]] +name = "tonic-build" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9263bf4c9bfaae7317c1c2faf7f18491d2fe476f70c414b73bf5d445b00ffa1" +dependencies = [ + "prettyplease", + "proc-macro2", + "prost-build 0.10.4", + "quote", + "syn", +] + +[[package]] +name = "tonic-health" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9da1806c3ff2f02fb6d9b62fc72a2f3b6429c7f2f5d87861f548156708afcd71" +dependencies = [ + "async-stream", + "bytes", + "prost 0.10.4", + "tokio", + "tokio-stream", + "tonic 0.7.2", + "tonic-build 0.7.2", +] + +[[package]] +name = "tower" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a89fd63ad6adf737582df5db40d286574513c69a11dac5214dc3b5603d6713e" +dependencies = [ + "futures-core", + "futures-util", + "indexmap", + "pin-project", + "pin-project-lite", + "rand", + "slab", + "tokio", + "tokio-util 0.7.3", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-http" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c530c8675c1dbf98facee631536fa116b5fb6382d7dd6dc1b118d970eafe3ba" +dependencies = [ + "bitflags", + "bytes", + "futures-core", + "futures-util", + "http", + "http-body", + "http-range-header", + "pin-project-lite", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "343bc9466d3fe6b0f960ef45960509f84480bf4fd96f92901afe7ff3df9d3a62" + +[[package]] +name = "tower-service" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" + +[[package]] +name = "tracing" +version = "0.1.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a400e31aa60b9d44a52a8ee0343b5b18566b03a8321e0d321f695cf56e940160" +dependencies = [ + "cfg-if", + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc6b8ad3567499f98a1db7a752b07a7c8c7c7c34c332ec00effb2b0027974b7c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7709595b8878a4965ce5e87ebf880a7d39c9afc6837721b21a5a816a8117d921" +dependencies = [ + "once_cell", +] + +[[package]] +name = "tracing-futures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project", + "tracing", +] + +[[package]] +name = "try-lock" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" + +[[package]] +name = "unicode-ident" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d22af068fba1eb5edcb4aea19d382b2a3deb4c8f9d475c589b6ada9e0fd493ee" + +[[package]] +name = "unicode-segmentation" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" + +[[package]] +name = "uuid" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd6469f4314d5f1ffec476e05f17cc9a78bc7a27a6a857842170bdf8d6f98d2f" +dependencies = [ + "getrandom", + "rand", + "uuid-macro-internal", +] + +[[package]] +name = "uuid-macro-internal" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "548f7181a5990efa50237abb7ebca410828b57a8955993334679f8b50b35c97d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "want" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +dependencies = [ + "log", + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c53b543413a17a202f4be280a7e5c62a1c69345f5de525ee64f8cfdbc954994" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5491a68ab4500fa6b4d726bd67408630c3dbe9c4fe7bda16d5c82a1fd8c7340a" +dependencies = [ + "bumpalo", + "lazy_static", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c441e177922bc58f1e12c022624b6216378e5febc2f0533e41ba443d505b80aa" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d94ac45fcf608c1f45ef53e748d35660f168490c10b23704c7779ab8f5c3048" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a89911bd99e5f3659ec4acf9c4d93b0a90fe4a2a11f15328472058edc5261be" + +[[package]] +name = "which" +version = "4.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c4fb54e6113b6a8772ee41c3404fb0301ac79604489467e0a9ce1f3e97c24ae" +dependencies = [ + "either", + "lazy_static", + "libc", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +dependencies = [ + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" diff --git a/src/shippingservice/Cargo.toml b/src/shippingservice/Cargo.toml new file mode 100644 index 0000000000..08d4949f94 --- /dev/null +++ b/src/shippingservice/Cargo.toml @@ -0,0 +1,33 @@ +[package] +name = "shippingservice" +version = "0.1.0" +edition = "2021" + +[[bin]] +name = "shippingservice" +path = "src/main.rs" + +[features] +dockerproto = [] # compile in docker or not + +[dependencies] +tonic = "0.7" +tonic-health = "0.6.0" +prost = "0.10" +prost-types = "0.10" +tokio = { version = "1.0", features = ["macros", "rt-multi-thread"] } +opentelemetry = { version = "0.17", features = ["rt-tokio"] } +opentelemetry-otlp = "0.10" +log = "0.4.17" +simplelog = "0.12" + +[dependencies.uuid] +version = "1.1.2" +features = [ + "v4", # Lets you generate random UUIDs + "fast-rng", # Use a faster (but still sufficiently random) RNG + "macro-diagnostics", # Enable better diagnostics for compile-time UUIDs +] + +[build-dependencies] +tonic-build = "0.7" \ No newline at end of file diff --git a/src/shippingservice/Dockerfile b/src/shippingservice/Dockerfile index 097776675f..bf6f5fa102 100644 --- a/src/shippingservice/Dockerfile +++ b/src/shippingservice/Dockerfile @@ -1,44 +1,22 @@ -# Copyright 2020 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. +# build context will only work from ../../docker-compose.yml +FROM rust:1.61-alpine as builder +RUN apk update +RUN apk add --no-cache ca-certificates git protoc cmake clang clang-dev make gcc g++ libc-dev linux-headers +WORKDIR /app/ -FROM golang:1.17.7-alpine as builder -RUN apk add --no-cache ca-certificates git -RUN apk add build-base -WORKDIR /src - -# restore dependencies -COPY go.mod go.sum ./ -RUN go mod download -COPY . . - -# Skaffold passes in debug-oriented compiler flags -ARG SKAFFOLD_GO_GCFLAGS -RUN go build -gcflags="${SKAFFOLD_GO_GCFLAGS}" -o /go/bin/shippingservice . +# build app +COPY ./src/shippingservice/ /app/ +COPY ./pb/ /app/proto/ +RUN cargo build -r --features="dockerproto" FROM alpine as release RUN apk add --no-cache ca-certificates RUN GRPC_HEALTH_PROBE_VERSION=v0.4.7 && \ wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \ chmod +x /bin/grpc_health_probe -WORKDIR /src -COPY --from=builder /go/bin/shippingservice /src/shippingservice -ENV APP_PORT=50051 - -# Definition of this variable is used by 'skaffold debug' to identify a golang binary. -# Default behavior - a failure prints a stack trace for the current goroutine. -# See https://golang.org/pkg/runtime/ -ENV GOTRACEBACK=single +WORKDIR /app +COPY --from=builder /app/target/release/shippingservice /shippingservice +ENV PORT=50051 EXPOSE 50051 -ENTRYPOINT ["/src/shippingservice"] +ENTRYPOINT ["/shippingservice"] diff --git a/src/shippingservice/README.md b/src/shippingservice/README.md index f7eadf9648..bf0aacceba 100644 --- a/src/shippingservice/README.md +++ b/src/shippingservice/README.md @@ -5,22 +5,19 @@ order fulfillment & shipping processes. ## Local -Run the following command to restore dependencies to `vendor/` directory: - -```sh -dep ensure --vendor-only -``` +This repo assumes you have rust 1.61 installed. You may use docker, or install +rust [here](https://www.rust-lang.org/tools/install). ## Build -From `src/shippingservice`, run: +From `../../`, run: ```sh -docker build ./ +docker compose build shippingservice ``` ## Test ```sh -go test . +cargo test ``` diff --git a/src/shippingservice/build.rs b/src/shippingservice/build.rs new file mode 100644 index 0000000000..a59651974b --- /dev/null +++ b/src/shippingservice/build.rs @@ -0,0 +1,7 @@ +fn main() -> Result<(), Box> { + #[cfg(feature = "dockerproto")] + tonic_build::compile_protos("proto/demo.proto")?; + #[cfg(not(feature = "dockerproto"))] + tonic_build::compile_protos("../../pb/demo.proto")?; + Ok(()) +} diff --git a/src/shippingservice/genproto/hipstershop/demo.pb.go b/src/shippingservice/genproto/hipstershop/demo.pb.go deleted file mode 100644 index 43a68d5749..0000000000 --- a/src/shippingservice/genproto/hipstershop/demo.pb.go +++ /dev/null @@ -1,2608 +0,0 @@ -// Copyright 2020 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. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.1 -// protoc v3.6.1 -// source: demo.proto - -package hipstershop - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - 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 CartItem struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - 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"` -} - -func (x *CartItem) Reset() { - *x = CartItem{} - if protoimpl.UnsafeEnabled { - mi := &file_demo_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CartItem) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CartItem) ProtoMessage() {} - -func (x *CartItem) ProtoReflect() protoreflect.Message { - mi := &file_demo_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 CartItem.ProtoReflect.Descriptor instead. -func (*CartItem) Descriptor() ([]byte, []int) { - return file_demo_proto_rawDescGZIP(), []int{0} -} - -func (x *CartItem) GetProductId() string { - if x != nil { - return x.ProductId - } - return "" -} - -func (x *CartItem) GetQuantity() int32 { - if x != nil { - return x.Quantity - } - return 0 -} - -type AddItemRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - 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"` -} - -func (x *AddItemRequest) Reset() { - *x = AddItemRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_demo_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AddItemRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddItemRequest) ProtoMessage() {} - -func (x *AddItemRequest) ProtoReflect() protoreflect.Message { - mi := &file_demo_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 AddItemRequest.ProtoReflect.Descriptor instead. -func (*AddItemRequest) Descriptor() ([]byte, []int) { - return file_demo_proto_rawDescGZIP(), []int{1} -} - -func (x *AddItemRequest) GetUserId() string { - if x != nil { - return x.UserId - } - return "" -} - -func (x *AddItemRequest) GetItem() *CartItem { - if x != nil { - return x.Item - } - return nil -} - -type EmptyCartRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` -} - -func (x *EmptyCartRequest) Reset() { - *x = EmptyCartRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_demo_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EmptyCartRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EmptyCartRequest) ProtoMessage() {} - -func (x *EmptyCartRequest) ProtoReflect() protoreflect.Message { - mi := &file_demo_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 EmptyCartRequest.ProtoReflect.Descriptor instead. -func (*EmptyCartRequest) Descriptor() ([]byte, []int) { - return file_demo_proto_rawDescGZIP(), []int{2} -} - -func (x *EmptyCartRequest) GetUserId() string { - if x != nil { - return x.UserId - } - return "" -} - -type GetCartRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` -} - -func (x *GetCartRequest) Reset() { - *x = GetCartRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_demo_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetCartRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetCartRequest) ProtoMessage() {} - -func (x *GetCartRequest) ProtoReflect() protoreflect.Message { - mi := &file_demo_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 GetCartRequest.ProtoReflect.Descriptor instead. -func (*GetCartRequest) Descriptor() ([]byte, []int) { - return file_demo_proto_rawDescGZIP(), []int{3} -} - -func (x *GetCartRequest) GetUserId() string { - if x != nil { - return x.UserId - } - return "" -} - -type Cart struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - 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"` -} - -func (x *Cart) Reset() { - *x = Cart{} - if protoimpl.UnsafeEnabled { - mi := &file_demo_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Cart) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Cart) ProtoMessage() {} - -func (x *Cart) ProtoReflect() protoreflect.Message { - mi := &file_demo_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 Cart.ProtoReflect.Descriptor instead. -func (*Cart) Descriptor() ([]byte, []int) { - return file_demo_proto_rawDescGZIP(), []int{4} -} - -func (x *Cart) GetUserId() string { - if x != nil { - return x.UserId - } - return "" -} - -func (x *Cart) GetItems() []*CartItem { - if x != nil { - return x.Items - } - return nil -} - -type Empty struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *Empty) Reset() { - *x = Empty{} - if protoimpl.UnsafeEnabled { - mi := &file_demo_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Empty) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Empty) ProtoMessage() {} - -func (x *Empty) ProtoReflect() protoreflect.Message { - mi := &file_demo_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 Empty.ProtoReflect.Descriptor instead. -func (*Empty) Descriptor() ([]byte, []int) { - return file_demo_proto_rawDescGZIP(), []int{5} -} - -type ListRecommendationsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - 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"` -} - -func (x *ListRecommendationsRequest) Reset() { - *x = ListRecommendationsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_demo_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListRecommendationsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListRecommendationsRequest) ProtoMessage() {} - -func (x *ListRecommendationsRequest) ProtoReflect() protoreflect.Message { - mi := &file_demo_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 ListRecommendationsRequest.ProtoReflect.Descriptor instead. -func (*ListRecommendationsRequest) Descriptor() ([]byte, []int) { - return file_demo_proto_rawDescGZIP(), []int{6} -} - -func (x *ListRecommendationsRequest) GetUserId() string { - if x != nil { - return x.UserId - } - return "" -} - -func (x *ListRecommendationsRequest) GetProductIds() []string { - if x != nil { - return x.ProductIds - } - return nil -} - -type ListRecommendationsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ProductIds []string `protobuf:"bytes,1,rep,name=product_ids,json=productIds,proto3" json:"product_ids,omitempty"` -} - -func (x *ListRecommendationsResponse) Reset() { - *x = ListRecommendationsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_demo_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListRecommendationsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListRecommendationsResponse) ProtoMessage() {} - -func (x *ListRecommendationsResponse) ProtoReflect() protoreflect.Message { - mi := &file_demo_proto_msgTypes[7] - 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 ListRecommendationsResponse.ProtoReflect.Descriptor instead. -func (*ListRecommendationsResponse) Descriptor() ([]byte, []int) { - return file_demo_proto_rawDescGZIP(), []int{7} -} - -func (x *ListRecommendationsResponse) GetProductIds() []string { - if x != nil { - return x.ProductIds - } - return nil -} - -type Product struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - 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"` - // Categories such as "clothing" or "kitchen" that can be used to look up - // other related products. - Categories []string `protobuf:"bytes,6,rep,name=categories,proto3" json:"categories,omitempty"` -} - -func (x *Product) Reset() { - *x = Product{} - if protoimpl.UnsafeEnabled { - mi := &file_demo_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Product) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Product) ProtoMessage() {} - -func (x *Product) ProtoReflect() protoreflect.Message { - mi := &file_demo_proto_msgTypes[8] - 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 Product.ProtoReflect.Descriptor instead. -func (*Product) Descriptor() ([]byte, []int) { - return file_demo_proto_rawDescGZIP(), []int{8} -} - -func (x *Product) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *Product) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Product) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Product) GetPicture() string { - if x != nil { - return x.Picture - } - return "" -} - -func (x *Product) GetPriceUsd() *Money { - if x != nil { - return x.PriceUsd - } - return nil -} - -func (x *Product) GetCategories() []string { - if x != nil { - return x.Categories - } - return nil -} - -type ListProductsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Products []*Product `protobuf:"bytes,1,rep,name=products,proto3" json:"products,omitempty"` -} - -func (x *ListProductsResponse) Reset() { - *x = ListProductsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_demo_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListProductsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListProductsResponse) ProtoMessage() {} - -func (x *ListProductsResponse) ProtoReflect() protoreflect.Message { - mi := &file_demo_proto_msgTypes[9] - 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 ListProductsResponse.ProtoReflect.Descriptor instead. -func (*ListProductsResponse) Descriptor() ([]byte, []int) { - return file_demo_proto_rawDescGZIP(), []int{9} -} - -func (x *ListProductsResponse) GetProducts() []*Product { - if x != nil { - return x.Products - } - return nil -} - -type GetProductRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *GetProductRequest) Reset() { - *x = GetProductRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_demo_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetProductRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetProductRequest) ProtoMessage() {} - -func (x *GetProductRequest) ProtoReflect() protoreflect.Message { - mi := &file_demo_proto_msgTypes[10] - 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 GetProductRequest.ProtoReflect.Descriptor instead. -func (*GetProductRequest) Descriptor() ([]byte, []int) { - return file_demo_proto_rawDescGZIP(), []int{10} -} - -func (x *GetProductRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -type SearchProductsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` -} - -func (x *SearchProductsRequest) Reset() { - *x = SearchProductsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_demo_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SearchProductsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SearchProductsRequest) ProtoMessage() {} - -func (x *SearchProductsRequest) ProtoReflect() protoreflect.Message { - mi := &file_demo_proto_msgTypes[11] - 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 SearchProductsRequest.ProtoReflect.Descriptor instead. -func (*SearchProductsRequest) Descriptor() ([]byte, []int) { - return file_demo_proto_rawDescGZIP(), []int{11} -} - -func (x *SearchProductsRequest) GetQuery() string { - if x != nil { - return x.Query - } - return "" -} - -type SearchProductsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Results []*Product `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` -} - -func (x *SearchProductsResponse) Reset() { - *x = SearchProductsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_demo_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SearchProductsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SearchProductsResponse) ProtoMessage() {} - -func (x *SearchProductsResponse) ProtoReflect() protoreflect.Message { - mi := &file_demo_proto_msgTypes[12] - 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 SearchProductsResponse.ProtoReflect.Descriptor instead. -func (*SearchProductsResponse) Descriptor() ([]byte, []int) { - return file_demo_proto_rawDescGZIP(), []int{12} -} - -func (x *SearchProductsResponse) GetResults() []*Product { - if x != nil { - return x.Results - } - return nil -} - -type GetQuoteRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Address *Address `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - Items []*CartItem `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"` -} - -func (x *GetQuoteRequest) Reset() { - *x = GetQuoteRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_demo_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetQuoteRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetQuoteRequest) ProtoMessage() {} - -func (x *GetQuoteRequest) ProtoReflect() protoreflect.Message { - mi := &file_demo_proto_msgTypes[13] - 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 GetQuoteRequest.ProtoReflect.Descriptor instead. -func (*GetQuoteRequest) Descriptor() ([]byte, []int) { - return file_demo_proto_rawDescGZIP(), []int{13} -} - -func (x *GetQuoteRequest) GetAddress() *Address { - if x != nil { - return x.Address - } - return nil -} - -func (x *GetQuoteRequest) GetItems() []*CartItem { - if x != nil { - return x.Items - } - return nil -} - -type GetQuoteResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - CostUsd *Money `protobuf:"bytes,1,opt,name=cost_usd,json=costUsd,proto3" json:"cost_usd,omitempty"` -} - -func (x *GetQuoteResponse) Reset() { - *x = GetQuoteResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_demo_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetQuoteResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetQuoteResponse) ProtoMessage() {} - -func (x *GetQuoteResponse) ProtoReflect() protoreflect.Message { - mi := &file_demo_proto_msgTypes[14] - 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 GetQuoteResponse.ProtoReflect.Descriptor instead. -func (*GetQuoteResponse) Descriptor() ([]byte, []int) { - return file_demo_proto_rawDescGZIP(), []int{14} -} - -func (x *GetQuoteResponse) GetCostUsd() *Money { - if x != nil { - return x.CostUsd - } - return nil -} - -type ShipOrderRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Address *Address `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - Items []*CartItem `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"` -} - -func (x *ShipOrderRequest) Reset() { - *x = ShipOrderRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_demo_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ShipOrderRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ShipOrderRequest) ProtoMessage() {} - -func (x *ShipOrderRequest) ProtoReflect() protoreflect.Message { - mi := &file_demo_proto_msgTypes[15] - 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 ShipOrderRequest.ProtoReflect.Descriptor instead. -func (*ShipOrderRequest) Descriptor() ([]byte, []int) { - return file_demo_proto_rawDescGZIP(), []int{15} -} - -func (x *ShipOrderRequest) GetAddress() *Address { - if x != nil { - return x.Address - } - return nil -} - -func (x *ShipOrderRequest) GetItems() []*CartItem { - if x != nil { - return x.Items - } - return nil -} - -type ShipOrderResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - TrackingId string `protobuf:"bytes,1,opt,name=tracking_id,json=trackingId,proto3" json:"tracking_id,omitempty"` -} - -func (x *ShipOrderResponse) Reset() { - *x = ShipOrderResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_demo_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ShipOrderResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ShipOrderResponse) ProtoMessage() {} - -func (x *ShipOrderResponse) ProtoReflect() protoreflect.Message { - mi := &file_demo_proto_msgTypes[16] - 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 ShipOrderResponse.ProtoReflect.Descriptor instead. -func (*ShipOrderResponse) Descriptor() ([]byte, []int) { - return file_demo_proto_rawDescGZIP(), []int{16} -} - -func (x *ShipOrderResponse) GetTrackingId() string { - if x != nil { - return x.TrackingId - } - return "" -} - -type Address struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - 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"` -} - -func (x *Address) Reset() { - *x = Address{} - if protoimpl.UnsafeEnabled { - mi := &file_demo_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Address) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Address) ProtoMessage() {} - -func (x *Address) ProtoReflect() protoreflect.Message { - mi := &file_demo_proto_msgTypes[17] - 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 Address.ProtoReflect.Descriptor instead. -func (*Address) Descriptor() ([]byte, []int) { - return file_demo_proto_rawDescGZIP(), []int{17} -} - -func (x *Address) GetStreetAddress() string { - if x != nil { - return x.StreetAddress - } - return "" -} - -func (x *Address) GetCity() string { - if x != nil { - return x.City - } - return "" -} - -func (x *Address) GetState() string { - if x != nil { - return x.State - } - return "" -} - -func (x *Address) GetCountry() string { - if x != nil { - return x.Country - } - return "" -} - -func (x *Address) GetZipCode() int32 { - if x != nil { - return x.ZipCode - } - return 0 -} - -// Represents an amount of money with its currency type. -type Money struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The 3-letter currency code defined in ISO 4217. - 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,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,proto3" json:"nanos,omitempty"` -} - -func (x *Money) Reset() { - *x = Money{} - if protoimpl.UnsafeEnabled { - mi := &file_demo_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Money) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Money) ProtoMessage() {} - -func (x *Money) ProtoReflect() protoreflect.Message { - mi := &file_demo_proto_msgTypes[18] - 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 Money.ProtoReflect.Descriptor instead. -func (*Money) Descriptor() ([]byte, []int) { - return file_demo_proto_rawDescGZIP(), []int{18} -} - -func (x *Money) GetCurrencyCode() string { - if x != nil { - return x.CurrencyCode - } - return "" -} - -func (x *Money) GetUnits() int64 { - if x != nil { - return x.Units - } - return 0 -} - -func (x *Money) GetNanos() int32 { - if x != nil { - return x.Nanos - } - return 0 -} - -type GetSupportedCurrenciesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The 3-letter currency code defined in ISO 4217. - CurrencyCodes []string `protobuf:"bytes,1,rep,name=currency_codes,json=currencyCodes,proto3" json:"currency_codes,omitempty"` -} - -func (x *GetSupportedCurrenciesResponse) Reset() { - *x = GetSupportedCurrenciesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_demo_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetSupportedCurrenciesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetSupportedCurrenciesResponse) ProtoMessage() {} - -func (x *GetSupportedCurrenciesResponse) ProtoReflect() protoreflect.Message { - mi := &file_demo_proto_msgTypes[19] - 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 GetSupportedCurrenciesResponse.ProtoReflect.Descriptor instead. -func (*GetSupportedCurrenciesResponse) Descriptor() ([]byte, []int) { - return file_demo_proto_rawDescGZIP(), []int{19} -} - -func (x *GetSupportedCurrenciesResponse) GetCurrencyCodes() []string { - if x != nil { - return x.CurrencyCodes - } - return nil -} - -type CurrencyConversionRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - 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,proto3" json:"to_code,omitempty"` -} - -func (x *CurrencyConversionRequest) Reset() { - *x = CurrencyConversionRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_demo_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CurrencyConversionRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CurrencyConversionRequest) ProtoMessage() {} - -func (x *CurrencyConversionRequest) ProtoReflect() protoreflect.Message { - mi := &file_demo_proto_msgTypes[20] - 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 CurrencyConversionRequest.ProtoReflect.Descriptor instead. -func (*CurrencyConversionRequest) Descriptor() ([]byte, []int) { - return file_demo_proto_rawDescGZIP(), []int{20} -} - -func (x *CurrencyConversionRequest) GetFrom() *Money { - if x != nil { - return x.From - } - return nil -} - -func (x *CurrencyConversionRequest) GetToCode() string { - if x != nil { - return x.ToCode - } - return "" -} - -type CreditCardInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - 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"` -} - -func (x *CreditCardInfo) Reset() { - *x = CreditCardInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_demo_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreditCardInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreditCardInfo) ProtoMessage() {} - -func (x *CreditCardInfo) ProtoReflect() protoreflect.Message { - mi := &file_demo_proto_msgTypes[21] - 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 CreditCardInfo.ProtoReflect.Descriptor instead. -func (*CreditCardInfo) Descriptor() ([]byte, []int) { - return file_demo_proto_rawDescGZIP(), []int{21} -} - -func (x *CreditCardInfo) GetCreditCardNumber() string { - if x != nil { - return x.CreditCardNumber - } - return "" -} - -func (x *CreditCardInfo) GetCreditCardCvv() int32 { - if x != nil { - return x.CreditCardCvv - } - return 0 -} - -func (x *CreditCardInfo) GetCreditCardExpirationYear() int32 { - if x != nil { - return x.CreditCardExpirationYear - } - return 0 -} - -func (x *CreditCardInfo) GetCreditCardExpirationMonth() int32 { - if x != nil { - return x.CreditCardExpirationMonth - } - return 0 -} - -type ChargeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - 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"` -} - -func (x *ChargeRequest) Reset() { - *x = ChargeRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_demo_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ChargeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChargeRequest) ProtoMessage() {} - -func (x *ChargeRequest) ProtoReflect() protoreflect.Message { - mi := &file_demo_proto_msgTypes[22] - 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 ChargeRequest.ProtoReflect.Descriptor instead. -func (*ChargeRequest) Descriptor() ([]byte, []int) { - return file_demo_proto_rawDescGZIP(), []int{22} -} - -func (x *ChargeRequest) GetAmount() *Money { - if x != nil { - return x.Amount - } - return nil -} - -func (x *ChargeRequest) GetCreditCard() *CreditCardInfo { - if x != nil { - return x.CreditCard - } - return nil -} - -type ChargeResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - TransactionId string `protobuf:"bytes,1,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"` -} - -func (x *ChargeResponse) Reset() { - *x = ChargeResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_demo_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ChargeResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChargeResponse) ProtoMessage() {} - -func (x *ChargeResponse) ProtoReflect() protoreflect.Message { - mi := &file_demo_proto_msgTypes[23] - 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 ChargeResponse.ProtoReflect.Descriptor instead. -func (*ChargeResponse) Descriptor() ([]byte, []int) { - return file_demo_proto_rawDescGZIP(), []int{23} -} - -func (x *ChargeResponse) GetTransactionId() string { - if x != nil { - return x.TransactionId - } - return "" -} - -type OrderItem struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Item *CartItem `protobuf:"bytes,1,opt,name=item,proto3" json:"item,omitempty"` - Cost *Money `protobuf:"bytes,2,opt,name=cost,proto3" json:"cost,omitempty"` -} - -func (x *OrderItem) Reset() { - *x = OrderItem{} - if protoimpl.UnsafeEnabled { - mi := &file_demo_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *OrderItem) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OrderItem) ProtoMessage() {} - -func (x *OrderItem) ProtoReflect() protoreflect.Message { - mi := &file_demo_proto_msgTypes[24] - 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 OrderItem.ProtoReflect.Descriptor instead. -func (*OrderItem) Descriptor() ([]byte, []int) { - return file_demo_proto_rawDescGZIP(), []int{24} -} - -func (x *OrderItem) GetItem() *CartItem { - if x != nil { - return x.Item - } - return nil -} - -func (x *OrderItem) GetCost() *Money { - if x != nil { - return x.Cost - } - return nil -} - -type OrderResult struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - 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"` -} - -func (x *OrderResult) Reset() { - *x = OrderResult{} - if protoimpl.UnsafeEnabled { - mi := &file_demo_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *OrderResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OrderResult) ProtoMessage() {} - -func (x *OrderResult) ProtoReflect() protoreflect.Message { - mi := &file_demo_proto_msgTypes[25] - 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 OrderResult.ProtoReflect.Descriptor instead. -func (*OrderResult) Descriptor() ([]byte, []int) { - return file_demo_proto_rawDescGZIP(), []int{25} -} - -func (x *OrderResult) GetOrderId() string { - if x != nil { - return x.OrderId - } - return "" -} - -func (x *OrderResult) GetShippingTrackingId() string { - if x != nil { - return x.ShippingTrackingId - } - return "" -} - -func (x *OrderResult) GetShippingCost() *Money { - if x != nil { - return x.ShippingCost - } - return nil -} - -func (x *OrderResult) GetShippingAddress() *Address { - if x != nil { - return x.ShippingAddress - } - return nil -} - -func (x *OrderResult) GetItems() []*OrderItem { - if x != nil { - return x.Items - } - return nil -} - -type SendOrderConfirmationRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"` - Order *OrderResult `protobuf:"bytes,2,opt,name=order,proto3" json:"order,omitempty"` -} - -func (x *SendOrderConfirmationRequest) Reset() { - *x = SendOrderConfirmationRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_demo_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SendOrderConfirmationRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SendOrderConfirmationRequest) ProtoMessage() {} - -func (x *SendOrderConfirmationRequest) ProtoReflect() protoreflect.Message { - mi := &file_demo_proto_msgTypes[26] - 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 SendOrderConfirmationRequest.ProtoReflect.Descriptor instead. -func (*SendOrderConfirmationRequest) Descriptor() ([]byte, []int) { - return file_demo_proto_rawDescGZIP(), []int{26} -} - -func (x *SendOrderConfirmationRequest) GetEmail() string { - if x != nil { - return x.Email - } - return "" -} - -func (x *SendOrderConfirmationRequest) GetOrder() *OrderResult { - if x != nil { - return x.Order - } - return nil -} - -type PlaceOrderRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - 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"` -} - -func (x *PlaceOrderRequest) Reset() { - *x = PlaceOrderRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_demo_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PlaceOrderRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PlaceOrderRequest) ProtoMessage() {} - -func (x *PlaceOrderRequest) ProtoReflect() protoreflect.Message { - mi := &file_demo_proto_msgTypes[27] - 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 PlaceOrderRequest.ProtoReflect.Descriptor instead. -func (*PlaceOrderRequest) Descriptor() ([]byte, []int) { - return file_demo_proto_rawDescGZIP(), []int{27} -} - -func (x *PlaceOrderRequest) GetUserId() string { - if x != nil { - return x.UserId - } - return "" -} - -func (x *PlaceOrderRequest) GetUserCurrency() string { - if x != nil { - return x.UserCurrency - } - return "" -} - -func (x *PlaceOrderRequest) GetAddress() *Address { - if x != nil { - return x.Address - } - return nil -} - -func (x *PlaceOrderRequest) GetEmail() string { - if x != nil { - return x.Email - } - return "" -} - -func (x *PlaceOrderRequest) GetCreditCard() *CreditCardInfo { - if x != nil { - return x.CreditCard - } - return nil -} - -type PlaceOrderResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Order *OrderResult `protobuf:"bytes,1,opt,name=order,proto3" json:"order,omitempty"` -} - -func (x *PlaceOrderResponse) Reset() { - *x = PlaceOrderResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_demo_proto_msgTypes[28] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PlaceOrderResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PlaceOrderResponse) ProtoMessage() {} - -func (x *PlaceOrderResponse) ProtoReflect() protoreflect.Message { - mi := &file_demo_proto_msgTypes[28] - 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 PlaceOrderResponse.ProtoReflect.Descriptor instead. -func (*PlaceOrderResponse) Descriptor() ([]byte, []int) { - return file_demo_proto_rawDescGZIP(), []int{28} -} - -func (x *PlaceOrderResponse) GetOrder() *OrderResult { - if x != nil { - return x.Order - } - return nil -} - -type AdRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // List of important key words from the current page describing the context. - ContextKeys []string `protobuf:"bytes,1,rep,name=context_keys,json=contextKeys,proto3" json:"context_keys,omitempty"` -} - -func (x *AdRequest) Reset() { - *x = AdRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_demo_proto_msgTypes[29] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AdRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AdRequest) ProtoMessage() {} - -func (x *AdRequest) ProtoReflect() protoreflect.Message { - mi := &file_demo_proto_msgTypes[29] - 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 AdRequest.ProtoReflect.Descriptor instead. -func (*AdRequest) Descriptor() ([]byte, []int) { - return file_demo_proto_rawDescGZIP(), []int{29} -} - -func (x *AdRequest) GetContextKeys() []string { - if x != nil { - return x.ContextKeys - } - return nil -} - -type AdResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Ads []*Ad `protobuf:"bytes,1,rep,name=ads,proto3" json:"ads,omitempty"` -} - -func (x *AdResponse) Reset() { - *x = AdResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_demo_proto_msgTypes[30] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AdResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AdResponse) ProtoMessage() {} - -func (x *AdResponse) ProtoReflect() protoreflect.Message { - mi := &file_demo_proto_msgTypes[30] - 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 AdResponse.ProtoReflect.Descriptor instead. -func (*AdResponse) Descriptor() ([]byte, []int) { - return file_demo_proto_rawDescGZIP(), []int{30} -} - -func (x *AdResponse) GetAds() []*Ad { - if x != nil { - return x.Ads - } - return nil -} - -type Ad struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // url to redirect to when an ad is clicked. - 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,proto3" json:"text,omitempty"` -} - -func (x *Ad) Reset() { - *x = Ad{} - if protoimpl.UnsafeEnabled { - mi := &file_demo_proto_msgTypes[31] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Ad) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Ad) ProtoMessage() {} - -func (x *Ad) ProtoReflect() protoreflect.Message { - mi := &file_demo_proto_msgTypes[31] - 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 Ad.ProtoReflect.Descriptor instead. -func (*Ad) Descriptor() ([]byte, []int) { - return file_demo_proto_rawDescGZIP(), []int{31} -} - -func (x *Ad) GetRedirectUrl() string { - if x != nil { - return x.RedirectUrl - } - return "" -} - -func (x *Ad) GetText() string { - if x != nil { - return x.Text - } - return "" -} - -var File_demo_proto protoreflect.FileDescriptor - -var file_demo_proto_rawDesc = []byte{ - 0x0a, 0x0a, 0x64, 0x65, 0x6d, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x68, 0x69, - 0x70, 0x73, 0x74, 0x65, 0x72, 0x73, 0x68, 0x6f, 0x70, 0x22, 0x45, 0x0a, 0x08, 0x43, 0x61, 0x72, - 0x74, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x64, 0x75, - 0x63, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, - 0x22, 0x54, 0x0a, 0x0e, 0x41, 0x64, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x29, 0x0a, 0x04, 0x69, - 0x74, 0x65, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x68, 0x69, 0x70, 0x73, - 0x74, 0x65, 0x72, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x43, 0x61, 0x72, 0x74, 0x49, 0x74, 0x65, 0x6d, - 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x22, 0x2b, 0x0a, 0x10, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x43, - 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, - 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, - 0x72, 0x49, 0x64, 0x22, 0x29, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x43, 0x61, 0x72, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x4c, - 0x0a, 0x04, 0x43, 0x61, 0x72, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, - 0x2b, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, - 0x2e, 0x68, 0x69, 0x70, 0x73, 0x74, 0x65, 0x72, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x43, 0x61, 0x72, - 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x07, 0x0a, 0x05, - 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x56, 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x63, - 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, - 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x64, 0x73, 0x22, 0x3e, 0x0a, - 0x1b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, - 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x64, 0x73, 0x22, 0xba, 0x01, - 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x18, 0x0a, 0x07, 0x70, 0x69, 0x63, 0x74, 0x75, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x70, 0x69, 0x63, 0x74, 0x75, 0x72, 0x65, 0x12, 0x2f, 0x0a, 0x09, 0x70, 0x72, 0x69, - 0x63, 0x65, 0x5f, 0x75, 0x73, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x68, - 0x69, 0x70, 0x73, 0x74, 0x65, 0x72, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x4d, 0x6f, 0x6e, 0x65, 0x79, - 0x52, 0x08, 0x70, 0x72, 0x69, 0x63, 0x65, 0x55, 0x73, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x61, - 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, - 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x22, 0x48, 0x0a, 0x14, 0x4c, 0x69, - 0x73, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x30, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x68, 0x69, 0x70, 0x73, 0x74, 0x65, 0x72, 0x73, 0x68, - 0x6f, 0x70, 0x2e, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x64, - 0x75, 0x63, 0x74, 0x73, 0x22, 0x23, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, - 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x2d, 0x0a, 0x15, 0x53, 0x65, 0x61, - 0x72, 0x63, 0x68, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x48, 0x0a, 0x16, 0x53, 0x65, 0x61, 0x72, - 0x63, 0x68, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x68, 0x69, 0x70, 0x73, 0x74, 0x65, 0x72, 0x73, 0x68, 0x6f, - 0x70, 0x2e, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, - 0x74, 0x73, 0x22, 0x6e, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x68, 0x69, 0x70, 0x73, 0x74, 0x65, 0x72, - 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x07, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2b, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x68, 0x69, 0x70, 0x73, 0x74, 0x65, 0x72, 0x73, 0x68, - 0x6f, 0x70, 0x2e, 0x43, 0x61, 0x72, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x69, 0x74, 0x65, - 0x6d, 0x73, 0x22, 0x41, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x08, 0x63, 0x6f, 0x73, 0x74, 0x5f, 0x75, - 0x73, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x68, 0x69, 0x70, 0x73, 0x74, - 0x65, 0x72, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x52, 0x07, 0x63, 0x6f, - 0x73, 0x74, 0x55, 0x73, 0x64, 0x22, 0x6f, 0x0a, 0x10, 0x53, 0x68, 0x69, 0x70, 0x4f, 0x72, 0x64, - 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x07, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x68, 0x69, 0x70, - 0x73, 0x74, 0x65, 0x72, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2b, 0x0a, 0x05, 0x69, 0x74, 0x65, - 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x68, 0x69, 0x70, 0x73, 0x74, - 0x65, 0x72, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x43, 0x61, 0x72, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, - 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x34, 0x0a, 0x11, 0x53, 0x68, 0x69, 0x70, 0x4f, 0x72, - 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x74, - 0x72, 0x61, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x49, 0x64, 0x22, 0x8f, 0x01, 0x0a, - 0x07, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x74, 0x72, 0x65, - 0x65, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0d, 0x73, 0x74, 0x72, 0x65, 0x65, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, - 0x12, 0x0a, 0x04, 0x63, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, - 0x69, 0x74, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 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, 0x19, 0x0a, 0x08, 0x7a, 0x69, 0x70, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x7a, 0x69, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x22, 0x58, - 0x0a, 0x05, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x75, 0x72, 0x72, 0x65, - 0x6e, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, - 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, - 0x75, 0x6e, 0x69, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x75, 0x6e, 0x69, - 0x74, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x05, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x22, 0x47, 0x0a, 0x1e, 0x47, 0x65, 0x74, 0x53, - 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x69, - 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x75, - 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x0d, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x43, 0x6f, 0x64, 0x65, - 0x73, 0x22, 0x5c, 0x0a, 0x19, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x43, 0x6f, 0x6e, - 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, - 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x68, - 0x69, 0x70, 0x73, 0x74, 0x65, 0x72, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x4d, 0x6f, 0x6e, 0x65, 0x79, - 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x6f, 0x5f, 0x63, 0x6f, 0x64, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x6f, 0x43, 0x6f, 0x64, 0x65, 0x22, - 0xe6, 0x01, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x64, 0x69, 0x74, 0x43, 0x61, 0x72, 0x64, 0x49, 0x6e, - 0x66, 0x6f, 0x12, 0x2c, 0x0a, 0x12, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x5f, 0x63, 0x61, 0x72, - 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, - 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x43, 0x61, 0x72, 0x64, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, - 0x12, 0x26, 0x0a, 0x0f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x5f, 0x63, 0x61, 0x72, 0x64, 0x5f, - 0x63, 0x76, 0x76, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x63, 0x72, 0x65, 0x64, 0x69, - 0x74, 0x43, 0x61, 0x72, 0x64, 0x43, 0x76, 0x76, 0x12, 0x3d, 0x0a, 0x1b, 0x63, 0x72, 0x65, 0x64, - 0x69, 0x74, 0x5f, 0x63, 0x61, 0x72, 0x64, 0x5f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x79, 0x65, 0x61, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x18, 0x63, - 0x72, 0x65, 0x64, 0x69, 0x74, 0x43, 0x61, 0x72, 0x64, 0x45, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x59, 0x65, 0x61, 0x72, 0x12, 0x3f, 0x0a, 0x1c, 0x63, 0x72, 0x65, 0x64, 0x69, - 0x74, 0x5f, 0x63, 0x61, 0x72, 0x64, 0x5f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x19, 0x63, - 0x72, 0x65, 0x64, 0x69, 0x74, 0x43, 0x61, 0x72, 0x64, 0x45, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x4d, 0x6f, 0x6e, 0x74, 0x68, 0x22, 0x79, 0x0a, 0x0d, 0x43, 0x68, 0x61, 0x72, - 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x06, 0x61, 0x6d, 0x6f, - 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x68, 0x69, 0x70, 0x73, - 0x74, 0x65, 0x72, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x52, 0x06, 0x61, - 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x3c, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x5f, - 0x63, 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x68, 0x69, 0x70, - 0x73, 0x74, 0x65, 0x72, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x43, 0x72, 0x65, 0x64, 0x69, 0x74, 0x43, - 0x61, 0x72, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x43, - 0x61, 0x72, 0x64, 0x22, 0x37, 0x0a, 0x0e, 0x43, 0x68, 0x61, 0x72, 0x67, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x74, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x5e, 0x0a, 0x09, - 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x29, 0x0a, 0x04, 0x69, 0x74, 0x65, - 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x68, 0x69, 0x70, 0x73, 0x74, 0x65, - 0x72, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x43, 0x61, 0x72, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x04, - 0x69, 0x74, 0x65, 0x6d, 0x12, 0x26, 0x0a, 0x04, 0x63, 0x6f, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x68, 0x69, 0x70, 0x73, 0x74, 0x65, 0x72, 0x73, 0x68, 0x6f, 0x70, - 0x2e, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x52, 0x04, 0x63, 0x6f, 0x73, 0x74, 0x22, 0x82, 0x02, 0x0a, - 0x0b, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x19, 0x0a, 0x08, - 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x6f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x30, 0x0a, 0x14, 0x73, 0x68, 0x69, 0x70, 0x70, - 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x54, - 0x72, 0x61, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x49, 0x64, 0x12, 0x37, 0x0a, 0x0d, 0x73, 0x68, 0x69, - 0x70, 0x70, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x12, 0x2e, 0x68, 0x69, 0x70, 0x73, 0x74, 0x65, 0x72, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x4d, - 0x6f, 0x6e, 0x65, 0x79, 0x52, 0x0c, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x43, 0x6f, - 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x10, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x5f, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x68, - 0x69, 0x70, 0x73, 0x74, 0x65, 0x72, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x52, 0x0f, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x12, 0x2c, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x05, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x68, 0x69, 0x70, 0x73, 0x74, 0x65, 0x72, 0x73, 0x68, 0x6f, 0x70, - 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, - 0x73, 0x22, 0x64, 0x0a, 0x1c, 0x53, 0x65, 0x6e, 0x64, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x2e, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x68, 0x69, 0x70, 0x73, 0x74, 0x65, 0x72, - 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, - 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x22, 0xd5, 0x01, 0x0a, 0x11, 0x50, 0x6c, 0x61, 0x63, - 0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, - 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x63, - 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x75, - 0x73, 0x65, 0x72, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x2e, 0x0a, 0x07, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x68, - 0x69, 0x70, 0x73, 0x74, 0x65, 0x72, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x65, - 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, - 0x6c, 0x12, 0x3c, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x5f, 0x63, 0x61, 0x72, 0x64, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x68, 0x69, 0x70, 0x73, 0x74, 0x65, 0x72, - 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x43, 0x72, 0x65, 0x64, 0x69, 0x74, 0x43, 0x61, 0x72, 0x64, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x43, 0x61, 0x72, 0x64, 0x22, - 0x44, 0x0a, 0x12, 0x50, 0x6c, 0x61, 0x63, 0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x68, 0x69, 0x70, 0x73, 0x74, 0x65, 0x72, 0x73, 0x68, - 0x6f, 0x70, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x05, - 0x6f, 0x72, 0x64, 0x65, 0x72, 0x22, 0x2e, 0x0a, 0x09, 0x41, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x6b, 0x65, - 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, - 0x74, 0x4b, 0x65, 0x79, 0x73, 0x22, 0x2f, 0x0a, 0x0a, 0x41, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x03, 0x61, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x0f, 0x2e, 0x68, 0x69, 0x70, 0x73, 0x74, 0x65, 0x72, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x41, - 0x64, 0x52, 0x03, 0x61, 0x64, 0x73, 0x22, 0x3b, 0x0a, 0x02, 0x41, 0x64, 0x12, 0x21, 0x0a, 0x0c, - 0x72, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x55, 0x72, 0x6c, 0x12, - 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, - 0x65, 0x78, 0x74, 0x32, 0xca, 0x01, 0x0a, 0x0b, 0x43, 0x61, 0x72, 0x74, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x12, 0x3c, 0x0a, 0x07, 0x41, 0x64, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x1b, - 0x2e, 0x68, 0x69, 0x70, 0x73, 0x74, 0x65, 0x72, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x41, 0x64, 0x64, - 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x68, 0x69, - 0x70, 0x73, 0x74, 0x65, 0x72, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, - 0x00, 0x12, 0x3b, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x43, 0x61, 0x72, 0x74, 0x12, 0x1b, 0x2e, 0x68, - 0x69, 0x70, 0x73, 0x74, 0x65, 0x72, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x61, - 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x68, 0x69, 0x70, 0x73, - 0x74, 0x65, 0x72, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x43, 0x61, 0x72, 0x74, 0x22, 0x00, 0x12, 0x40, - 0x0a, 0x09, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x43, 0x61, 0x72, 0x74, 0x12, 0x1d, 0x2e, 0x68, 0x69, - 0x70, 0x73, 0x74, 0x65, 0x72, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x43, - 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x68, 0x69, 0x70, - 0x73, 0x74, 0x65, 0x72, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, - 0x32, 0x83, 0x01, 0x0a, 0x15, 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6a, 0x0a, 0x13, 0x4c, 0x69, - 0x73, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x12, 0x27, 0x2e, 0x68, 0x69, 0x70, 0x73, 0x74, 0x65, 0x72, 0x73, 0x68, 0x6f, 0x70, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x68, 0x69, 0x70, - 0x73, 0x74, 0x65, 0x72, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x63, - 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x32, 0x83, 0x02, 0x0a, 0x15, 0x50, 0x72, 0x6f, 0x64, 0x75, - 0x63, 0x74, 0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x12, 0x47, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x73, - 0x12, 0x12, 0x2e, 0x68, 0x69, 0x70, 0x73, 0x74, 0x65, 0x72, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x21, 0x2e, 0x68, 0x69, 0x70, 0x73, 0x74, 0x65, 0x72, 0x73, 0x68, - 0x6f, 0x70, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x44, 0x0a, 0x0a, 0x47, 0x65, 0x74, - 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x12, 0x1e, 0x2e, 0x68, 0x69, 0x70, 0x73, 0x74, 0x65, - 0x72, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x68, 0x69, 0x70, 0x73, 0x74, 0x65, - 0x72, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x22, 0x00, 0x12, - 0x5b, 0x0a, 0x0e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, - 0x73, 0x12, 0x22, 0x2e, 0x68, 0x69, 0x70, 0x73, 0x74, 0x65, 0x72, 0x73, 0x68, 0x6f, 0x70, 0x2e, - 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x68, 0x69, 0x70, 0x73, 0x74, 0x65, 0x72, 0x73, - 0x68, 0x6f, 0x70, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, - 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x32, 0xaa, 0x01, 0x0a, - 0x0f, 0x53, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x12, 0x49, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x12, 0x1c, 0x2e, 0x68, - 0x69, 0x70, 0x73, 0x74, 0x65, 0x72, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x47, 0x65, 0x74, 0x51, 0x75, - 0x6f, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x68, 0x69, 0x70, - 0x73, 0x74, 0x65, 0x72, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x47, 0x65, 0x74, 0x51, 0x75, 0x6f, 0x74, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x09, 0x53, - 0x68, 0x69, 0x70, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x1d, 0x2e, 0x68, 0x69, 0x70, 0x73, 0x74, - 0x65, 0x72, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x53, 0x68, 0x69, 0x70, 0x4f, 0x72, 0x64, 0x65, 0x72, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x68, 0x69, 0x70, 0x73, 0x74, 0x65, - 0x72, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x53, 0x68, 0x69, 0x70, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x32, 0xb7, 0x01, 0x0a, 0x0f, 0x43, 0x75, - 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x5b, 0x0a, - 0x16, 0x47, 0x65, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x43, 0x75, 0x72, - 0x72, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x12, 0x12, 0x2e, 0x68, 0x69, 0x70, 0x73, 0x74, 0x65, - 0x72, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x2b, 0x2e, 0x68, 0x69, - 0x70, 0x73, 0x74, 0x65, 0x72, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x75, 0x70, - 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x47, 0x0a, 0x07, 0x43, 0x6f, - 0x6e, 0x76, 0x65, 0x72, 0x74, 0x12, 0x26, 0x2e, 0x68, 0x69, 0x70, 0x73, 0x74, 0x65, 0x72, 0x73, - 0x68, 0x6f, 0x70, 0x2e, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, - 0x68, 0x69, 0x70, 0x73, 0x74, 0x65, 0x72, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x4d, 0x6f, 0x6e, 0x65, - 0x79, 0x22, 0x00, 0x32, 0x55, 0x0a, 0x0e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x43, 0x0a, 0x06, 0x43, 0x68, 0x61, 0x72, 0x67, 0x65, 0x12, - 0x1a, 0x2e, 0x68, 0x69, 0x70, 0x73, 0x74, 0x65, 0x72, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x43, 0x68, - 0x61, 0x72, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x68, 0x69, - 0x70, 0x73, 0x74, 0x65, 0x72, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x43, 0x68, 0x61, 0x72, 0x67, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x32, 0x68, 0x0a, 0x0c, 0x45, 0x6d, - 0x61, 0x69, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x58, 0x0a, 0x15, 0x53, 0x65, - 0x6e, 0x64, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x2e, 0x68, 0x69, 0x70, 0x73, 0x74, 0x65, 0x72, 0x73, 0x68, 0x6f, - 0x70, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, - 0x2e, 0x68, 0x69, 0x70, 0x73, 0x74, 0x65, 0x72, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x22, 0x00, 0x32, 0x62, 0x0a, 0x0f, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x6f, 0x75, 0x74, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4f, 0x0a, 0x0a, 0x50, 0x6c, 0x61, 0x63, 0x65, - 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x1e, 0x2e, 0x68, 0x69, 0x70, 0x73, 0x74, 0x65, 0x72, 0x73, - 0x68, 0x6f, 0x70, 0x2e, 0x50, 0x6c, 0x61, 0x63, 0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x68, 0x69, 0x70, 0x73, 0x74, 0x65, 0x72, 0x73, - 0x68, 0x6f, 0x70, 0x2e, 0x50, 0x6c, 0x61, 0x63, 0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x32, 0x48, 0x0a, 0x09, 0x41, 0x64, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3b, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x41, 0x64, 0x73, 0x12, - 0x16, 0x2e, 0x68, 0x69, 0x70, 0x73, 0x74, 0x65, 0x72, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x41, 0x64, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x68, 0x69, 0x70, 0x73, 0x74, 0x65, - 0x72, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x41, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x42, 0x16, 0x5a, 0x14, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x68, - 0x69, 0x70, 0x73, 0x74, 0x65, 0x72, 0x73, 0x68, 0x6f, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, -} - -var ( - file_demo_proto_rawDescOnce sync.Once - file_demo_proto_rawDescData = file_demo_proto_rawDesc -) - -func file_demo_proto_rawDescGZIP() []byte { - file_demo_proto_rawDescOnce.Do(func() { - file_demo_proto_rawDescData = protoimpl.X.CompressGZIP(file_demo_proto_rawDescData) - }) - return file_demo_proto_rawDescData -} - -var file_demo_proto_msgTypes = make([]protoimpl.MessageInfo, 32) -var file_demo_proto_goTypes = []interface{}{ - (*CartItem)(nil), // 0: hipstershop.CartItem - (*AddItemRequest)(nil), // 1: hipstershop.AddItemRequest - (*EmptyCartRequest)(nil), // 2: hipstershop.EmptyCartRequest - (*GetCartRequest)(nil), // 3: hipstershop.GetCartRequest - (*Cart)(nil), // 4: hipstershop.Cart - (*Empty)(nil), // 5: hipstershop.Empty - (*ListRecommendationsRequest)(nil), // 6: hipstershop.ListRecommendationsRequest - (*ListRecommendationsResponse)(nil), // 7: hipstershop.ListRecommendationsResponse - (*Product)(nil), // 8: hipstershop.Product - (*ListProductsResponse)(nil), // 9: hipstershop.ListProductsResponse - (*GetProductRequest)(nil), // 10: hipstershop.GetProductRequest - (*SearchProductsRequest)(nil), // 11: hipstershop.SearchProductsRequest - (*SearchProductsResponse)(nil), // 12: hipstershop.SearchProductsResponse - (*GetQuoteRequest)(nil), // 13: hipstershop.GetQuoteRequest - (*GetQuoteResponse)(nil), // 14: hipstershop.GetQuoteResponse - (*ShipOrderRequest)(nil), // 15: hipstershop.ShipOrderRequest - (*ShipOrderResponse)(nil), // 16: hipstershop.ShipOrderResponse - (*Address)(nil), // 17: hipstershop.Address - (*Money)(nil), // 18: hipstershop.Money - (*GetSupportedCurrenciesResponse)(nil), // 19: hipstershop.GetSupportedCurrenciesResponse - (*CurrencyConversionRequest)(nil), // 20: hipstershop.CurrencyConversionRequest - (*CreditCardInfo)(nil), // 21: hipstershop.CreditCardInfo - (*ChargeRequest)(nil), // 22: hipstershop.ChargeRequest - (*ChargeResponse)(nil), // 23: hipstershop.ChargeResponse - (*OrderItem)(nil), // 24: hipstershop.OrderItem - (*OrderResult)(nil), // 25: hipstershop.OrderResult - (*SendOrderConfirmationRequest)(nil), // 26: hipstershop.SendOrderConfirmationRequest - (*PlaceOrderRequest)(nil), // 27: hipstershop.PlaceOrderRequest - (*PlaceOrderResponse)(nil), // 28: hipstershop.PlaceOrderResponse - (*AdRequest)(nil), // 29: hipstershop.AdRequest - (*AdResponse)(nil), // 30: hipstershop.AdResponse - (*Ad)(nil), // 31: hipstershop.Ad -} -var file_demo_proto_depIdxs = []int32{ - 0, // 0: hipstershop.AddItemRequest.item:type_name -> hipstershop.CartItem - 0, // 1: hipstershop.Cart.items:type_name -> hipstershop.CartItem - 18, // 2: hipstershop.Product.price_usd:type_name -> hipstershop.Money - 8, // 3: hipstershop.ListProductsResponse.products:type_name -> hipstershop.Product - 8, // 4: hipstershop.SearchProductsResponse.results:type_name -> hipstershop.Product - 17, // 5: hipstershop.GetQuoteRequest.address:type_name -> hipstershop.Address - 0, // 6: hipstershop.GetQuoteRequest.items:type_name -> hipstershop.CartItem - 18, // 7: hipstershop.GetQuoteResponse.cost_usd:type_name -> hipstershop.Money - 17, // 8: hipstershop.ShipOrderRequest.address:type_name -> hipstershop.Address - 0, // 9: hipstershop.ShipOrderRequest.items:type_name -> hipstershop.CartItem - 18, // 10: hipstershop.CurrencyConversionRequest.from:type_name -> hipstershop.Money - 18, // 11: hipstershop.ChargeRequest.amount:type_name -> hipstershop.Money - 21, // 12: hipstershop.ChargeRequest.credit_card:type_name -> hipstershop.CreditCardInfo - 0, // 13: hipstershop.OrderItem.item:type_name -> hipstershop.CartItem - 18, // 14: hipstershop.OrderItem.cost:type_name -> hipstershop.Money - 18, // 15: hipstershop.OrderResult.shipping_cost:type_name -> hipstershop.Money - 17, // 16: hipstershop.OrderResult.shipping_address:type_name -> hipstershop.Address - 24, // 17: hipstershop.OrderResult.items:type_name -> hipstershop.OrderItem - 25, // 18: hipstershop.SendOrderConfirmationRequest.order:type_name -> hipstershop.OrderResult - 17, // 19: hipstershop.PlaceOrderRequest.address:type_name -> hipstershop.Address - 21, // 20: hipstershop.PlaceOrderRequest.credit_card:type_name -> hipstershop.CreditCardInfo - 25, // 21: hipstershop.PlaceOrderResponse.order:type_name -> hipstershop.OrderResult - 31, // 22: hipstershop.AdResponse.ads:type_name -> hipstershop.Ad - 1, // 23: hipstershop.CartService.AddItem:input_type -> hipstershop.AddItemRequest - 3, // 24: hipstershop.CartService.GetCart:input_type -> hipstershop.GetCartRequest - 2, // 25: hipstershop.CartService.EmptyCart:input_type -> hipstershop.EmptyCartRequest - 6, // 26: hipstershop.RecommendationService.ListRecommendations:input_type -> hipstershop.ListRecommendationsRequest - 5, // 27: hipstershop.ProductCatalogService.ListProducts:input_type -> hipstershop.Empty - 10, // 28: hipstershop.ProductCatalogService.GetProduct:input_type -> hipstershop.GetProductRequest - 11, // 29: hipstershop.ProductCatalogService.SearchProducts:input_type -> hipstershop.SearchProductsRequest - 13, // 30: hipstershop.ShippingService.GetQuote:input_type -> hipstershop.GetQuoteRequest - 15, // 31: hipstershop.ShippingService.ShipOrder:input_type -> hipstershop.ShipOrderRequest - 5, // 32: hipstershop.CurrencyService.GetSupportedCurrencies:input_type -> hipstershop.Empty - 20, // 33: hipstershop.CurrencyService.Convert:input_type -> hipstershop.CurrencyConversionRequest - 22, // 34: hipstershop.PaymentService.Charge:input_type -> hipstershop.ChargeRequest - 26, // 35: hipstershop.EmailService.SendOrderConfirmation:input_type -> hipstershop.SendOrderConfirmationRequest - 27, // 36: hipstershop.CheckoutService.PlaceOrder:input_type -> hipstershop.PlaceOrderRequest - 29, // 37: hipstershop.AdService.GetAds:input_type -> hipstershop.AdRequest - 5, // 38: hipstershop.CartService.AddItem:output_type -> hipstershop.Empty - 4, // 39: hipstershop.CartService.GetCart:output_type -> hipstershop.Cart - 5, // 40: hipstershop.CartService.EmptyCart:output_type -> hipstershop.Empty - 7, // 41: hipstershop.RecommendationService.ListRecommendations:output_type -> hipstershop.ListRecommendationsResponse - 9, // 42: hipstershop.ProductCatalogService.ListProducts:output_type -> hipstershop.ListProductsResponse - 8, // 43: hipstershop.ProductCatalogService.GetProduct:output_type -> hipstershop.Product - 12, // 44: hipstershop.ProductCatalogService.SearchProducts:output_type -> hipstershop.SearchProductsResponse - 14, // 45: hipstershop.ShippingService.GetQuote:output_type -> hipstershop.GetQuoteResponse - 16, // 46: hipstershop.ShippingService.ShipOrder:output_type -> hipstershop.ShipOrderResponse - 19, // 47: hipstershop.CurrencyService.GetSupportedCurrencies:output_type -> hipstershop.GetSupportedCurrenciesResponse - 18, // 48: hipstershop.CurrencyService.Convert:output_type -> hipstershop.Money - 23, // 49: hipstershop.PaymentService.Charge:output_type -> hipstershop.ChargeResponse - 5, // 50: hipstershop.EmailService.SendOrderConfirmation:output_type -> hipstershop.Empty - 28, // 51: hipstershop.CheckoutService.PlaceOrder:output_type -> hipstershop.PlaceOrderResponse - 30, // 52: hipstershop.AdService.GetAds:output_type -> hipstershop.AdResponse - 38, // [38:53] is the sub-list for method output_type - 23, // [23:38] is the sub-list for method input_type - 23, // [23:23] is the sub-list for extension type_name - 23, // [23:23] is the sub-list for extension extendee - 0, // [0:23] is the sub-list for field type_name -} - -func init() { file_demo_proto_init() } -func file_demo_proto_init() { - if File_demo_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_demo_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CartItem); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_demo_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddItemRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_demo_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EmptyCartRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_demo_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetCartRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_demo_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Cart); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_demo_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Empty); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_demo_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListRecommendationsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_demo_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListRecommendationsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_demo_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Product); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_demo_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListProductsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_demo_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetProductRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_demo_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SearchProductsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_demo_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SearchProductsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_demo_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetQuoteRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_demo_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetQuoteResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_demo_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ShipOrderRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_demo_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ShipOrderResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_demo_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Address); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_demo_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Money); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_demo_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetSupportedCurrenciesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_demo_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CurrencyConversionRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_demo_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreditCardInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_demo_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ChargeRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_demo_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ChargeResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_demo_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OrderItem); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_demo_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OrderResult); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_demo_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SendOrderConfirmationRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_demo_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PlaceOrderRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_demo_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PlaceOrderResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_demo_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AdRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_demo_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AdResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_demo_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Ad); 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_demo_proto_rawDesc, - NumEnums: 0, - NumMessages: 32, - NumExtensions: 0, - NumServices: 9, - }, - GoTypes: file_demo_proto_goTypes, - DependencyIndexes: file_demo_proto_depIdxs, - MessageInfos: file_demo_proto_msgTypes, - }.Build() - File_demo_proto = out.File - file_demo_proto_rawDesc = nil - file_demo_proto_goTypes = nil - file_demo_proto_depIdxs = nil -} diff --git a/src/shippingservice/genproto/hipstershop/demo_grpc.pb.go b/src/shippingservice/genproto/hipstershop/demo_grpc.pb.go deleted file mode 100644 index 0ce80540bd..0000000000 --- a/src/shippingservice/genproto/hipstershop/demo_grpc.pb.go +++ /dev/null @@ -1,1009 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.6.1 -// source: demo.proto - -package hipstershop - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// 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 - -// CartServiceClient is the client API for CartService 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 CartServiceClient interface { - AddItem(ctx context.Context, in *AddItemRequest, opts ...grpc.CallOption) (*Empty, error) - GetCart(ctx context.Context, in *GetCartRequest, opts ...grpc.CallOption) (*Cart, error) - EmptyCart(ctx context.Context, in *EmptyCartRequest, opts ...grpc.CallOption) (*Empty, error) -} - -type cartServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewCartServiceClient(cc grpc.ClientConnInterface) CartServiceClient { - return &cartServiceClient{cc} -} - -func (c *cartServiceClient) AddItem(ctx context.Context, in *AddItemRequest, opts ...grpc.CallOption) (*Empty, error) { - out := new(Empty) - err := c.cc.Invoke(ctx, "/hipstershop.CartService/AddItem", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *cartServiceClient) GetCart(ctx context.Context, in *GetCartRequest, opts ...grpc.CallOption) (*Cart, error) { - out := new(Cart) - err := c.cc.Invoke(ctx, "/hipstershop.CartService/GetCart", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *cartServiceClient) EmptyCart(ctx context.Context, in *EmptyCartRequest, opts ...grpc.CallOption) (*Empty, error) { - out := new(Empty) - err := c.cc.Invoke(ctx, "/hipstershop.CartService/EmptyCart", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// CartServiceServer is the server API for CartService service. -// All implementations must embed UnimplementedCartServiceServer -// for forward compatibility -type CartServiceServer interface { - AddItem(context.Context, *AddItemRequest) (*Empty, error) - GetCart(context.Context, *GetCartRequest) (*Cart, error) - EmptyCart(context.Context, *EmptyCartRequest) (*Empty, error) - mustEmbedUnimplementedCartServiceServer() -} - -// UnimplementedCartServiceServer must be embedded to have forward compatible implementations. -type UnimplementedCartServiceServer struct { -} - -func (UnimplementedCartServiceServer) AddItem(context.Context, *AddItemRequest) (*Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method AddItem not implemented") -} -func (UnimplementedCartServiceServer) GetCart(context.Context, *GetCartRequest) (*Cart, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetCart not implemented") -} -func (UnimplementedCartServiceServer) EmptyCart(context.Context, *EmptyCartRequest) (*Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method EmptyCart not implemented") -} -func (UnimplementedCartServiceServer) mustEmbedUnimplementedCartServiceServer() {} - -// UnsafeCartServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to CartServiceServer will -// result in compilation errors. -type UnsafeCartServiceServer interface { - mustEmbedUnimplementedCartServiceServer() -} - -func RegisterCartServiceServer(s grpc.ServiceRegistrar, srv CartServiceServer) { - s.RegisterService(&CartService_ServiceDesc, srv) -} - -func _CartService_AddItem_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AddItemRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CartServiceServer).AddItem(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/hipstershop.CartService/AddItem", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CartServiceServer).AddItem(ctx, req.(*AddItemRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _CartService_GetCart_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetCartRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CartServiceServer).GetCart(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/hipstershop.CartService/GetCart", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CartServiceServer).GetCart(ctx, req.(*GetCartRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _CartService_EmptyCart_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(EmptyCartRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CartServiceServer).EmptyCart(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/hipstershop.CartService/EmptyCart", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CartServiceServer).EmptyCart(ctx, req.(*EmptyCartRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// CartService_ServiceDesc is the grpc.ServiceDesc for CartService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var CartService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "hipstershop.CartService", - HandlerType: (*CartServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "AddItem", - Handler: _CartService_AddItem_Handler, - }, - { - MethodName: "GetCart", - Handler: _CartService_GetCart_Handler, - }, - { - MethodName: "EmptyCart", - Handler: _CartService_EmptyCart_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "demo.proto", -} - -// RecommendationServiceClient is the client API for RecommendationService 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 RecommendationServiceClient interface { - ListRecommendations(ctx context.Context, in *ListRecommendationsRequest, opts ...grpc.CallOption) (*ListRecommendationsResponse, error) -} - -type recommendationServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewRecommendationServiceClient(cc grpc.ClientConnInterface) RecommendationServiceClient { - return &recommendationServiceClient{cc} -} - -func (c *recommendationServiceClient) ListRecommendations(ctx context.Context, in *ListRecommendationsRequest, opts ...grpc.CallOption) (*ListRecommendationsResponse, error) { - out := new(ListRecommendationsResponse) - err := c.cc.Invoke(ctx, "/hipstershop.RecommendationService/ListRecommendations", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// RecommendationServiceServer is the server API for RecommendationService service. -// All implementations must embed UnimplementedRecommendationServiceServer -// for forward compatibility -type RecommendationServiceServer interface { - ListRecommendations(context.Context, *ListRecommendationsRequest) (*ListRecommendationsResponse, error) - mustEmbedUnimplementedRecommendationServiceServer() -} - -// UnimplementedRecommendationServiceServer must be embedded to have forward compatible implementations. -type UnimplementedRecommendationServiceServer struct { -} - -func (UnimplementedRecommendationServiceServer) ListRecommendations(context.Context, *ListRecommendationsRequest) (*ListRecommendationsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListRecommendations not implemented") -} -func (UnimplementedRecommendationServiceServer) mustEmbedUnimplementedRecommendationServiceServer() {} - -// UnsafeRecommendationServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to RecommendationServiceServer will -// result in compilation errors. -type UnsafeRecommendationServiceServer interface { - mustEmbedUnimplementedRecommendationServiceServer() -} - -func RegisterRecommendationServiceServer(s grpc.ServiceRegistrar, srv RecommendationServiceServer) { - s.RegisterService(&RecommendationService_ServiceDesc, srv) -} - -func _RecommendationService_ListRecommendations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListRecommendationsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RecommendationServiceServer).ListRecommendations(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/hipstershop.RecommendationService/ListRecommendations", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RecommendationServiceServer).ListRecommendations(ctx, req.(*ListRecommendationsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// RecommendationService_ServiceDesc is the grpc.ServiceDesc for RecommendationService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var RecommendationService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "hipstershop.RecommendationService", - HandlerType: (*RecommendationServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ListRecommendations", - Handler: _RecommendationService_ListRecommendations_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "demo.proto", -} - -// ProductCatalogServiceClient is the client API for ProductCatalogService 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 ProductCatalogServiceClient interface { - ListProducts(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ListProductsResponse, error) - GetProduct(ctx context.Context, in *GetProductRequest, opts ...grpc.CallOption) (*Product, error) - SearchProducts(ctx context.Context, in *SearchProductsRequest, opts ...grpc.CallOption) (*SearchProductsResponse, error) -} - -type productCatalogServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewProductCatalogServiceClient(cc grpc.ClientConnInterface) ProductCatalogServiceClient { - return &productCatalogServiceClient{cc} -} - -func (c *productCatalogServiceClient) ListProducts(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ListProductsResponse, error) { - out := new(ListProductsResponse) - err := c.cc.Invoke(ctx, "/hipstershop.ProductCatalogService/ListProducts", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *productCatalogServiceClient) GetProduct(ctx context.Context, in *GetProductRequest, opts ...grpc.CallOption) (*Product, error) { - out := new(Product) - err := c.cc.Invoke(ctx, "/hipstershop.ProductCatalogService/GetProduct", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *productCatalogServiceClient) SearchProducts(ctx context.Context, in *SearchProductsRequest, opts ...grpc.CallOption) (*SearchProductsResponse, error) { - out := new(SearchProductsResponse) - err := c.cc.Invoke(ctx, "/hipstershop.ProductCatalogService/SearchProducts", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ProductCatalogServiceServer is the server API for ProductCatalogService service. -// All implementations must embed UnimplementedProductCatalogServiceServer -// for forward compatibility -type ProductCatalogServiceServer interface { - ListProducts(context.Context, *Empty) (*ListProductsResponse, error) - GetProduct(context.Context, *GetProductRequest) (*Product, error) - SearchProducts(context.Context, *SearchProductsRequest) (*SearchProductsResponse, error) - mustEmbedUnimplementedProductCatalogServiceServer() -} - -// UnimplementedProductCatalogServiceServer must be embedded to have forward compatible implementations. -type UnimplementedProductCatalogServiceServer struct { -} - -func (UnimplementedProductCatalogServiceServer) ListProducts(context.Context, *Empty) (*ListProductsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListProducts not implemented") -} -func (UnimplementedProductCatalogServiceServer) GetProduct(context.Context, *GetProductRequest) (*Product, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetProduct not implemented") -} -func (UnimplementedProductCatalogServiceServer) SearchProducts(context.Context, *SearchProductsRequest) (*SearchProductsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SearchProducts not implemented") -} -func (UnimplementedProductCatalogServiceServer) mustEmbedUnimplementedProductCatalogServiceServer() {} - -// UnsafeProductCatalogServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to ProductCatalogServiceServer will -// result in compilation errors. -type UnsafeProductCatalogServiceServer interface { - mustEmbedUnimplementedProductCatalogServiceServer() -} - -func RegisterProductCatalogServiceServer(s grpc.ServiceRegistrar, srv ProductCatalogServiceServer) { - s.RegisterService(&ProductCatalogService_ServiceDesc, srv) -} - -func _ProductCatalogService_ListProducts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Empty) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ProductCatalogServiceServer).ListProducts(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/hipstershop.ProductCatalogService/ListProducts", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ProductCatalogServiceServer).ListProducts(ctx, req.(*Empty)) - } - return interceptor(ctx, in, info, handler) -} - -func _ProductCatalogService_GetProduct_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetProductRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ProductCatalogServiceServer).GetProduct(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/hipstershop.ProductCatalogService/GetProduct", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ProductCatalogServiceServer).GetProduct(ctx, req.(*GetProductRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ProductCatalogService_SearchProducts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SearchProductsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ProductCatalogServiceServer).SearchProducts(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/hipstershop.ProductCatalogService/SearchProducts", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ProductCatalogServiceServer).SearchProducts(ctx, req.(*SearchProductsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// ProductCatalogService_ServiceDesc is the grpc.ServiceDesc for ProductCatalogService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var ProductCatalogService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "hipstershop.ProductCatalogService", - HandlerType: (*ProductCatalogServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ListProducts", - Handler: _ProductCatalogService_ListProducts_Handler, - }, - { - MethodName: "GetProduct", - Handler: _ProductCatalogService_GetProduct_Handler, - }, - { - MethodName: "SearchProducts", - Handler: _ProductCatalogService_SearchProducts_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "demo.proto", -} - -// ShippingServiceClient is the client API for ShippingService 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 ShippingServiceClient interface { - GetQuote(ctx context.Context, in *GetQuoteRequest, opts ...grpc.CallOption) (*GetQuoteResponse, error) - ShipOrder(ctx context.Context, in *ShipOrderRequest, opts ...grpc.CallOption) (*ShipOrderResponse, error) -} - -type shippingServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewShippingServiceClient(cc grpc.ClientConnInterface) ShippingServiceClient { - return &shippingServiceClient{cc} -} - -func (c *shippingServiceClient) GetQuote(ctx context.Context, in *GetQuoteRequest, opts ...grpc.CallOption) (*GetQuoteResponse, error) { - out := new(GetQuoteResponse) - err := c.cc.Invoke(ctx, "/hipstershop.ShippingService/GetQuote", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *shippingServiceClient) ShipOrder(ctx context.Context, in *ShipOrderRequest, opts ...grpc.CallOption) (*ShipOrderResponse, error) { - out := new(ShipOrderResponse) - err := c.cc.Invoke(ctx, "/hipstershop.ShippingService/ShipOrder", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ShippingServiceServer is the server API for ShippingService service. -// All implementations must embed UnimplementedShippingServiceServer -// for forward compatibility -type ShippingServiceServer interface { - GetQuote(context.Context, *GetQuoteRequest) (*GetQuoteResponse, error) - ShipOrder(context.Context, *ShipOrderRequest) (*ShipOrderResponse, error) - mustEmbedUnimplementedShippingServiceServer() -} - -// UnimplementedShippingServiceServer must be embedded to have forward compatible implementations. -type UnimplementedShippingServiceServer struct { -} - -func (UnimplementedShippingServiceServer) GetQuote(context.Context, *GetQuoteRequest) (*GetQuoteResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetQuote not implemented") -} -func (UnimplementedShippingServiceServer) ShipOrder(context.Context, *ShipOrderRequest) (*ShipOrderResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ShipOrder not implemented") -} -func (UnimplementedShippingServiceServer) mustEmbedUnimplementedShippingServiceServer() {} - -// UnsafeShippingServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to ShippingServiceServer will -// result in compilation errors. -type UnsafeShippingServiceServer interface { - mustEmbedUnimplementedShippingServiceServer() -} - -func RegisterShippingServiceServer(s grpc.ServiceRegistrar, srv ShippingServiceServer) { - s.RegisterService(&ShippingService_ServiceDesc, srv) -} - -func _ShippingService_GetQuote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetQuoteRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ShippingServiceServer).GetQuote(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/hipstershop.ShippingService/GetQuote", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ShippingServiceServer).GetQuote(ctx, req.(*GetQuoteRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ShippingService_ShipOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ShipOrderRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ShippingServiceServer).ShipOrder(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/hipstershop.ShippingService/ShipOrder", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ShippingServiceServer).ShipOrder(ctx, req.(*ShipOrderRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// ShippingService_ServiceDesc is the grpc.ServiceDesc for ShippingService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var ShippingService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "hipstershop.ShippingService", - HandlerType: (*ShippingServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetQuote", - Handler: _ShippingService_GetQuote_Handler, - }, - { - MethodName: "ShipOrder", - Handler: _ShippingService_ShipOrder_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "demo.proto", -} - -// CurrencyServiceClient is the client API for CurrencyService 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 CurrencyServiceClient interface { - GetSupportedCurrencies(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*GetSupportedCurrenciesResponse, error) - Convert(ctx context.Context, in *CurrencyConversionRequest, opts ...grpc.CallOption) (*Money, error) -} - -type currencyServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewCurrencyServiceClient(cc grpc.ClientConnInterface) CurrencyServiceClient { - return ¤cyServiceClient{cc} -} - -func (c *currencyServiceClient) GetSupportedCurrencies(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*GetSupportedCurrenciesResponse, error) { - out := new(GetSupportedCurrenciesResponse) - err := c.cc.Invoke(ctx, "/hipstershop.CurrencyService/GetSupportedCurrencies", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *currencyServiceClient) Convert(ctx context.Context, in *CurrencyConversionRequest, opts ...grpc.CallOption) (*Money, error) { - out := new(Money) - err := c.cc.Invoke(ctx, "/hipstershop.CurrencyService/Convert", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// CurrencyServiceServer is the server API for CurrencyService service. -// All implementations must embed UnimplementedCurrencyServiceServer -// for forward compatibility -type CurrencyServiceServer interface { - GetSupportedCurrencies(context.Context, *Empty) (*GetSupportedCurrenciesResponse, error) - Convert(context.Context, *CurrencyConversionRequest) (*Money, error) - mustEmbedUnimplementedCurrencyServiceServer() -} - -// UnimplementedCurrencyServiceServer must be embedded to have forward compatible implementations. -type UnimplementedCurrencyServiceServer struct { -} - -func (UnimplementedCurrencyServiceServer) GetSupportedCurrencies(context.Context, *Empty) (*GetSupportedCurrenciesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetSupportedCurrencies not implemented") -} -func (UnimplementedCurrencyServiceServer) Convert(context.Context, *CurrencyConversionRequest) (*Money, error) { - return nil, status.Errorf(codes.Unimplemented, "method Convert not implemented") -} -func (UnimplementedCurrencyServiceServer) mustEmbedUnimplementedCurrencyServiceServer() {} - -// UnsafeCurrencyServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to CurrencyServiceServer will -// result in compilation errors. -type UnsafeCurrencyServiceServer interface { - mustEmbedUnimplementedCurrencyServiceServer() -} - -func RegisterCurrencyServiceServer(s grpc.ServiceRegistrar, srv CurrencyServiceServer) { - s.RegisterService(&CurrencyService_ServiceDesc, srv) -} - -func _CurrencyService_GetSupportedCurrencies_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Empty) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CurrencyServiceServer).GetSupportedCurrencies(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/hipstershop.CurrencyService/GetSupportedCurrencies", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CurrencyServiceServer).GetSupportedCurrencies(ctx, req.(*Empty)) - } - return interceptor(ctx, in, info, handler) -} - -func _CurrencyService_Convert_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CurrencyConversionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CurrencyServiceServer).Convert(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/hipstershop.CurrencyService/Convert", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CurrencyServiceServer).Convert(ctx, req.(*CurrencyConversionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// CurrencyService_ServiceDesc is the grpc.ServiceDesc for CurrencyService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var CurrencyService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "hipstershop.CurrencyService", - HandlerType: (*CurrencyServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetSupportedCurrencies", - Handler: _CurrencyService_GetSupportedCurrencies_Handler, - }, - { - MethodName: "Convert", - Handler: _CurrencyService_Convert_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "demo.proto", -} - -// PaymentServiceClient is the client API for PaymentService 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 PaymentServiceClient interface { - Charge(ctx context.Context, in *ChargeRequest, opts ...grpc.CallOption) (*ChargeResponse, error) -} - -type paymentServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewPaymentServiceClient(cc grpc.ClientConnInterface) PaymentServiceClient { - return &paymentServiceClient{cc} -} - -func (c *paymentServiceClient) Charge(ctx context.Context, in *ChargeRequest, opts ...grpc.CallOption) (*ChargeResponse, error) { - out := new(ChargeResponse) - err := c.cc.Invoke(ctx, "/hipstershop.PaymentService/Charge", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// PaymentServiceServer is the server API for PaymentService service. -// All implementations must embed UnimplementedPaymentServiceServer -// for forward compatibility -type PaymentServiceServer interface { - Charge(context.Context, *ChargeRequest) (*ChargeResponse, error) - mustEmbedUnimplementedPaymentServiceServer() -} - -// UnimplementedPaymentServiceServer must be embedded to have forward compatible implementations. -type UnimplementedPaymentServiceServer struct { -} - -func (UnimplementedPaymentServiceServer) Charge(context.Context, *ChargeRequest) (*ChargeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Charge not implemented") -} -func (UnimplementedPaymentServiceServer) mustEmbedUnimplementedPaymentServiceServer() {} - -// UnsafePaymentServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to PaymentServiceServer will -// result in compilation errors. -type UnsafePaymentServiceServer interface { - mustEmbedUnimplementedPaymentServiceServer() -} - -func RegisterPaymentServiceServer(s grpc.ServiceRegistrar, srv PaymentServiceServer) { - s.RegisterService(&PaymentService_ServiceDesc, srv) -} - -func _PaymentService_Charge_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ChargeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(PaymentServiceServer).Charge(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/hipstershop.PaymentService/Charge", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PaymentServiceServer).Charge(ctx, req.(*ChargeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// PaymentService_ServiceDesc is the grpc.ServiceDesc for PaymentService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var PaymentService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "hipstershop.PaymentService", - HandlerType: (*PaymentServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Charge", - Handler: _PaymentService_Charge_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "demo.proto", -} - -// EmailServiceClient is the client API for EmailService 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 EmailServiceClient interface { - SendOrderConfirmation(ctx context.Context, in *SendOrderConfirmationRequest, opts ...grpc.CallOption) (*Empty, error) -} - -type emailServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewEmailServiceClient(cc grpc.ClientConnInterface) EmailServiceClient { - return &emailServiceClient{cc} -} - -func (c *emailServiceClient) SendOrderConfirmation(ctx context.Context, in *SendOrderConfirmationRequest, opts ...grpc.CallOption) (*Empty, error) { - out := new(Empty) - err := c.cc.Invoke(ctx, "/hipstershop.EmailService/SendOrderConfirmation", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// EmailServiceServer is the server API for EmailService service. -// All implementations must embed UnimplementedEmailServiceServer -// for forward compatibility -type EmailServiceServer interface { - SendOrderConfirmation(context.Context, *SendOrderConfirmationRequest) (*Empty, error) - mustEmbedUnimplementedEmailServiceServer() -} - -// UnimplementedEmailServiceServer must be embedded to have forward compatible implementations. -type UnimplementedEmailServiceServer struct { -} - -func (UnimplementedEmailServiceServer) SendOrderConfirmation(context.Context, *SendOrderConfirmationRequest) (*Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method SendOrderConfirmation not implemented") -} -func (UnimplementedEmailServiceServer) mustEmbedUnimplementedEmailServiceServer() {} - -// UnsafeEmailServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to EmailServiceServer will -// result in compilation errors. -type UnsafeEmailServiceServer interface { - mustEmbedUnimplementedEmailServiceServer() -} - -func RegisterEmailServiceServer(s grpc.ServiceRegistrar, srv EmailServiceServer) { - s.RegisterService(&EmailService_ServiceDesc, srv) -} - -func _EmailService_SendOrderConfirmation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SendOrderConfirmationRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(EmailServiceServer).SendOrderConfirmation(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/hipstershop.EmailService/SendOrderConfirmation", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(EmailServiceServer).SendOrderConfirmation(ctx, req.(*SendOrderConfirmationRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// EmailService_ServiceDesc is the grpc.ServiceDesc for EmailService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var EmailService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "hipstershop.EmailService", - HandlerType: (*EmailServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "SendOrderConfirmation", - Handler: _EmailService_SendOrderConfirmation_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "demo.proto", -} - -// CheckoutServiceClient is the client API for CheckoutService 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 CheckoutServiceClient interface { - PlaceOrder(ctx context.Context, in *PlaceOrderRequest, opts ...grpc.CallOption) (*PlaceOrderResponse, error) -} - -type checkoutServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewCheckoutServiceClient(cc grpc.ClientConnInterface) CheckoutServiceClient { - return &checkoutServiceClient{cc} -} - -func (c *checkoutServiceClient) PlaceOrder(ctx context.Context, in *PlaceOrderRequest, opts ...grpc.CallOption) (*PlaceOrderResponse, error) { - out := new(PlaceOrderResponse) - err := c.cc.Invoke(ctx, "/hipstershop.CheckoutService/PlaceOrder", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// CheckoutServiceServer is the server API for CheckoutService service. -// All implementations must embed UnimplementedCheckoutServiceServer -// for forward compatibility -type CheckoutServiceServer interface { - PlaceOrder(context.Context, *PlaceOrderRequest) (*PlaceOrderResponse, error) - mustEmbedUnimplementedCheckoutServiceServer() -} - -// UnimplementedCheckoutServiceServer must be embedded to have forward compatible implementations. -type UnimplementedCheckoutServiceServer struct { -} - -func (UnimplementedCheckoutServiceServer) PlaceOrder(context.Context, *PlaceOrderRequest) (*PlaceOrderResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method PlaceOrder not implemented") -} -func (UnimplementedCheckoutServiceServer) mustEmbedUnimplementedCheckoutServiceServer() {} - -// UnsafeCheckoutServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to CheckoutServiceServer will -// result in compilation errors. -type UnsafeCheckoutServiceServer interface { - mustEmbedUnimplementedCheckoutServiceServer() -} - -func RegisterCheckoutServiceServer(s grpc.ServiceRegistrar, srv CheckoutServiceServer) { - s.RegisterService(&CheckoutService_ServiceDesc, srv) -} - -func _CheckoutService_PlaceOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PlaceOrderRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CheckoutServiceServer).PlaceOrder(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/hipstershop.CheckoutService/PlaceOrder", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CheckoutServiceServer).PlaceOrder(ctx, req.(*PlaceOrderRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// CheckoutService_ServiceDesc is the grpc.ServiceDesc for CheckoutService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var CheckoutService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "hipstershop.CheckoutService", - HandlerType: (*CheckoutServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "PlaceOrder", - Handler: _CheckoutService_PlaceOrder_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "demo.proto", -} - -// AdServiceClient is the client API for AdService 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 AdServiceClient interface { - GetAds(ctx context.Context, in *AdRequest, opts ...grpc.CallOption) (*AdResponse, error) -} - -type adServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewAdServiceClient(cc grpc.ClientConnInterface) AdServiceClient { - return &adServiceClient{cc} -} - -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 -} - -// AdServiceServer is the server API for AdService service. -// All implementations must embed UnimplementedAdServiceServer -// for forward compatibility -type AdServiceServer interface { - GetAds(context.Context, *AdRequest) (*AdResponse, error) - mustEmbedUnimplementedAdServiceServer() -} - -// UnimplementedAdServiceServer must be embedded to have forward compatible implementations. -type UnimplementedAdServiceServer struct { -} - -func (UnimplementedAdServiceServer) GetAds(context.Context, *AdRequest) (*AdResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetAds not implemented") -} -func (UnimplementedAdServiceServer) mustEmbedUnimplementedAdServiceServer() {} - -// UnsafeAdServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to AdServiceServer will -// result in compilation errors. -type UnsafeAdServiceServer interface { - mustEmbedUnimplementedAdServiceServer() -} - -func RegisterAdServiceServer(s grpc.ServiceRegistrar, srv AdServiceServer) { - s.RegisterService(&AdService_ServiceDesc, srv) -} - -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.(AdServiceServer).GetAds(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/hipstershop.AdService/GetAds", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AdServiceServer).GetAds(ctx, req.(*AdRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// AdService_ServiceDesc is the grpc.ServiceDesc for AdService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var AdService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "hipstershop.AdService", - HandlerType: (*AdServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetAds", - Handler: _AdService_GetAds_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "demo.proto", -} diff --git a/src/shippingservice/go.mod b/src/shippingservice/go.mod deleted file mode 100644 index 485d87e6f5..0000000000 --- a/src/shippingservice/go.mod +++ /dev/null @@ -1,35 +0,0 @@ -module github.com/GoogleCloudPlatform/microservices-demo/src/shippingservice - -go 1.17 - -require ( - github.com/golang/protobuf v1.5.2 // indirect - github.com/sirupsen/logrus v1.8.1 - golang.org/x/net v0.0.0-20220225172249-27dd8689420f - google.golang.org/grpc v1.44.0 -) - -require ( - go.opentelemetry.io/otel v1.4.1 - go.opentelemetry.io/otel/sdk v1.4.1 - google.golang.org/protobuf v1.27.1 -) - -require ( - github.com/cenkalti/backoff/v4 v4.1.2 // indirect - github.com/go-logr/logr v1.2.2 // indirect - github.com/go-logr/stdr v1.2.2 // indirect - github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.4.1 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.4.1 // indirect - go.opentelemetry.io/otel/trace v1.4.1 // indirect - go.opentelemetry.io/proto/otlp v0.12.0 // indirect -) - -require ( - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.29.0 - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.4.1 - golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27 // indirect - golang.org/x/text v0.3.7 // indirect - google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350 // indirect -) diff --git a/src/shippingservice/go.sum b/src/shippingservice/go.sum deleted file mode 100644 index bf25772c3d..0000000000 --- a/src/shippingservice/go.sum +++ /dev/null @@ -1,198 +0,0 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0 h1:eOI3/cP2VTU6uZLDYAoic+eyzzB9YyGmJ7eIjl8rOPg= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/cenkalti/backoff/v4 v4.1.2 h1:6Yo7N8UP2K6LWZnW94DLVSSrbobcWdVzAYOisuDPIFo= -github.com/cenkalti/backoff/v4 v4.1.2/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= -github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-logr/logr v1.2.2 h1:ahHml/yUpnlb96Rp8HCvtYVPY8ZYpxq3g7UYchIYwbs= -github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= -github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= -github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= -github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.29.0 h1:n9b7AAdbQtQ0k9dm0Dm2/KUcUqtG8i2O15KzNaDze8c= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.29.0/go.mod h1:LsankqVDx4W+RhZNA5uWarULII/MBhF5qwCYxTuyXjs= -go.opentelemetry.io/otel v1.4.0/go.mod h1:jeAqMFKy2uLIxCtKxoFj0FAL5zAPKQagc3+GtBWakzk= -go.opentelemetry.io/otel v1.4.1 h1:QbINgGDDcoQUoMJa2mMaWno49lja9sHwp6aoa2n3a4g= -go.opentelemetry.io/otel v1.4.1/go.mod h1:StM6F/0fSwpd8dKWDCdRr7uRvEPYdW0hBSlbdTiUde4= -go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.4.1 h1:imIM3vRDMyZK1ypQlQlO+brE22I9lRhJsBDXpDWjlz8= -go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.4.1/go.mod h1:VpP4/RMn8bv8gNo9uK7/IMY4mtWLELsS+JIP0inH0h4= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.4.1 h1:WPpPsAAs8I2rA47v5u0558meKmmwm1Dj99ZbqCV8sZ8= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.4.1/go.mod h1:o5RW5o2pKpJLD5dNTCmjF1DorYwMeFJmb/rKr5sLaa8= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.4.1 h1:AxqDiGk8CorEXStMDZF5Hz9vo9Z7ZZ+I5m8JRl/ko40= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.4.1/go.mod h1:c6E4V3/U+miqjs/8l950wggHGL1qzlp0Ypj9xoGrPqo= -go.opentelemetry.io/otel/sdk v1.4.1 h1:J7EaW71E0v87qflB4cDolaqq3AcujGrtyIPGQoZOB0Y= -go.opentelemetry.io/otel/sdk v1.4.1/go.mod h1:NBwHDgDIBYjwK2WNu1OPgsIc2IJzmBXNnvIJxJc8BpE= -go.opentelemetry.io/otel/trace v1.4.0/go.mod h1:uc3eRsqDfWs9R7b92xbQbU42/eTNz4N+gLP8qJCi4aE= -go.opentelemetry.io/otel/trace v1.4.1 h1:O+16qcdTrT7zxv2J6GejTPFinSwA++cYerC5iSiF8EQ= -go.opentelemetry.io/otel/trace v1.4.1/go.mod h1:iYEVbroFCNut9QkwEczV9vMRPHNKSSwYZjulEtsmhFc= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.opentelemetry.io/proto/otlp v0.12.0 h1:CMJ/3Wp7iOWES+CYLfnBv+DVmPbB+kmy9PJ92XvlR6c= -go.opentelemetry.io/proto/otlp v0.12.0/go.mod h1:TsIjwGWIx5VFYv9KGVlOpxoBl5Dy+63SUguV7GGvlSQ= -go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= -go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27 h1:XDXtA5hveEEV8JB2l7nhMTp3t3cHp9ZpwcdjqyEWLlo= -golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350 h1:YxHp5zqIcAShDEvRr5/0rVESVS+njYF68PSdazrNLJo= -google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.44.0 h1:weqSxi/TMs1SqFRMHCtBgXRs8k3X39QIDEZ0pRcttUg= -google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/src/shippingservice/main.go b/src/shippingservice/main.go deleted file mode 100644 index ded0402bdc..0000000000 --- a/src/shippingservice/main.go +++ /dev/null @@ -1,162 +0,0 @@ -// 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 main - -import ( - "fmt" - "net" - "os" - "time" - - "github.com/sirupsen/logrus" - "golang.org/x/net/context" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/reflection" - "google.golang.org/grpc/status" - - "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" - "go.opentelemetry.io/otel" - "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc" - "go.opentelemetry.io/otel/propagation" - sdktrace "go.opentelemetry.io/otel/sdk/trace" - - pb "github.com/GoogleCloudPlatform/microservices-demo/src/shippingservice/genproto/hipstershop" - healthpb "google.golang.org/grpc/health/grpc_health_v1" -) - -const ( - defaultPort = "50051" -) - -var log *logrus.Logger - -func init() { - log = logrus.New() - log.Level = logrus.DebugLevel - log.Formatter = &logrus.JSONFormatter{ - FieldMap: logrus.FieldMap{ - logrus.FieldKeyTime: "timestamp", - logrus.FieldKeyLevel: "severity", - logrus.FieldKeyMsg: "message", - }, - TimestampFormat: time.RFC3339Nano, - } - log.Out = os.Stdout -} - -func InitTracerProvider() *sdktrace.TracerProvider { - ctx := context.Background() - - exporter, err := otlptracegrpc.New(ctx) - if err != nil { - log.Fatal(err) - } - tp := sdktrace.NewTracerProvider( - sdktrace.WithBatcher(exporter), - ) - otel.SetTracerProvider(tp) - otel.SetTextMapPropagator(propagation.NewCompositeTextMapPropagator(propagation.TraceContext{}, propagation.Baggage{})) - return tp -} - -func main() { - tp := InitTracerProvider() - defer func() { - if err := tp.Shutdown(context.Background()); err != nil { - log.Printf("Error shutting down tracer provider: %v", err) - } - }() - - port := defaultPort - if value, ok := os.LookupEnv("PORT"); ok { - port = value - } - port = fmt.Sprintf(":%s", port) - - lis, err := net.Listen("tcp", port) - if err != nil { - log.Fatalf("failed to listen: %v", err) - } - - var srv *grpc.Server = grpc.NewServer( - grpc.UnaryInterceptor(otelgrpc.UnaryServerInterceptor()), - grpc.StreamInterceptor(otelgrpc.StreamServerInterceptor()), - ) - - svc := &server{} - pb.RegisterShippingServiceServer(srv, svc) - healthpb.RegisterHealthServer(srv, svc) - log.Infof("Shipping Service listening on port %s", port) - - // Register reflection service on gRPC server. - reflection.Register(srv) - if err := srv.Serve(lis); err != nil { - log.Fatalf("failed to serve: %v", err) - } -} - -// server controls RPC service responses. -type server struct { - pb.UnimplementedShippingServiceServer -} - -// Check is for health checking. -func (s *server) Check(ctx context.Context, req *healthpb.HealthCheckRequest) (*healthpb.HealthCheckResponse, error) { - return &healthpb.HealthCheckResponse{Status: healthpb.HealthCheckResponse_SERVING}, nil -} - -func (s *server) Watch(req *healthpb.HealthCheckRequest, ws healthpb.Health_WatchServer) error { - return status.Errorf(codes.Unimplemented, "health check via Watch not implemented") -} - -// GetQuote produces a shipping quote (cost) in USD. -func (s *server) GetQuote(ctx context.Context, in *pb.GetQuoteRequest) (*pb.GetQuoteResponse, error) { - log.Info("[GetQuote] received request") - defer log.Info("[GetQuote] completed request") - - // 1. Our quote system requires the total number of items to be shipped. - count := 0 - for _, item := range in.Items { - count += int(item.Quantity) - } - - // 2. Generate a quote based on the total number of items to be shipped. - quote := CreateQuoteFromCount(count) - - // 3. Generate a response. - return &pb.GetQuoteResponse{ - CostUsd: &pb.Money{ - CurrencyCode: "USD", - Units: int64(quote.Dollars), - Nanos: int32(quote.Cents * 10000000)}, - }, nil - -} - -// ShipOrder mocks that the requested items will be shipped. -// It supplies a tracking ID for notional lookup of shipment delivery status. -func (s *server) ShipOrder(ctx context.Context, in *pb.ShipOrderRequest) (*pb.ShipOrderResponse, error) { - log.Info("[ShipOrder] received request") - defer log.Info("[ShipOrder] completed request") - // 1. Create a Tracking ID - baseAddress := fmt.Sprintf("%s, %s, %s", in.Address.StreetAddress, in.Address.City, in.Address.State) - id := CreateTrackingId(baseAddress) - - // 2. Generate a response. - return &pb.ShipOrderResponse{ - TrackingId: id, - }, nil -} diff --git a/src/shippingservice/quote.go b/src/shippingservice/quote.go deleted file mode 100644 index e16190fb41..0000000000 --- a/src/shippingservice/quote.go +++ /dev/null @@ -1,53 +0,0 @@ -// 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 main - -import ( - "fmt" - "math" -) - -// Quote represents a currency value. -type Quote struct { - Dollars uint32 - Cents uint32 -} - -// String representation of the Quote. -func (q Quote) String() string { - return fmt.Sprintf("$%d.%d", q.Dollars, q.Cents) -} - -// CreateQuoteFromCount takes a number of items and returns a Price struct. -func CreateQuoteFromCount(count int) Quote { - return CreateQuoteFromFloat(quoteByCountFloat(count)) -} - -// CreateQuoteFromFloat takes a price represented as a float and creates a Price struct. -func CreateQuoteFromFloat(value float64) Quote { - units, fraction := math.Modf(value) - return Quote{ - uint32(units), - uint32(math.Trunc(fraction * 100)), - } -} - -// quoteByCountFloat takes a number of items and generates a price quote represented as a float. -func quoteByCountFloat(count int) float64 { - if count == 0 { - return 0 - } - return 8.99 -} diff --git a/src/shippingservice/shippingservice_test.go b/src/shippingservice/shippingservice_test.go deleted file mode 100644 index 5bb92c4ce4..0000000000 --- a/src/shippingservice/shippingservice_test.go +++ /dev/null @@ -1,90 +0,0 @@ -// 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 main - -import ( - "testing" - - "golang.org/x/net/context" - - pb "github.com/GoogleCloudPlatform/microservices-demo/src/shippingservice/genproto/hipstershop" -) - -// TestGetQuote is a basic check on the GetQuote RPC service. -func TestGetQuote(t *testing.T) { - s := server{} - - // A basic test case to test logic and protobuf interactions. - req := &pb.GetQuoteRequest{ - Address: &pb.Address{ - StreetAddress: "Muffin Man", - City: "London", - State: "", - Country: "England", - }, - Items: []*pb.CartItem{ - { - ProductId: "23", - Quantity: 1, - }, - { - ProductId: "46", - Quantity: 3, - }, - }, - } - - res, err := s.GetQuote(context.Background(), req) - if err != nil { - t.Errorf("TestGetQuote (%v) failed", err) - } - if res.CostUsd.GetUnits() != 8 || res.CostUsd.GetNanos() != 990000000 { - t.Errorf("TestGetQuote: Quote value '%d.%d' does not match expected '%s'", res.CostUsd.GetUnits(), res.CostUsd.GetNanos(), "11.220000000") - } -} - -// TestShipOrder is a basic check on the ShipOrder RPC service. -func TestShipOrder(t *testing.T) { - s := server{} - - // A basic test case to test logic and protobuf interactions. - req := &pb.ShipOrderRequest{ - Address: &pb.Address{ - StreetAddress: "Muffin Man", - City: "London", - State: "", - Country: "England", - }, - Items: []*pb.CartItem{ - { - ProductId: "23", - Quantity: 1, - }, - { - ProductId: "46", - Quantity: 3, - }, - }, - } - - res, err := s.ShipOrder(context.Background(), req) - if err != nil { - t.Errorf("TestShipOrder (%v) failed", err) - } - // @todo improve quality of this test to check for a pattern such as '[A-Z]{2}-\d+-\d+'. - if len(res.TrackingId) != 18 { - t.Errorf("TestShipOrder: Tracking ID is malformed - has %d characters, %d expected", len(res.TrackingId), 18) - } -} diff --git a/src/shippingservice/src/main.rs b/src/shippingservice/src/main.rs new file mode 100644 index 0000000000..b7b954145f --- /dev/null +++ b/src/shippingservice/src/main.rs @@ -0,0 +1,68 @@ +use opentelemetry::trace::TraceError; +use opentelemetry::{ + global, + sdk::{propagation::TraceContextPropagator, trace as sdktrace}, +}; +use opentelemetry_otlp::{self, WithExportConfig}; + +use tonic::transport::Server; + +use log::*; +use simplelog::*; + +use std::env; + +mod shipping_service; +use shipping_service::shop::shipping_service_server::ShippingServiceServer; +use shipping_service::ShippingServer; + +fn init_logger() -> Result<(), log::SetLoggerError> { + CombinedLogger::init(vec![ + SimpleLogger::new(LevelFilter::Info, Config::default()), + SimpleLogger::new(LevelFilter::Warn, Config::default()), + SimpleLogger::new(LevelFilter::Error, Config::default()), + ]) + // debug is used on lower level apis and not used here. +} + +fn init_tracer() -> Result { + global::set_text_map_propagator(TraceContextPropagator::new()); + opentelemetry_otlp::new_pipeline() + .tracing() + .with_exporter( + opentelemetry_otlp::new_exporter() + .tonic() + .with_endpoint(format!( + "{}{}", + env::var("OTEL_EXPORTER_OTLP_TRACES_ENDPOINT") + .unwrap_or_else(|_| "http://otelcol:4317".to_string()), + "/v1/traces" + )), // TODO: assume this ^ is true from config when opentelemetry crate > v0.17.0 + // https://github.com/open-telemetry/opentelemetry-rust/pull/806 includes the environment variable. + ) + .install_batch(opentelemetry::runtime::Tokio) +} + +#[tokio::main] +async fn main() -> Result<(), Box> { + let (mut health_reporter, health_service) = tonic_health::server::health_reporter(); + health_reporter + .set_serving::>() + .await; + + init_logger()?; + init_tracer()?; + info!("OTel pipeline created"); + let port = env::var("PORT").unwrap_or_else(|_| "50051".to_string()); + let addr = format!("0.0.0.0:{}", port).parse()?; + info!("listening on {}", addr); + let shipper = ShippingServer::default(); + + Server::builder() + .add_service(ShippingServiceServer::new(shipper)) + .add_service(health_service) + .serve(addr) + .await?; + + Ok(()) +} diff --git a/src/shippingservice/src/shipping_service.rs b/src/shippingservice/src/shipping_service.rs new file mode 100644 index 0000000000..1936b80721 --- /dev/null +++ b/src/shippingservice/src/shipping_service.rs @@ -0,0 +1,198 @@ +use opentelemetry::trace::{mark_span_as_active, Span, Tracer}; +use opentelemetry::{global, propagation::Extractor, KeyValue}; +use shop::shipping_service_server::ShippingService; +use shop::{GetQuoteRequest, GetQuoteResponse, Money, ShipOrderRequest, ShipOrderResponse}; +use tonic::{Request, Response, Status}; + +use log::*; + +mod quote; +use quote::create_quote_from_count; + +mod tracking; +use tracking::create_tracking_id; + +const NANOS_MULTIPLE: i32 = 10000000i32; + +pub mod shop { + tonic::include_proto!("hipstershop"); // The string specified here must match the proto package name +} + +#[derive(Debug, Default)] +pub struct ShippingServer {} + +struct MetadataMap<'a>(&'a tonic::metadata::MetadataMap); + +impl<'a> Extractor for MetadataMap<'a> { + /// Get a value for a key from the MetadataMap. If the value can't be converted to &str, returns None + fn get(&self, key: &str) -> Option<&str> { + self.0.get(key).and_then(|metadata| metadata.to_str().ok()) + } + + /// Collect all the keys from the MetadataMap. + fn keys(&self) -> Vec<&str> { + self.0 + .keys() + .map(|key| match key { + tonic::metadata::KeyRef::Ascii(v) => v.as_str(), + tonic::metadata::KeyRef::Binary(v) => v.as_str(), + }) + .collect::>() + } +} + +#[tonic::async_trait] +impl ShippingService for ShippingServer { + async fn get_quote( + &self, + request: Request, + ) -> Result, Status> { + info!("GetQuoteRequest: {:?}", request); + let parent_cx = + global::get_text_map_propagator(|prop| prop.extract(&MetadataMap(request.metadata()))); + + let itemct: u32 = request + .into_inner() + .items + .into_iter() + .fold(0, |accum, cart_item| accum + (cart_item.quantity as u32)); + + // We may want to ask another service for product pricing / info + // (although now everything is assumed to be the same price) + // check out the create_quote_from_count method to see how we use the span created here + let tracer = global::tracer("shippingservice/get-quote"); + let span = tracer.start_with_context("get-quote", &parent_cx); + let _guard = mark_span_as_active(span); + + let q = create_quote_from_count(itemct); + let reply = GetQuoteResponse { + cost_usd: Some(Money { + currency_code: "USD".into(), + units: q.dollars, + nanos: q.cents * NANOS_MULTIPLE, + }), + }; + info!("Sending Quote: {}", q); + + Ok(Response::new(reply)) + } + async fn ship_order( + &self, + request: Request, + ) -> Result, Status> { + info!("ShipOrderRequest: {:?}", request); + + let parent_cx = + global::get_text_map_propagator(|prop| prop.extract(&MetadataMap(request.metadata()))); + // in this case, generating a tracking ID is trivial + // we'll create a span and associated events all in this function. + let mut span = global::tracer("shippingservice/ship-order") + .start_with_context("ship-order", &parent_cx); + + let tid = create_tracking_id(); + span.add_event("Tracking ID issued", vec![KeyValue::new(tid.clone(), true)]); + info!("Tracking ID Created: {}", tid); + + Ok(Response::new(ShipOrderResponse { tracking_id: tid })) + } +} + +#[cfg(test)] +mod tests { + use super::{ + shop::shipping_service_server::ShippingService, + shop::{Address, GetQuoteRequest}, + shop::{CartItem, ShipOrderRequest}, + ShippingServer, NANOS_MULTIPLE, + }; + use tonic::Request; + use uuid::Uuid; + + fn make_quote_request_with_items(items: Vec) -> Request { + let cart_items: Vec = items.into_iter().fold(Vec::new(), |mut accum, count| { + accum.push(CartItem { + product_id: "fake-item".to_string(), + quantity: count, + }); + accum + }); + + Request::new(GetQuoteRequest { + address: Some(Address::default()), + items: cart_items, + }) + } + + fn make_empty_quote_request() -> Request { + Request::new(GetQuoteRequest::default()) + } + #[tokio::test] + async fn empty_quote() { + let server = ShippingServer::default(); + + // when we provide no items, the quote should be empty + match server.get_quote(make_empty_quote_request()).await { + Ok(resp) => { + let money = resp.into_inner().cost_usd.unwrap(); + assert_eq!(money.units, 0); + assert_eq!(money.nanos, 0); + } + Err(e) => panic!("error when making empty quote request: {}", e), + } + } + + #[tokio::test] + async fn quote_for_one_value() { + let server = ShippingServer::default(); + + match server + .get_quote(make_quote_request_with_items(vec![1_i32])) + .await + { + Ok(resp) => { + // items are fixed at 8.99, so we should see that price reflected. + let money = resp.into_inner().cost_usd.unwrap(); + assert_eq!(money.units, 8); + assert_eq!(money.nanos, 99 * NANOS_MULTIPLE); + } + Err(e) => panic!("error when making quote request for one value: {}", e), + } + } + + #[tokio::test] + async fn quote_for_many_values() { + let server = ShippingServer::default(); + + match server + .get_quote(make_quote_request_with_items(vec![1_i32, 2_i32])) + .await + { + Ok(resp) => { + // items are fixed at 8.99, so we should see that price reflected for 3 items + let money = resp.into_inner().cost_usd.unwrap(); + assert_eq!(money.units, 26); + assert_eq!(money.nanos, 97 * NANOS_MULTIPLE); + } + Err(e) => panic!("error when making quote request for many values: {}", e), + } + } + + #[tokio::test] + async fn can_get_tracking_id() { + let server = ShippingServer::default(); + + match server + .ship_order(Request::new(ShipOrderRequest::default())) + .await + { + Ok(resp) => { + // we should see a uuid + match Uuid::parse_str(&resp.into_inner().tracking_id) { + Ok(_) => {} + Err(e) => panic!("error when parsing uuid: {}", e), + } + } + Err(e) => panic!("error when making request for tracking ID: {}", e), + } + } +} diff --git a/src/shippingservice/src/shipping_service/quote.rs b/src/shippingservice/src/shipping_service/quote.rs new file mode 100644 index 0000000000..b129104389 --- /dev/null +++ b/src/shippingservice/src/shipping_service/quote.rs @@ -0,0 +1,36 @@ +use core::fmt; + +use opentelemetry::{trace::get_active_span, KeyValue}; + +#[derive(Debug, Default)] +pub struct Quote { + pub dollars: i64, + pub cents: i32, +} + +// TODO: Check product catalog for price on each item (will likley need item ID) +pub fn create_quote_from_count(count: u32) -> Quote { + let f = if count == 0 { + 0.0 + } else { + 8.99 * (count as f64) + }; + get_active_span(|span| { + let q = create_quote_from_float(f); + span.add_event("Quote Issued", vec![KeyValue::new(format!("{}", q), true)]); + q + }) +} + +pub fn create_quote_from_float(value: f64) -> Quote { + Quote { + dollars: value.floor() as i64, + cents: ((value * 100_f64) as i32) % 100, + } +} + +impl fmt::Display for Quote { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "{}.{}", self.dollars, self.cents) + } +} diff --git a/src/shippingservice/src/shipping_service/tracking.rs b/src/shippingservice/src/shipping_service/tracking.rs new file mode 100644 index 0000000000..b98658ced1 --- /dev/null +++ b/src/shippingservice/src/shipping_service/tracking.rs @@ -0,0 +1,6 @@ +use uuid::Uuid; + +/// returns a tracking ID +pub fn create_tracking_id() -> String { + Uuid::new_v4().to_string() +} diff --git a/src/shippingservice/tracker.go b/src/shippingservice/tracker.go deleted file mode 100644 index 6ba3d934ca..0000000000 --- a/src/shippingservice/tracker.go +++ /dev/null @@ -1,56 +0,0 @@ -// 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 main - -import ( - "fmt" - "math/rand" - "time" -) - -// seeded determines if the random number generator is ready. -var seeded bool = false - -// CreateTrackingId generates a tracking ID. -func CreateTrackingId(salt string) string { - if !seeded { - rand.Seed(time.Now().UnixNano()) - seeded = true - } - - return fmt.Sprintf("%c%c-%d%s-%d%s", - getRandomLetterCode(), - getRandomLetterCode(), - len(salt), - getRandomNumber(3), - len(salt)/2, - getRandomNumber(7), - ) -} - -// getRandomLetterCode generates a code point value for a capital letter. -func getRandomLetterCode() uint32 { - return 65 + uint32(rand.Intn(25)) -} - -// getRandomNumber generates a string representation of a number with the requested number of digits. -func getRandomNumber(digits int) string { - str := "" - for i := 0; i < digits; i++ { - str = fmt.Sprintf("%s%d", str, rand.Intn(10)) - } - - return str -}