codegen

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UsefulFunc = template.FuncMap{}

Functions

func CSTypeName

func CSTypeName(fd *model.FieldDescriptor) string

func CSTypeNameFull

func CSTypeNameFull(fd *model.FieldDescriptor) (ret string)

func ExportSymbolName

func ExportSymbolName(name string) string

func GoTypeName

func GoTypeName(fd *model.FieldDescriptor) string

func IsMessage

func IsMessage(d *model.Descriptor) bool

func TagNumber

func TagNumber(d *model.Descriptor, fd *model.FieldDescriptor) (tag int)

Types

type CodeGen

type CodeGen struct {
	// contains filtered or unexported fields
}

func NewCodeGen

func NewCodeGen(name string) *CodeGen

func (*CodeGen) Code

func (self *CodeGen) Code() string

func (*CodeGen) Data

func (self *CodeGen) Data() []byte

func (*CodeGen) Error

func (self *CodeGen) Error() error

func (*CodeGen) FormatGoCode

func (self *CodeGen) FormatGoCode() *CodeGen

func (*CodeGen) ParseTemplate

func (self *CodeGen) ParseTemplate(textTemplate string, modelData interface{}) *CodeGen

func (*CodeGen) RegisterTemplateFunc

func (self *CodeGen) RegisterTemplateFunc(funcMap template.FuncMap) *CodeGen

func (*CodeGen) WriteBytes

func (self *CodeGen) WriteBytes(data *[]byte) *CodeGen

func (*CodeGen) WriteOutputFile

func (self *CodeGen) WriteOutputFile(outputFileName string) *CodeGen

Jump to

Keyboard shortcuts

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