mirror of
https://github.com/go-micro/go-micro.git
synced 2025-06-18 22:17:44 +02:00
Add examples
This commit is contained in:
43
examples/proxy/python/README.md
Normal file
43
examples/proxy/python/README.md
Normal file
@ -0,0 +1,43 @@
|
||||
# Python
|
||||
|
||||
- proxy.py: methods to call proxy
|
||||
- rpc_{client,server}.py: RPC client/server
|
||||
- http_{client,server}.py: HTTP client/server
|
||||
|
||||
## RPC Example
|
||||
|
||||
Run proxy
|
||||
```shell
|
||||
micro proxy
|
||||
```
|
||||
|
||||
Run server
|
||||
```shell
|
||||
# serves Say.Hello
|
||||
python rpc_server.py
|
||||
```
|
||||
|
||||
Run client
|
||||
```shell
|
||||
# calls go.micro.srv.greeter Say.Hello
|
||||
python rpc_client.py
|
||||
```
|
||||
|
||||
## HTTP Example
|
||||
|
||||
Run proxy with proxy handler
|
||||
```shell
|
||||
micro proxy --handler=http
|
||||
```
|
||||
|
||||
Run server
|
||||
```shell
|
||||
# serves /greeter
|
||||
python http_server.py
|
||||
```
|
||||
|
||||
Run client
|
||||
```shell
|
||||
# calls /greeter
|
||||
python http_client.py
|
||||
```
|
Reference in New Issue
Block a user