Skip to content

Latest commit

 

History

History
28 lines (19 loc) · 429 Bytes

File metadata and controls

28 lines (19 loc) · 429 Bytes

Function

Function是只响应一次请求的服务,我们现在介绍如何使用Function。

运行Function

使用protoc生成相应的代码

protoc --go_out=. --micro_out=. proto/greeter.proto

Mac/Linux

watch -n1 go run main.go

Windows(Powershell)

while (1) {go run main.go; sleep 1}

调用Function

micro call greeter Greeter.Hello '{"name": "Micro中国"}'