protoc-gen-go-enums

command module
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2021 License: MIT Imports: 10 Imported by: 0

README

protoc-gen-go-enums

A plugin for Protocol Buffers that generates XML and JSON marshal receivers for enums generated from .proto files. It enables enums to be marshaled/unmarshaled from their string variants.

To see an example output go to e2e\e2e.xml.go

Prerequisites

How to build

For building the package run:

task build

or

go build -o protoc-gen-go-enums .

How to run

There is an example .proto file at e2e\e2e.proto for generating it run the following command:

task gen_e2e_proto

or

protoc --plugin protoc-gen-go-enums --go-enums_out=json:e2e --go-enums_out=xml:e2e --proto_path=. --go_out=plugins=grpc:e2e e2e/e2e.proto

The xml or json prefix selects if a .json.go or .xml.go or both should be generated.

The output file will be e2e\e2e.xml.go and e2e/e2e.json.go

How to run tests

task run_e2e

or if you want to rebuild the package and regenerate the e2e.xml.go file run

task e2e_all

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Code generated by protoc-gen-go-xml-enums.
Code generated by protoc-gen-go-xml-enums.

Jump to

Keyboard shortcuts

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