1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-06-30 22:33:49 +02:00

Add the ability to switch out client/server

This commit is contained in:
Asim
2016-11-18 17:29:26 +00:00
parent f9709ffa6e
commit 20feb95e18
6 changed files with 60 additions and 9 deletions

View File

@ -32,7 +32,7 @@ $GOPATH/bin/service
3. Run the client
```shell
$GOPATH/bin/service --client
$GOPATH/bin/service --run_client
```
And that's all there is to it.

View File

@ -48,12 +48,12 @@ func main() {
"type": "helloworld",
}),
// Setup some flags. Specify --client to run the client
// Setup some flags. Specify --run_client to run the client
// Add runtime flags
// We could do this below too
micro.Flags(cli.BoolFlag{
Name: "client",
Name: "run_client",
Usage: "Launch the client",
}),
)
@ -65,7 +65,7 @@ func main() {
// Add runtime action
// We could actually do this above
micro.Action(func(c *cli.Context) {
if c.Bool("client") {
if c.Bool("run_client") {
runClient(service)
os.Exit(0)
}

View File

@ -78,12 +78,12 @@ func main() {
"type": "helloworld",
}),
// Setup some flags. Specify --client to run the client
// Setup some flags. Specify --run_client to run the client
// Add runtime flags
// We could do this below too
micro.Flags(cli.BoolFlag{
Name: "client",
Name: "run_client",
Usage: "Launch the client",
}),
)
@ -95,7 +95,7 @@ func main() {
// Add runtime action
// We could actually do this above
micro.Action(func(c *cli.Context) {
if c.Bool("client") {
if c.Bool("run_client") {
runClient(service)
os.Exit(0)
}