pkgenerator

package
v0.0.0-...-7015509 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 1, 2023 License: MIT Imports: 11 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(plugin Plugin)

Types

type Plugin

type Plugin interface {
	// Name identifies the plugin.
	Name() string

	// Version identifies the plugin version.
	Version() string

	// ParamFunc used for accept parameters from the command line,.
	ParamFunc() func(name, value string) error

	// Init is called once before code generated.
	// The `file` will be ignored if return false.
	Init(pp *protogen.Plugin, file *protogen.File) bool

	// Generate to generate codes for specified file.
	// except for the imports, by calling the generator's methods P, In, and Out.
	Generate(g *protogen.GeneratedFile)
}

A Plugin provides functionality to add to the output during Go code generation, such as to produce RPC stubs.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL