Git Product home page Git Product logo

protoc-gen-sharpnet's Introduction

protoc-gen-sharpnet

protobuf-net提供的protogen代码生成器缺陷

  • 自解析proto 闭源 非标准proto

  • 无法向后兼容 不支持proto3

  • 解析速度慢

本品特性

  • 使用官方protoc编译器插件架构编写 标准proto

  • 向后兼容 支持proto3的基本语法特性( 暂时不支持 map, oneof等proto3特有特性 )

  • 解析速度快

功能实现及限制

  • 不建议使用嵌套结构及枚举, 不保证导出结果的正确性

安装方法

go get github.com/davyxu/protoc-gen-sharpnet

go install github.com/davyxu/protoc-gen-sharpnet

使用方法

  • 兼容protogen输出的格式

    protoc --plugin=protoc-gen-sharpnet=path\to\protoc-gen-sharpnet --sharpnet_out . --proto_path "." PROTO_FILE

  • 扩展支持hasfield

    protoc --plugin=protoc-gen-sharpnet=path\to\protoc-gen-sharpnet --sharpnet_out use_hasfield:. --proto_path "." PROTO_FILE

    P.S. HasField特性是C++库支持功能, 用于判断某字段是否被序列化(设置)过. 性能上有bool赋值的轻度损耗以及内存轻度损耗

使用情况

本品在商业项目中已大规模使用, 请放心使用.

若发现bug请邮件[email protected]

链接

贡献者

机械教条([email protected]) 提供use_hasfield无效的bug,及fixed等类型的增强

备注

感觉不错请star, 谢谢!

博客: http://www.cppblog.com/sunicdavy

知乎: http://www.zhihu.com/people/xu-bo-62-87

邮箱: [email protected]

protoc-gen-sharpnet's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.