Protoc
install protoc and required plugins.

Prerequisites

    1.
    node, yarn
    2.
    buf
    3.
    prototool
    4.
    clang-format
    5.
    proto
    6.
    protoc-gen-go
    7.
    protoc-gen-validate
    8.
    protoc-gen-grpc-gateway
    9.
    protoc-gen-grpc-web
    10.
    protoc-gen-swagger

Installation

1
# basics
2
brew install node
3
brew install yarn
4
5
# plugins
6
yarn global add grpc-tools
7
brew install protoc-gen-grpc-web
Copied!
1
# linter/generator and tool for proto files
2
GO111MODULE=on go get github.com/uber/prototool/cmd/[email protected]
3
# linter tool for proto files
4
GO111MODULE=on go get github.com/bufbuild/buf/cmd/buf
5
# VS Code plugin `vscode-proto3` need clang-format
6
brew install clang-format
7
# fetch protoc plugins into $GOPATH
8
GO111MODULE=on go get google.golang.org/protobuf/cmd/protoc-gen-go
9
GO111MODULE=on go get google.golang.org/grpc/cmd/[email protected]
10
11
GO111MODULE=on go get github.com/grpc-ecosystem/grpc-gateway/{protoc-gen-grpc-gateway,protoc-gen-swagger}
12
13
# Installing PGV can currently only be done from source:
14
go get -d github.com/envoyproxy/protoc-gen-validate
15
cd ~/go/src/github.com/envoyproxy/protoc-gen-validate
16
git pull
17
make build
Copied!

Reference

Last modified 9mo ago