gateway

command
v2.0.0-...-5ab2063 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

README

Gateway

This example demonstrates how to implement an gateway forward http request into grpc services.

Run

go run main.go

Access grpc services through http

Endpoint: helloworld
Method: Helloworld.Call
curl -X POST http://localhost:8080/helloworld/Helloworld.Call -H "Content-Type:application/json" -d "{"""name""":"""Joe"""}"
{"message":"Hello Joe"}

View service nodes

curl http://localhost:8080/helloworld/nodes
[{"id":"helloworld-109f6d75-42cc-43ff-96df-f63260cf5372","address":"127.0.0.1:50000","metadata":{"broker":"http","protocol":"grpc","registry":"mdns","server":"grpc","transport":"grpc"}}]

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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