protoc-gen-vmicro

command module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

README

protoc-gen-vmicro

v-micro 的 protoc golang 插件

基于 protoc-gen-go ,实现 v-micro 自定义自动生成代码逻辑

编译

  • Windows
    build.bat
    
  • Linux
    ./build.sh
    

使用方法

protoc -I. --vmicro_out=. hello.proto

需要把 protoc 、 proto-gen-vmicro 拷贝至 hello.proto 所在目录或者系统目录

broadcast.pb.go 相关

通过 g.bat 、 g.sh 生成至 micro/broadcast.pb.go

依赖以下程序:

  • protoc
  • protoc-gen-go

Documentation

Overview

protoc-gen-vmicro is a plugin for the Google protocol buffer compiler to generate Go code. Run it by building this program and putting it in your path with the name

protoc-gen-vmicro

That word 'micro' at the end becomes part of the option string set for the protocol compiler, so once the protocol compiler (protoc) is installed you can run

protoc --micro_out=output_directory --go_out=output_directory input_directory/file.proto

to generate v-micro code for the protocol defined by file.proto. With that input, the output will be written to

output_directory/file.micro.go

The generated code is documented in the package comment for the library.

See the README and documentation for protocol buffers to learn more:

https://developers.google.com/protocol-buffers/

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL