Documentation
¶
Overview ¶
Package appproto contains helper functionality for protoc plugins.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Main ¶
func Main( ctx context.Context, f func( ctx context.Context, container app.EnvStderrContainer, responseWriter ResponseWriter, request *pluginpb.CodeGeneratorRequest, ), )
Main runs the application using the OS Container and calling os.Exit on the return value of Run.
func Run ¶
func Run( ctx context.Context, container app.Container, f func( ctx context.Context, container app.EnvStderrContainer, responseWriter ResponseWriter, request *pluginpb.CodeGeneratorRequest, ), ) error
Run runs the application using the container.
Types ¶
type ResponseWriter ¶
type ResponseWriter interface {
// WriteCodeGeneratorResponseFile adds the file to the response.
//
// Can be called multiple times.
WriteCodeGeneratorResponseFile(*pluginpb.CodeGeneratorResponse_File)
// WriteError writes the error to the response.
//
// Can be called multiple times. Errors will be concatenated by newlines.
// Resulting error string will have spaces trimmed before creating the response.
WriteError(string)
}
ResponseWriter is a response writer.
Not thread-safe.
Click to show internal directories.
Click to hide internal directories.