go_micro相关书签

https://micro.mu/docs/cn/index.html

gomicro文档

https://github.com/micro/go-micro

gomicro代码

windows安装

1.go get github.com/micro/protoc-gen-micro

2.wget https://github.com/protocolbuffers/protobuf/releases/download/v3.7.1/protoc-3.7.1-win64.zip

3.go get -u github.com/golang/protobuf/protoc-gen-go

gprc安装

go get google.golang.org/grpc 报错

参考:https://www.jianshu.com/p/dba4c7a6d608

步骤:

git clone https://github.com/grpc/grpc-go.git $GOPATH/src/google.golang.org/grpc

git clone https://github.com/golang/net.git $GOPATH/src/golang.org/x/net

git clone https://github.com/golang/text.git $GOPATH/src/golang.org/x/text

go get -u github.com/golang/protobuf/{proto,protoc-gen-go}

git clone https://github.com/google/go-genproto.git $GOPATH/src/google.golang.org/genproto

cd $GOPATH/src/

go install google.golang.org/grpc

启动

consul(参考:https://micro.mu/docs/toolkit.html#consul) :

consul   agent  -dev

hashi-ui-windows--amd64(https://github.com/jippi/hashi-ui):

./hashi-ui-windos-amd64 --consul-enable

然后http://127.0.0.1:3000/

应用服务:

set MICRO_REGISTRY=consul

micro list services

go run main.go(https://github.com/micro/examples/tree/master/service

micro list services(这里需要另开窗口首先重新设置MICRO_REGISTRY环境变量)

上一篇:spring 定时任务标注


下一篇:vue 如何在循环中绑定v-model