Documentation
¶
Overview ¶
Package cliplugin contains helper functionality for protoc plugins.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Handler ¶
type Handler interface {
// Handle handles the request.
//
// Only system errors should be returned.
Handle(
stderr io.Writer,
responseWriter ResponseWriter,
request *plugin_go.CodeGeneratorRequest,
)
}
Handler handles protoc plugin functionality.
type HandlerFunc ¶
type HandlerFunc func( io.Writer, ResponseWriter, *plugin_go.CodeGeneratorRequest, )
HandlerFunc is a function that implements Handler.
func (HandlerFunc) Handle ¶
func (h HandlerFunc) Handle( stderr io.Writer, responseWriter ResponseWriter, request *plugin_go.CodeGeneratorRequest, )
Handle implements Handler.
type ResponseWriter ¶ added in v0.2.0
type ResponseWriter interface {
// WriteCodeGeneratorResponseFile adds the file to the response.
//
// Can be called multiple times.
WriteCodeGeneratorResponseFile(*plugin_go.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.