pluginutils

package
v1.0.25 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindFieldByTextName added in v1.0.21

func FindFieldByTextName(msg *protogen.Message, name string) *protogen.Field

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 PluginInfo struct {
	PluginName        string
	VersionStr        string
	GenFileSuffix     string
	SupportedFeatures uint64
}

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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