Git Product home page Git Product logo

go-grpc-api-lab's Introduction

gRPC

Some gRPC talk on youtube:

...gRPC is the Linux pipe for boring distributed components...

Workflow for creating gRPC services

  1. Define service contract using protocol buffers Interface Definition Language (IDL)
  2. Compile IDL (.protos) into service interfaces
  3. Implement service interfaces

Examples

Example .proto (IDL) client/server impl
Hello World with health check and graceful termination ./api/hello-world/ ./hello-world/
Stream events down to multiple clients.
Keeps an in-mem broker to subscribe clients and broadcast to all.
./api/server-streaming/ ./server-streaming/
TLS Server Auth ./api/tls-auth/ ./tls-auth/
Mutual TLS Auth. Uses in-mem copy of the host trustore to append self signed cert. ./api/tls-auth/ ./mtls-auth/
Tracing and metering client/server interceptors with OpenTelemetry. ./api/hello-world/ ./opentelemetry-interceptor/
Server streaming to web app with gRPC-Web and grpcwebproxy [Failing]. ./api/server-streaming/ ./server-streaming-grpc-web/
JWT (as JWE) Auth with square/go-jose ./api/tls-auth/ ./jwt-auth/
Paseto JSON token Auth with o1egl/paseto ./api/tls-auth/ ./paseto-auth/

Run example

go mod vendor

go install ./...

cd ./example

# compile protos if changed
make grpc

make run-server
make run-client

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.