protoc-gen-go-grpc-mock

command module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2023 License: MIT Imports: 2 Imported by: 0

README

go-grpc-mock

This is a protoc plugin that generates type-safe mock implementations for gRPC services using the testify mock library.

Usage

go install github.com/tim-oster/protoc-gen-go-grpc-mock@latest
protoc --go-grpc-mock_out=./ file.proto

Dependencies

Install Protobuf Compiler

Doc: https://grpc.io/docs/protoc-installation/

PB_VER="23.4"
PB_REL="https://github.com/protocolbuffers/protobuf/releases"
curl -LO $PB_REL/download/v${PB_VER}/protoc-${PB_VER}-linux-x86_64.zip
unzip -o protoc-${PB_VER}-linux-x86_64.zip -d $HOME/.local
rm protoc-${PB_VER}-linux-x86_64.zip
Install golang dependencies

Doc: https://grpc.io/docs/languages/go/quickstart/

go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.31.0
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.3.0

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
example module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL