ch07/

directory
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 12, 2021 License: CC-BY-4.0

README

Chapter 7: Running gRPC in Production

ProductInfo Service and Client

  • Online retail scenario has a ProductInfo microservice which is responsible for managing the products and their information. The consumer of that service can add, retrieve products via that service.

  • ProductInfo service and the consumer of that service are implemented in both Go and Java languages.

  • This use case shows how you can implement both ProductInfo service and its consumer.

Service Definition

package ecommerce;

service ProductInfo {
    rpc addProduct(Product) returns (ProductID);
    rpc getProduct(ProductID) returns (Product);
}

message Product {
    string id = 1;
    string name = 2;
    string description = 3;
    float price = 4;
}

message ProductID {
    string value = 1;
}

Implementation

Directories

Path Synopsis
grpc-continous-integration
go/mock_prodinfo
Package mock_proto_gen is a generated GoMock package.
Package mock_proto_gen is a generated GoMock package.
grpc-docker
grpc-kubernetes
grpc-opencensus
grpc-opencensus-tracing
grpc-opentracing
grpc-prometheus

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL