Giter Club home page Giter Club logo

protogen's Introduction

ProtoGen

CLI tool to parse protobuf .proto file to C#, based on protobuf-net, also works on Windows/Mac/Linux.

Purpose

Install

[sudo] npm install -g protogen

Dependency

It comes with protogen.exe, written in C#, and built with Mono.

It works on Windows, and also works on Mac/Linux, if installed following dependencies:

sudo port install protobuf-cpp

Or, with homebrew:

brew install protobuf

How To Use

Same as protogen.exe on Windows.

protogen -i:{infile2} [-i:{infile2}] [-o:{outfile}] [-t:{template}] [-p:{prop}[=value]] [-q] [-d]

Examples:

protogen -i:input.proto -o:output.cs
protogen -i:input.proto -o:output.xml -t:xml
protogen -i:input.proto -o:output.cs -p:datacontract -q
protogen -i:input.proto -o:output.cs -p:observable=true

How It Works

On windows, it just call the protogen.exe.

On Mac/Linux, it use mono to load protogen.exe.

Credits

A small tool created by Raymond Xie, any comments are welcome.

protogen's People

Contributors

floatinghotpot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar

protogen's Issues

oneof Type not Supported

I am trying to use the oneof type in a .proto class

message Entry {
    required string key = 1;
    oneof value {
        uint32 value_int32 = 2;
        uint64 value_int64 = 3;
        double value_double = 4;
        string value_string = 5;
    }
}
message SomeClass {
    ...
    repeated Entry stats = 17;
}

but this is giving me the following errors:

Expected "required", "optional", or "repeated"

Is there any way I can get this data type to be supported?

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.