Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileGenerator ¶
type FileGenerator struct { W *protogen.GeneratedFile // The file to write to F *protogen.File // The proto file descr }
func (FileGenerator) P ¶
func (opt FileGenerator) P(v ...any)
P is a shorthand for (*protogen.GeneratedFile).P()
func (FileGenerator) PComment ¶ added in v1.0.12
func (opt FileGenerator) PComment(comments ...string)
PComment allows multiple lines string as comment.
func (FileGenerator) PCommentf ¶ added in v1.0.12
func (opt FileGenerator) PCommentf(format string, args ...interface{})
PCommentf allows formatted string as comment.
func (FileGenerator) Pf ¶
func (opt FileGenerator) Pf(format string, v ...any)
Pf is same as P, but with formatted string.
type ForEachFileRunner ¶ added in v1.0.12
type ForEachFileRunner interface {
Run(fn func(genOpt GenerateOptions) error)
}
type GenerateOptions ¶ added in v1.0.12
type GenerateOptions struct { FileGenerator PluginInfo }
func (GenerateOptions) PHeader ¶ added in v1.0.12
func (opt GenerateOptions) PHeader(p *protogen.Plugin)
func (GenerateOptions) PPackage ¶ added in v1.0.12
func (opt GenerateOptions) PPackage()
type PluginInfo ¶ added in v1.0.12
type PreForEachFileRunner ¶ added in v1.0.12
type PreForEachFileRunner interface {
ForEachFileThat(fn func(protoFile *protogen.File) bool) ForEachFileRunner
}
func NewForEachFileRunner ¶ added in v1.0.12
func NewForEachFileRunner(info PluginInfo) PreForEachFileRunner
ForEachFileRunner helps to generate one file for each file that is being generated
Click to show internal directories.
Click to hide internal directories.