Grpc+protobuf learning notes II. Protobuf installation and code generation plug-in

Time:2022-6-18

install

Here, because the environments are inconsistent, we directly use docker to generate

  1. Install docker image
    docker pull uber/prototool

Dockerhub: registry.hub.docker.com/r/uber/pro…
Github: github.com/uber/prototool

  1. Define prototype Yaml configuration (docker container running configuration)

    #Sample configuration. For more configurations, see the official
    generate:
    go_options:
     import_ path: ./  #  Where to import the proto file
    plugins:
     -Name: PHP \
       output: ./gen/php
     -Name: grpc PHP \
       path: grpc_php_plugin
       output: ./gen/php
     -Name: go \go code for generating grpc file
       type: go
       flags: plugins=grpc
       output: ./gen/go
  2. Run container generation code

    The proto file directory runs, or you can specify a directory

    docker run --rm -v $(pwd):/work uber/prototool prototool generate
  3. complete

    Screenshot of directory after generation

Grpc+protobuf learning notes II. Protobuf installation and code generation plug-in

This work adoptsCC agreement, reprint must indicate the author and the link to this article

Recommended Today

Bert incomplete manual 3 Bert training strategy optimization! RoBERTa & SpanBERT

I have read a comment before that Bert proposed a good framework for pre training and downstream migration of two-way language model, but it proposed many training methods with more or less optimization space. In this chapter, on the improvement of the training program, let’s talk about the program given by Roberta and spanbert. We […]