Commit Graph

10 Commits

Author SHA1 Message Date
Clayton Coleman
5f9e7a00b8
Add optional slice and map support to protobuf
Specifying // +protobuf.nullable=true on a Go type that is an alias of a
map or slice will generate a synthetic protobuf message with the type
name that will serialize to the wire in a way that allows the difference
between empty and nil to be recorded.

For instance:

    // +protobuf.nullable=true
    types OptionalMap map[string]string

will create the following message:

    message OptionalMap {
      map<string, string> Items = 1
    }

and generate marshallers that use the presence of OptionalMap to
determine whether the map is nil (rather than Items, which protobuf
provides no way to delineate between empty and nil).
2016-06-27 21:42:02 -07:00
Tim Hockin
92567e1b06 Make go2idl handle vendor dirs 2016-05-08 20:30:38 -07:00
Wojciech Tyczynski
7448cc04e1 Switch to new generator 2016-04-11 08:04:45 +02:00
Daniel Smith
46d12b185e Add 'import-boss': enforce go import restrictions. 2016-01-27 16:18:46 -08:00
Chao Xu
5f0509a351 add SecondClosestCommentLines to go2idl types.Type 2015-12-15 22:30:58 -08:00
Chao Xu
0d7d4c04a2 split Package.Types to Types, Variables and Functions;
add DeclarationOf Kind.
2015-12-03 12:03:47 -08:00
Clayton Coleman
72df8bbfbe Allow go2idl to generate non-Go file types
Remove some indentation from file generation for specific languages,
allow SnippetWriter's io.Writer to be accessed, and add Path to
types.Name for languages where Package and Path can be disjoint.
2015-11-28 17:39:26 -05:00
Chao Xu
75cf28b7df Track Func in Universe 2015-11-24 21:22:30 -08:00
Daniel Smith
4deda6ea98 Vendor in go1.5.1 dependency
* Changes to make vendored packages accept new home.
* Fix go2idl to import vendored packages.
2015-10-21 09:56:36 -07:00
Daniel Smith
5ac9b16ade First iteration of go2idl.
* Add support for pointers, map keys, more builtins, Alias types
* Support for packages & imports
* Add helper functions to types
* change generation interface
* fix naming/ordering
* SnippetWriter for templates
* Naming systems
* Use the standard packages for import resolution
* Documentation
2015-10-21 09:56:36 -07:00