2020-12-26 15:17:20 +00:00
|
|
|
# Hello World
|
|
|
|
|
|
|
|
This is hello world using micro
|
|
|
|
|
|
|
|
## Contents
|
|
|
|
|
|
|
|
- main.go - is the main definition of the service, handler and client
|
|
|
|
- proto - contains the protobuf definition of the API
|
|
|
|
|
|
|
|
## Dependencies
|
|
|
|
|
|
|
|
Install the following
|
|
|
|
|
2021-11-25 00:43:05 +08:00
|
|
|
- [micro](https://github.com/asim/go-micro/tree/master/cmd/micro)
|
|
|
|
- [protoc-gen-micro](https://github.com/asim/go-micro/tree/master/cmd/protoc-gen-micro)
|
2020-12-26 15:17:20 +00:00
|
|
|
|
|
|
|
## Run Service
|
|
|
|
|
|
|
|
```shell
|
2021-11-25 00:43:05 +08:00
|
|
|
micro run . --name helloworld
|
2020-12-26 15:17:20 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## Query Service
|
|
|
|
|
|
|
|
```
|
|
|
|
micro call helloworld Greeter.Hello '{"name": "John"}'
|
|
|
|
```
|
2021-11-25 00:43:05 +08:00
|
|
|
|
|
|
|
## List Services
|
|
|
|
|
|
|
|
```shell
|
|
|
|
micro services
|
|
|
|
```
|