golang

package
v0.0.0-...-bac99df Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

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 IsGoBaseType

func IsGoBaseType(t string) bool

func SplitPackageName

func SplitPackageName(t string) (packageName string)

func SplitType

func SplitType(t string) (tYpE string)

Types

type Enum

type Enum struct {
	*generator.EnumDescriptor

	Name    string
	Comment string
	Values  []*EnumValue
	Enable0 bool
}

func NewEnum

func NewEnum(g *generator.Generator, ed *generator.EnumDescriptor, commonIndex int) *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

type MessageMap struct {
	Name string
	Key  string
}

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.

Jump to

Keyboard shortcuts

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