Skip to content

yummydev/grpcgen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


| || _ | | || || || || | | | | || | || | _ || || || || || | | | __ | ||| | || || || | __ | | | | | || || __ || || || || || || _ | | || || | | || | | | | || || | | | | | |||| |||| |||||___||| |__|

GRPC Gen

gRPCGen is a simple program for generating test from gRPC code generated by protobufs. gRPCGen will create code for both connecting to a gRPC service, and code for testing its various methods.

Installation

gRPCGen expects goimports. Install both using

go install golang.org/x/tools/cmd/goimports
go install github.com/yummydev/grpcgen

Usage

  1. Create a new package where all test code will reside
  2. Modify the template below with your code.
package sds

import (
	"github.com/pizzahutdigital/protobufs/store"
)

//go:generate grpcgen run --package . --target Client
var Client storedata.StoreDataClient

where the target ("Client" in this case), is the interface type to generate code for. 3. cd to the directory and run go:generate (replace --package . with the import path to run go:generate from anywhere)

CLI Usage

Usage: grpcgen [command]

Available Commands: help Help about any command run Run Test Generation

Flags: -h, --help help for grpcgen --package string path (import path or relative) to the package --target string name of the global variable that should serve as the client for test

Use "grpcgen [command] --help" for more information about a command.

About

Generator for GRPC test files

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages