Skip to content

eschizoid/go-grpc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Protobuf over gRPC

A simple integration between protobuf and gRPC written in Golang.

Building
$ make clean
$ make all
Starting gRPC and REST servers
$ docker-compose up --build -d
Testing
$ curl -X POST -d '{"message":"ping"}' 'http://go-grpc:8081/v1/ingest'
Swagger docs
$ curl -X GET 'http://go-grpc:8081/swagger/ingestwg.swagger.json'

and you should get a response like the following:

{
  "swagger": "2.0",
  "info": {
    "title": "ingestgw.proto",
    "version": "version not set"
  },
  "schemes": [
    "http",
    "https"
  ],
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "paths": {
    "/v1/ingest": {
      "post": {
        "operationId": "Do",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/protoResponse"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/protoRequest"
            }
          }
        ],
        "tags": [
          "Ingest"
        ]
      }
    }
  },
  "definitions": {
    "protoRequest": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        }
      }
    },
    "protoResponse": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        }
      }
    }
  }
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published