command
module
Version:
v1.0.3
Opens a new window with list of versions in this module.
Published: Jan 17, 2023
License: MIT
Opens a new window with license information.
Imports: 11
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
protoc-gen-enum-desc
Generate custom description for proto Enum.
Install
go install github.com/nvac/protoc-gen-enum-desc@latest
Usage
-
copy ./proto/nvac/enum_desc.proto
to your proto buffer import path
-
import option nvac.enum_desc
from nvac/enum_desc.proto
syntax = "proto3";
package example;
import "google/protobuf/descriptor.proto";
import "nvac/enum_desc.proto";
option go_package = ".;example";
message User {
Status status = 1;
}
enum Status {
Status_Unspecified = 0 [(nvac.enum_desc) = "UNSPECIFIED"];
Status_Active = 1 [(nvac.enum_desc) = "ACTIVE"];
Status_Deleted = 2 [(nvac.enum_desc) = "DELETED"];
}
-
compile with --enum-desc_out
protoc --proto_path=. \
--proto_path=./proto \
--go_out=paths=source_relative:. \
--enum-desc_out=paths=source_relative:. \
./example/user.proto
Documentation
¶
There is no documentation for this package.
Source Files
¶
Directories
¶
|
|
proto
|
|
|
|
Click to show internal directories.
Click to hide internal directories.