Skip to content

lordhippo/odin-protoc-plugin

Repository files navigation

odin-protoc-plugin

build status

A Protobuf compiler plugin for Odin. It should be used with the runtime odin-protobuf library.

Usage

Put this plugin's binary next to a Protobuf Compiler (protoc) or in the PATH. Then use --odin_out argument to generate Odin files.

Sample output

For this example proto file:

message SearchRequest {
  string query = 1;
  int32 page_number = 2;
  int32 results_per_page = 3;
}

This plugin will generate this Odin output:

SearchRequest :: struct {
  query : string `id:"1" type:"9"`,
  page_number : i32 `id:"2" type:"5"`,
  results_per_page : i32 `id:"3" type:"5"`,
}

Missing features