Giter Club home page Giter Club logo

grpc-demo's Introduction

๐Ÿš€ gRPC: SOA booster

Introduction session to gRPC as SOA booster using Golang.

Table of contents

Installation

First install required dependencies:

Then start the stack:

docker-compose up -d

Stubs generation

The protoc stubs are generated using Buf, following rules in buf.gen.yaml file.

To launch a new generation:

buf generate

Then check the proto folder where you'll find:

  • go: golang generated stubs for gRPC server and gRPC gateway
  • js: javascript generated stubs for web clients
  • php: PHP generated stubs for PHP application (as gRPC client)

Available services

Name Host Description
gRPC server localhost:50051 The gRPC server (go)
gRPC gateway localhost:8888 The gRPC gateway (go)
gRPC envoy proxy localhost:9999 The gRPC envoy proxy (envoy)

gRPC server

This application is a simple server side go implementation of the text_tools.proto Protobuf definition.

The code is located in server folder.

You can access it on localhost:50051, and use the provided client/main.go script to interact with it:

cd client && go run .

gRPC gateway

This application is a REST <-> gRPC reverse proxy using autogenerated protoc stubs.

The code is located in gateway folder.

You can access it on localhost:8888 to interact with it on following endpoint:

Endpoint Description
[POST] /v1/transform To call with REST the TransformText rpc
[POST] /v1/transform-and-split To call with REST the TransformAndSplitText rpc

gRPC envoy proxy

This envoy proxy is running the envoy.filters.http.grpc_web filter to enable frontend application to interact using gRPC-web.

The proxy configuration is located in envoy folder.

You can access it on localhost:9999 to interact with it, and use the frontend client to test from a web application.

grpc-demo's People

Contributors

aabri-ankorstore avatar ekkinox avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.