protoc

package
v0.8.15 Latest Latest
Warning

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

Go to latest
Published: May 20, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

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 ProtoFile

func ProtoFile(file string) func(*protocArgs)

ProtoFile adds a new input file.

func ProtoFiles

func ProtoFiles(files []string) func(*protocArgs)

func Run

func Run(args ...Arg) error

Run runs the protoc CLI

Types

type Arg

type Arg func(*protocArgs)

Arg represents a protoc CLI argument

func CPPOut

func CPPOut(outDir string) Arg

CPPOut - Generate C++ header and source.

func CSharpOpt

func CSharpOpt(opt, value string) Arg

CSharpOpt - C# Options

func CSharpOut

func CSharpOut(outDir string) Arg

CSharpOut - Generate C# source file.

func Decode

func Decode(messageType string) Arg

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

func DependencyOut(file string) Arg

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

func DescriptorSetIn(files string) Arg

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

func DescriptorSetOut(file string) Arg

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 DocOpt

func DocOpt(value string) Arg

DocOpt - Doc plugin option

func DocOut

func DocOut(outDir string) Arg

DocOut - Generate docs

func Encode

func Encode(messageType string) Arg

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

func ErrorFormat(format string) Arg

ErrorFormat - Set the format in which to print errors. FORMAT may be 'gcc' (the default) or 'msvs' (Microsoft Visual Studio format).

func GoGrpcOpt

func GoGrpcOpt(opt, value string) Arg

GoGrpcOpt - Go grpc plugin option

func GoGrpcOut

func GoGrpcOut(outDir string) Arg

GoGrpcOut - Generate go grpc files

func GoOpt

func GoOpt(opt, value string) Arg

GoOpt - Go plugin option

func GoOut

func GoOut(outDir string) Arg

GoOut - Generate go source files.

func GrpcGatewayOpt

func GrpcGatewayOpt(opt, value string) Arg

GrpcGatewayOpt - Grpc gateway plugin option

func GrpcGatewayOut

func GrpcGatewayOut(outDir string) Arg

GrpcGatewayOut - Generate a go grpc open api gateway.

func Help

func Help() Arg

Help - Show this text and exit.

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 JSOut

func JSOut(outDir string) Arg

JSOut - Generate JavaScript source.

func JavaOut

func JavaOut(outDir string) Arg

JavaOut - Generate Java source file.

func ObjCOut

func ObjCOut(outDir string) Arg

ObjCOut - Generate Objective-C header and source.

func OpenAPIV2Opt

func OpenAPIV2Opt(opt, value string) Arg

OpenAPIV2Opt - Open Api plugin option

func OpenAPIV2Out

func OpenAPIV2Out(outDir string) Arg

OpenAPIV2Out - Generate an Open API v2 definition

func Out

func Out(file string) Arg

Out - output file

func PHPOut

func PHPOut(outDir string) Arg

PHPOut - Generate PHP source file.

func Plugin

func Plugin(executable string) Arg

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

func ProtoPath(path string) Arg

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.

func PythonOut

func PythonOut(outDir string) Arg

PythonOut - Generate Python source file.

func RubyOut

func RubyOut(outDir string) Arg

RubyOut - Generate Ruby source file.

func Version

func Version() Arg

Version - Show version info and exit.

Jump to

Keyboard shortcuts

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