Code Monkey home page Code Monkey logo

grpc_cpp_go's Introduction

Ubuntu Client Ubuntu Server

gRPC with C++ and Go

Template/example repository for gRPC in combination with C++ and Go. This is mostly experimental - feel free to improve it if you see anything :)

Currently, tested on Ubuntu 22.04

Prerequisites

Setup

Besides the above-mentioned prerequisites, also install the following dependencies:

sudo apt install build-essential autoconf libtool pkg-config

Install the protoc compiler. You can do this in two ways:

  1. Download protoc 21.6, build it then add the built binary (bin file) to your PATH environment
  2. Install with sudo apt-get install protobuf-compiler

I recommend to install it via the first step as the apt-get repositories tend to lag behind, but it's up to you. Also, don't forget to generate new proto Go files if you have a different version than 21.6.

Navigate to the server folder and execute the following command:

go install google.golang.org/protobuf/cmd/protoc-gen-go
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc

Usage

Make sure that the generated proto files are located in server/proto, if not, position your terminal into messages and execute the following command:

protoc --go_out=../server/proto --go_opt=paths=source_relative --go-grpc_out=../server/proto --go-grpc_opt=paths=source_relative *.proto   

Position your terminal at the root of the server folder and execute:

go run .

Position your terminal at the root of the client folder and execute:

bazel run //:client

example

Additionally, if you want to test your server without using the client, you can use BloomRPC.

More examples and advanced gRPC topics

grpc_cpp_go's People

Contributors

zpervan avatar

Watchers

 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.