Missing 'go_package' option

protoc --proto_path=. --micro_out=Mproto/imports/api.proto=github.com/micro/go-micro/v2/api/proto:. --go_out=Mproto/imports/api.proto=github.com/micro/go-micro/v2/api/proto:. proto/helloworld/helloworld.proto
2020/07/03 12:24:58 WARNING: Missing 'go_package' option in "proto/helloworld/helloworld.proto",
please specify it with the full Go package path as
a future release of protoc-gen-go will require this be specified.
See https://developers.google.com/protocol-buffers/docs/reference/go-generated#package for more information.

image.png

option go_package = "proto/helloworld";

undefined: balancer.PickOptions

# github.com/coreos/etcd/clientv3/balancer/resolver/endpoint
../../go/pkg/mod/github.com/coreos/etcd@v3.3.22+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:114:78: undefined: resolver.BuildOption
../../go/pkg/mod/github.com/coreos/etcd@v3.3.22+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:182:31: undefined: resolver.ResolveNowOption
# github.com/coreos/etcd/clientv3/balancer/picker
../../go/pkg/mod/github.com/coreos/etcd@v3.3.22+incompatible/clientv3/balancer/picker/err.go:37:44: undefined: balancer.PickOptions
../../go/pkg/mod/github.com/coreos/etcd@v3.3.22+incompatible/clientv3/balancer/picker/roundrobin_balanced.go:55:54: undefined: balancer.PickOptions

https://segmentfault.com/q/10...

micro env

env Get/set micro cli environment

 $ micro env
  local      none
* server     127.0.0.1:8081
  platform   proxy.m3o.com  
# set to use server
micro env set server

grpc api 和 http api 映射

https://m3o.com/docs/go-api.h...

比如 rpc call 如下

micro call go.micro.service.posts Posts.Query '{"slug":"how-to-micro"}'

对于http请求可以用 /rpc
参数 service, method, request

## post
curl -X "POST" "http://127.0.0.1:8082/rpc" \
     -H 'Content-Type: application/json; charset=utf-8' \
     -d $'{
  "service": "go.micro.service.posts",
  "": "Posts.Query",
  "request": {
    "slug": "how-to-micro"
  }
}'

lidashuang
6.7k 声望165 粉丝

$ Ruby/Elixir/Golang