Documentation
¶
Index ¶
- Constants
- Variables
- func DescriptorProtoType(t descriptor.FieldDescriptorProto_Type) string
- func IsGoBaseType(t string) bool
- func SplitPackageName(t string) (packageName string)
- func SplitType(t string) (tYpE string)
- type Enum
- type EnumValue
- type Field
- type File
- type Message
- type MessageMap
- type PluginSuper
Constants ¶
View Source
const (
EnterReplaceString = "\n//"
)
Variables ¶
View Source
var TemplateFunc = template.FuncMap{ "CamelCase": generator.CamelCase, "CamelCaseSlice": generator.CamelCaseSlice, "DescriptorProtoType": DescriptorProtoType, "SplitPackageName": SplitPackageName, "SplitType": SplitType, }
Functions ¶
func DescriptorProtoType ¶
func DescriptorProtoType(t descriptor.FieldDescriptorProto_Type) string
func IsGoBaseType ¶
func SplitPackageName ¶
Types ¶
type Enum ¶
type EnumValue ¶
type EnumValue struct {
*descriptor.EnumValueDescriptorProto
Name string
TypeName string
Value int32
Comment string
}
func NewEnumValue ¶
func NewEnumValue(g *generator.Generator, enumName string, evdp *descriptor.EnumValueDescriptorProto, commentIndex1 int, commentIndex2 int) *EnumValue
type Field ¶
type Field struct {
*descriptor.FieldDescriptorProto
Name string
JsonName string
Comment string
DescriptorProtoType string
IsMap bool
GoType string
GoTypeToName string
MapType *generator.GoMapDescriptor
KeyField *descriptor.FieldDescriptorProto
KeyType string
KeyTypeToName string
ValueField *descriptor.FieldDescriptorProto
ValueType string
ValueTypeToName string
}
func NewField ¶
func NewField(g *generator.Generator, d *generator.Descriptor, fdp *descriptor.FieldDescriptorProto, commentIndex int) *Field
type File ¶
type File struct {
*generator.FileDescriptor
PackageName string
Messages []*Message
Enums []*Enum
}
func NewFile ¶
func NewFile(fd *generator.FileDescriptor) *File
type Message ¶
type Message struct {
*generator.Descriptor
ID string
Name string
Type string
Comment string
Fields []*Field
Maps []*MessageMap
}
func NewMessage ¶
func NewMessage(g *generator.Generator, d *generator.Descriptor) *Message
type MessageMap ¶
func NewMessageMap ¶
func NewMessageMap(name string, key string) *MessageMap
type PluginSuper ¶
type PluginSuper struct {
*generator.Generator
generator.PluginImports
Template *template.Template
}
func NewPluginSuper ¶
func NewPluginSuper() *PluginSuper
func (*PluginSuper) MustLoadTemplate ¶
func (p *PluginSuper) MustLoadTemplate(templateName string, templateContent string, templateFunc template.FuncMap)
Directories
¶
| Path | Synopsis |
|---|---|
|
The code generator for the plugin for the Google protocol buffer compiler.
|
The code generator for the plugin for the Google protocol buffer compiler. |
|
internal/remap
Package remap handles tracking the locations of Go tokens in a source text across a rewrite by the Go formatter.
|
Package remap handles tracking the locations of Go tokens in a source text across a rewrite by the Go formatter. |
|
The testgen plugin generates Test and Benchmark functions for each message.
|
The testgen plugin generates Test and Benchmark functions for each message. |
Click to show internal directories.
Click to hide internal directories.