letmegrpc

command module
v0.0.0-...-a0fcb6e Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2015 License: BSD-3-Clause Imports: 10 Imported by: 0

README

letmegrpc

letmegrpc generates a web form gui from a grpc definition.

Build Status

Installation

cd $GOPATH
mkdir -p ./src/github.com/gogo/letmegrpc
git clone https://github.com/gogo/letmegrpc ./src/github.com/gogo/letmegrpc
./src/github.com/gogo/letmegrpc/deps.sh # Retrieves all your dependencies with a script generated by git-anchor.  Alternatively read the deps.json file and manually install the dependencies.
(cd ./src/github.com/gogo/letmegrpc && make install)

Usage

Assuming you have a grpc server implementation running on your localhost on port 12345

letmegrpc --addr=localhost:12345 --port=8080 grpc.proto

Now open your webbrowser and goto

http://localhost:8080/ServiceName/MethodName

Here you will find a generated html web form. Clicking Submit will send your newly populated message to your grpc server implementation and display the results.

Example

(cd $GOPATH/src/github.com/gogo/letmegrpc && make install)
letmetestserver --port=12345 &
(cd $GOPATH/src/github.com/gogo/letmegrpc/testcmd && letmegrpc --addr=localhost:12345 --port=8080 serve.proto

Open your webbrowser at

http://localhost:8080/Label/Produce

image

More Features

  • Comments that are attached to fields become tooltips.
  • proto2 defaults are filled into the the clean form.

Customization

letmegrpc is just another protocol buffer code generation plugin. Simply run:

protoc -gogo_out=. grpc.proto
protoc -letmegrpc_out=. grpc.proto

Now you can have the html generated code next to your generated message code. It contains a:

  • The Serve function that is used to start the server.
  • SetHtmlStringer function that lets you customize your html output for each returned message, this is json by default. This might be useful to return more links and create an explorable web site.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
serve
Package serve is a generated protocol buffer package.
Package serve is a generated protocol buffer package.
Package grpc is a generated protocol buffer package.
Package grpc is a generated protocol buffer package.
Package testimport is a generated protocol buffer package.
Package testimport is a generated protocol buffer package.
Package proto2 is a generated protocol buffer package.
Package proto2 is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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