Documentation ¶
Index ¶
- func Add(name, value string) func(*protocArgs)
- func AddArg(arg string) func(*protocArgs)
- func AddOpt(name, opt, value string) func(*protocArgs)
- func ProtoFile(file string) func(*protocArgs)
- func ProtoFiles(files []string) func(*protocArgs)
- func Run(args ...Arg) error
- type Arg
- func CPPOut(outDir string) Arg
- func CSharpOpt(opt, value string) Arg
- func CSharpOut(outDir string) Arg
- func Decode(messageType string) Arg
- func DecodeRaw() Arg
- func DependencyOut(file string) Arg
- func DescriptorSetIn(files string) Arg
- func DescriptorSetOut(file string) Arg
- func DeterministicOutput() Arg
- func DocOpt(value string) Arg
- func DocOut(outDir string) Arg
- func Encode(messageType string) Arg
- func ErrorFormat(format string) Arg
- func GoGrpcOpt(opt, value string) Arg
- func GoGrpcOut(outDir string) Arg
- func GoOpt(opt, value string) Arg
- func GoOut(outDir string) Arg
- func GrpcGatewayOpt(opt, value string) Arg
- func GrpcGatewayOut(outDir string) Arg
- func Help() Arg
- func IncludeImports() Arg
- func IncludeSourceInfo() Arg
- func JSOut(outDir string) Arg
- func JavaOut(outDir string) Arg
- func ObjCOut(outDir string) Arg
- func OpenAPIV2Opt(opt, value string) Arg
- func OpenAPIV2Out(outDir string) Arg
- func Out(file string) Arg
- func PHPOut(outDir string) Arg
- func Plugin(executable string) Arg
- func PrintFreeFieldNumbers() Arg
- func ProtoPath(path string) Arg
- func PythonOut(outDir string) Arg
- func RubyOut(outDir string) Arg
- func Version() Arg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Add ¶
func Add(name, value string) func(*protocArgs)
Add adds a new "name=value" style argument. e.g. --proto_path=./foo
func AddArg ¶
func AddArg(arg string) func(*protocArgs)
AddArg adds a simple argument. e.g. --deterministic_output
func AddOpt ¶
func AddOpt(name, opt, value string) func(*protocArgs)
AddOpt adds a plugin option argument. e.g. --go_opt=paths=source_relative
func ProtoFiles ¶
func ProtoFiles(files []string) func(*protocArgs)
Types ¶
type Arg ¶
type Arg func(*protocArgs)
Arg represents a protoc CLI argument
func Decode ¶
Decode - Read a binary message of the given type from standard input and write it in text format to standard output. The message type must be defined in PROTO_FILES or their imports.
func DecodeRaw ¶
func DecodeRaw() Arg
DecodeRaw - Read an arbitrary protocol message from standard input and write the raw tag/value pairs in text format to standard output. No PROTO_FILES should be given when using this flag.
func DependencyOut ¶
DependencyOut - Write a dependency output file in the format expected by make. This writes the transitive set of input file paths to FILE
func DescriptorSetIn ¶
DescriptorSetIn - Specifies a delimited list of FILES each containing a FileDescriptorSet (a protocol buffer defined in descriptor.proto). The FileDescriptor for each of the PROTO_FILES provided will be loaded from these FileDescriptorSets. If a FileDescriptor appears multiple times, the first occurrence will be used.
func DescriptorSetOut ¶
DescriptorSetOut - Writes a FileDescriptorSet (a protocol buffer, defined in descriptor.proto) containing all of the input files to FILE.
func DeterministicOutput ¶
func DeterministicOutput() Arg
DeterministicOutput - When using --encode, ensure map fields are deterministically ordered. Note thatthis order is not canonical, and changes across builds or releases of protoc.
func Encode ¶
Encode - Read a text-format message of the given type from standard input and write it in binary to standard output. The message type must be defined in PROTO_FILES or their imports.
func ErrorFormat ¶
ErrorFormat - Set the format in which to print errors. FORMAT may be 'gcc' (the default) or 'msvs' (Microsoft Visual Studio format).
func GrpcGatewayOpt ¶
GrpcGatewayOpt - Grpc gateway plugin option
func GrpcGatewayOut ¶
GrpcGatewayOut - Generate a go grpc open api gateway.
func IncludeImports ¶
func IncludeImports() Arg
IncludeImports - When using --descriptor_set_out, also include all dependencies of the input files in the set, so that the set is self-contained.
func IncludeSourceInfo ¶
func IncludeSourceInfo() Arg
IncludeSourceInfo - When using --descriptor_set_out, do not strip SourceCodeInfo from the FileDescriptorProto. This results in vastly larger descriptors that include information about the original location of each decl in the source file as well as surrounding comments.
func OpenAPIV2Out ¶
OpenAPIV2Out - Generate an Open API v2 definition
func Plugin ¶
Plugin - Specifies a plugin executable to use. Normally, protoc searches the PATH for plugins, but you may specify additional executables not in the path using this flag. Additionally, EXECUTABLE may be of the form NAME=PATH, in which case the given plugin name is mapped to the given executable even if the executable's own name differs.
func PrintFreeFieldNumbers ¶
func PrintFreeFieldNumbers() Arg
PrintFreeFieldNumbers - Print the free field numbers of the messages defined in the given proto files. Groups share the same field number space with the parent message. Extension ranges are counted as occupied fields numbers.
func ProtoPath ¶
ProtoPath - Specify the directory in which to search for imports. May be specified multiple times; directories will be searched in order. If not given, the current working directory is used. If not found in any of the these directories, the --descriptor_set_in descriptors will be checked for required proto file.