Documentation ¶
Index ¶
- func EmitError(err error)
- func EmitFiles(out []*plugin.CodeGeneratorResponse_File)
- func EmitResp(resp *plugin.CodeGeneratorResponse)
- func GenerateFromBaseTemplate(tmpl *template.Template, registry *descriptor.Registry, file *descriptor.File) (string, error)
- func GenerateFromTemplate(tmpl *template.Template, data interface{}) (string, error)
- func LoadTemplate(templateData []byte, err error) *template.Template
- func RegisterExtension(ext *proto.ExtensionDesc)
- func RegisterTmplFunc(name string, f interface{})
- func Run(generator ProtocGenerator)
- func RunWithBaseTemplate(targetFileNameFmt string, tmpl *template.Template)
- type BaseTemplateData
- type GeneratorFunc
- type ProtocGenerator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EmitFiles ¶
func EmitFiles(out []*plugin.CodeGeneratorResponse_File)
func EmitResp ¶
func EmitResp(resp *plugin.CodeGeneratorResponse)
func GenerateFromBaseTemplate ¶
func GenerateFromBaseTemplate(tmpl *template.Template, registry *descriptor.Registry, file *descriptor.File) (string, error)
func GenerateFromTemplate ¶
func RegisterExtension ¶
func RegisterExtension(ext *proto.ExtensionDesc)
func RegisterTmplFunc ¶
func RegisterTmplFunc(name string, f interface{})
func Run ¶
func Run(generator ProtocGenerator)
func RunWithBaseTemplate ¶
Types ¶
type BaseTemplateData ¶
type BaseTemplateData struct { Now time.Time File *descriptor.File // contains filtered or unexported fields }
func GetBaseTemplateData ¶
func GetBaseTemplateData(registry *descriptor.Registry, file *descriptor.File) *BaseTemplateData
func (*BaseTemplateData) ResolveFile ¶
func (data *BaseTemplateData) ResolveFile(fileName string) *descriptor.File
func (*BaseTemplateData) ResolveMsgType ¶
func (data *BaseTemplateData) ResolveMsgType(msgType string) string
type GeneratorFunc ¶
type GeneratorFunc func(target string, registry *descriptor.Registry, file *descriptor.File) (string, string, error)
func (GeneratorFunc) Generate ¶
func (f GeneratorFunc) Generate(target string, registry *descriptor.Registry, file *descriptor.File) (string, string, error)
type ProtocGenerator ¶
type ProtocGenerator interface {
Generate(target string, registry *descriptor.Registry, file *descriptor.File) (string, string, error)
}
Click to show internal directories.
Click to hide internal directories.