Documentation ¶
Overview ¶
Package cliproto contains helper functionality for protoc plugins.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Env ¶
type Env interface { // Stderr is the stderr. // // If no value was passed when the Env was created, this will return io.EOF on any call. Stderr() io.Writer // Getenv is the equivalent of os.Getenv. Getenv(key string) string }
Env is an execution environment for the plugin.
This is a partial of clienv.Env.
type Handler ¶
type Handler interface { // Handle handles the request. // // Only system errors should be returned. Handle( env Env, responseWriter ResponseWriter, request *plugin_go.CodeGeneratorRequest, ) }
Handler handles protoc plugin functionality.
type HandlerFunc ¶
type HandlerFunc func( Env, ResponseWriter, *plugin_go.CodeGeneratorRequest, )
HandlerFunc is a function that implements Handler.
func (HandlerFunc) Handle ¶
func (h HandlerFunc) Handle( env Env, responseWriter ResponseWriter, request *plugin_go.CodeGeneratorRequest, )
Handle implements Handler.
type ResponseWriter ¶
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.