All Projects → mhausenblas → yages

mhausenblas / yages

Licence: Apache-2.0 license
Yet another gRPC echo server (YAGES)

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to yages

mine.js
🌏 A voxel engine built with JS/TS/RS. (formerly mc.js) (maybe mine.ts? or even mine.rs?)
Stars: ✭ 282 (+907.14%)
Mutual labels:  protobuf
protobuf-maven-plugin
Maven Plugin that executes the Protocol Buffers (protoc) compiler
Stars: ✭ 204 (+628.57%)
Mutual labels:  protobuf
powerproto
🎉 An awesome version control tool for protoc and its related plugins.
Stars: ✭ 161 (+475%)
Mutual labels:  protobuf
pronto
Clojure support for protocol buffers
Stars: ✭ 66 (+135.71%)
Mutual labels:  protobuf
fmutils
Golang protobuf FieldMask missing utils
Stars: ✭ 64 (+128.57%)
Mutual labels:  protobuf
scalapb-circe
Json/Protobuf convertors for ScalaPB use circe
Stars: ✭ 38 (+35.71%)
Mutual labels:  protobuf
flipper
Search/Recommendation engine and metainformation server for fanfiction net
Stars: ✭ 29 (+3.57%)
Mutual labels:  protobuf
Bynar
Server remediation as a service
Stars: ✭ 53 (+89.29%)
Mutual labels:  protobuf
methanol
⚗️ Lightweight HTTP extensions for Java
Stars: ✭ 172 (+514.29%)
Mutual labels:  protobuf
protobuf-ts
Protobuf and RPC for TypeScript
Stars: ✭ 527 (+1782.14%)
Mutual labels:  protobuf
protobuf-decoder
JavaScript-based web UI to decode ad-hoc Protobuf data
Stars: ✭ 107 (+282.14%)
Mutual labels:  protobuf
caffemodel2json
A small tool to dump Caffe's *.caffemodel to JSON for inspection
Stars: ✭ 40 (+42.86%)
Mutual labels:  protobuf
protoactor-python
Proto Actor - Ultra fast distributed actors
Stars: ✭ 78 (+178.57%)
Mutual labels:  protobuf
apache-flink-jdbc-streaming
Sample project for Apache Flink with Streaming Engine and JDBC Sink
Stars: ✭ 22 (-21.43%)
Mutual labels:  protobuf
proto2gql
The project has been migrated to https://github.com/EGT-Ukraine/go2gql.
Stars: ✭ 21 (-25%)
Mutual labels:  protobuf
protobuf-smalltalk
Protocol buffers support for Smalltalk
Stars: ✭ 14 (-50%)
Mutual labels:  protobuf
elm-protobuf
protobuf plugin for elm
Stars: ✭ 93 (+232.14%)
Mutual labels:  protobuf
api
Speechly public API definitions and generated code
Stars: ✭ 15 (-46.43%)
Mutual labels:  protobuf
ProtobufDecoder
A Google Protocol Buffers (Protobuf) payload decoder/analyzer
Stars: ✭ 33 (+17.86%)
Mutual labels:  protobuf
RentHouseWeb
使用 go+docker+go-micro微服务框架开发的租房网系统,符合RESTful架构风格。
Stars: ✭ 28 (+0%)
Mutual labels:  protobuf

Yet another gRPC echo server

YAGES (yet another gRPC echo server) is an educational gRPC server implementation. The goal is to learn gRPC and communicate best practices around its deployment and usage in the context of Kubernetes.

As an Kubernetes app

You can install YAGES as an app in your Kubernetes cluster (tested with Kubernetes v1.9, v1.10, and v1.11) like so:

$ kubectl apply -f http://mhausenblas.info/yages/app.yaml

Then, in order to invoke the service you've got essentially two options: from inside the cluster or from the outside the cluster, by exposing the service.

From inside the cluster

To access the gRPC server from inside the cluster, you can for example use the gump container image that has grpcurl installed:

$ kubectl run -it --rm grpcurl --restart=Never --image=quay.io/mhausenblas/gump:0.1 -- sh 
If you don't see a command prompt, try pressing enter.
/go $ grpcurl --plaintext yages:9000 yages.Echo.Ping
{
  "text": "pong"
}

From outside the cluster

TBD: Using Ingress as shown in ingress.yaml or an OpenShift Route object with TLS passthrough set.

As a local app

Install

Requires Go 1.9 or above, do:

$ go get -u github.com/mhausenblas/yages

Use

You can run go run main.go in $GOPATH/src/github.com/mhausenblas/yages or if you've added $GOPATH/bin to your path, directly call the binary:

$ yages
2018/03/25 16:23:42 YAGES in version dev serving on 0.0.0.0:9000 is ready for gRPC clients …

Open up a second terminal session and using grpcurl execute the following:

# invoke the ping method:
$ grpcurl --plaintext localhost:9000 yages.Echo.Ping
{
  "text": "pong"
}
# invoke the reverse method with parameter:
$ grpcurl --plaintext -d '{ "text" : "some fun here" }' localhost:9000 yages.Echo.Reverse
{
  "text": "ereh nuf emos"
}
# invoke the reverse method with parameter from JSON file:
$ cat echo.json | grpcurl --plaintext -d @ localhost:9000 yages.Echo.Reverse
{
  "text": "ohce"
}

Note that you can execute grpcurl --plaintext localhost:9000 list and grpcurl --plaintext localhost:9000 describe to get further details on the available services and their respective methods.

Develop

First you want to generate the stubs based on the protobuf schema. Note that this requires the Go gRPC runtime and plug-in installed on your machine, including protoc in v3 set up, see grpc.io for the steps.

Do the following:

$ protoc \
  --proto_path=$GOPATH/src/github.com/mhausenblas/yages \
  --go_out=plugins=grpc:yages \
  yages-schema.proto

Executing above command results in the auto-generated file yages/yages-schema.pb.go. Do not manually edit this file, or put in other words: if you add a new message or service to the schema defined in yages-schema.proto just run above protoc command again and you'll get an updated version of yages-schema.pb.go in the yages/ directory as a result.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].