1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-12-24 10:07:04 +02:00
go-micro/examples/proxy/ruby
2020-12-26 15:17:20 +00:00
..
Gemfile Add examples 2020-12-26 15:17:20 +00:00
http_client.rb Add examples 2020-12-26 15:17:20 +00:00
http_server.rb Add examples 2020-12-26 15:17:20 +00:00
proxy.rb Add examples 2020-12-26 15:17:20 +00:00
README.md Add examples 2020-12-26 15:17:20 +00:00
rpc_client.rb Add examples 2020-12-26 15:17:20 +00:00
rpc_server.rb Add examples 2020-12-26 15:17:20 +00:00

Ruby

  • proxy.rb: methods to call proxy
  • rpc_{client,server}.rb: RPC client/server
  • http_{client,server}.rb: HTTP client/server

RPC Example

Run proxy

micro proxy

Run server

# serves Say.Hello
ruby rpc_server.rb

Run client

# calls go.micro.srv.greeter Say.Hello
ruby rpc_client.rb

HTTP Example

Run proxy with proxy handler

micro proxy --handler=http

Run server

# serves /greeter
ruby http_server.rb

Run client

# calls /greeter
ruby http_client.rb