Configure gRPC for go and protoc

Quick start

This guide gets you started with gRPC in Go with a simple working example.

Prerequisites

  • Go, any one of the three latest major releases of Go.

    For installation instructions, see Go’s Getting Started guide.

  • Protocol buffer compiler, protoc, version 3.

    For installation instructions, see Protocol Buffer Compiler Installation.

  • Go plugins for the protocol compiler:

    1. Install the protocol compiler plugins for Go using the following commands:

      $ go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28
      $ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2
      

Update your PATH so that the protoc compiler can find the plugins:

$ export PATH="$PATH:$(go env GOPATH)/bin"

To install missing grpc_php_plugin, just copy below command and run as root user. 

cd /tmp && git clone -b v1.34.1 --depth 1 https://github.com/grpc/grpc && cd grpc && git submodule update --init && make grpc_php_plugin

Or try build as bazel.

./tools/bazel build @com_google_protobuf//:protoc
./tools/bazel build src/compiler:grpc_php_plugin
  • grpc, grpc go
  • 0 کاربر این را مفید یافتند
آیا این پاسخ به شما کمک کرد؟

مقالات مربوطه

How to upgrade PHP to 7.4 in centos 7?

Enter the following commands on the terminal to upgrade PHP:      1 . To install the latest...

Protocol Buffer Compiler Installation

How to install the protocol buffer compiler. While not mandatory, gRPC applications often...

How to Install Go on CentOS 7

Go, often referred to as golang is a modern open-source programming language created by Google....

Installing Bazel on CentOS 7

Download the corresponding .repo file from Fedora COPR and copy it to /etc/yum.repos.d/....