Documentation ¶
Index ¶
- func FindFieldByTextName(msg *protogen.Message, name string) *protogen.Field
- type FileGenerator
- func (opt FileGenerator) P(v ...any)
- func (opt FileGenerator) PComment(comments ...string)
- func (opt FileGenerator) PCommentf(format string, args ...interface{})
- func (opt FileGenerator) PTmpl(tmpl *template.Template, data interface{}, funcs ...template.FuncMap)
- func (opt FileGenerator) PTmplStr(tmpl string, data interface{}, funcs ...template.FuncMap)
- func (opt FileGenerator) Pf(format string, v ...any)
- type ForEachFileRunner
- type GenerateOptions
- type PluginInfo
- type PreForEachFileRunner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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) PTmpl ¶ added in v1.0.21
func (opt FileGenerator) PTmpl(tmpl *template.Template, data interface{}, funcs ...template.FuncMap)
func (FileGenerator) PTmplStr ¶ added in v1.0.21
func (opt FileGenerator) PTmplStr(tmpl string, data interface{}, funcs ...template.FuncMap)
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.