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:
@ -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.
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user