A Plugin provides functionality to add to the output during Go code generation, such as to produce RPC stubs.
| 55 | // A Plugin provides functionality to add to the output during Go code generation, |
| 56 | // such as to produce RPC stubs. |
| 57 | type Plugin interface { |
| 58 | // Name identifies the plugin. |
| 59 | Name() string |
| 60 | // Init is called once after data structures are built but before |
| 61 | // code generation begins. |
| 62 | Init(g *Generator) |
| 63 | // Generate produces the code generated by the plugin for this file, |
| 64 | // except for the imports, by calling the generator's methods P, In, and Out. |
| 65 | Generate(file *FileDescriptor) |
| 66 | // GenerateImports produces the import declarations for this file. |
| 67 | // It is called after Generate. |
| 68 | GenerateImports(file *FileDescriptor) |
| 69 | } |
| 70 | |
| 71 | var plugins []Plugin |
| 72 |
no outgoing calls
no test coverage detected