greeter/

directory
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2018 License: Apache-2.0

README

Greeter Service

An example Go-Micro based gRPC service

What's here?

  • server - a gRPC greeter service
  • client - a gRPC client that calls the service once
  • function - a gRPC greeter function
  • gateway - a grpc-gateway

Test Service

Run Service

$ go run server/main.go --registry=mdns
2016/11/03 18:41:22 Listening on [::]:55194
2016/11/03 18:41:22 Broker Listening on [::]:55195
2016/11/03 18:41:22 Registering node: go.micro.srv.greeter-1e200612-a1f5-11e6-8e84-68a86d0d36b6

Test Service

$ go run client/main.go --registry=mdns
Hello John

Test Function

Run function

go run function/main.go --registry=mdns

Query function

go run client/main.go --registry=mdns --service_name="go.micro.fnc.greeter"

Test Gateway

Run server with address set

go run server/main.go --registry=mdns --server_address=localhost:9090

Run gateway

go run gateway/main.go

Curl gateway

curl -d '{"name": "john"}' http://localhost:8080/greeter/hello

Directories

Path Synopsis
proto/hello
Package go_micro_srv_greeter is a generated protocol buffer package.
Package go_micro_srv_greeter is a generated protocol buffer package.
proto/hello
Package greeter is a generated protocol buffer package.
Package greeter is a generated protocol buffer package.
proto/hello
Package go_micro_srv_greeter is a generated protocol buffer package.
Package go_micro_srv_greeter is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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