A Plugin provides functionality to add to the output during Go code generation, such as to produce RPC stubs.
| 35 | // A Plugin provides functionality to add to the output during Go code generation, |
| 36 | // such as to produce RPC stubs. |
| 37 | type Plugin interface { |
| 38 | // Name identifies the plugin. |
| 39 | Name() string |
| 40 | // Init is called once after data structures are built but before |
| 41 | // code generation begins. |
| 42 | Init(g *Generator) |
| 43 | // Generate produces the code generated by the plugin for this file, |
| 44 | // except for the imports, by calling the generator's methods P, In, and Out. |
| 45 | Generate(file *FileDescriptor) |
| 46 | // GenerateImports produces the import declarations for this file. |
| 47 | // It is called after Generate. |
| 48 | GenerateImports(file *FileDescriptor, imports map[GoImportPath]GoPackageName) |
| 49 | } |
| 50 | |
| 51 | var plugins []Plugin |
| 52 |
no outgoing calls
no test coverage detected