Documentation ¶
Index ¶
- Variables
- func AddEntries(name string, e EntriesProto)
- func Generate(dirPath string)
- func ReadAllEntries(dirPath string)
- type CodeEnumComment
- type CodeEnumType
- type CodeFieldComment
- type CodeFieldTags
- type CodeFieldType
- type CodeFunction
- type CodeGenerator
- type CodeGeneratorOption
- func CodeFilePath(filePath string) CodeGeneratorOption
- func CodeFunctions(functions []*CodeFunction) CodeGeneratorOption
- func CodeImportPath(importPath []string) CodeGeneratorOption
- func CodePackageName(packageName string) CodeGeneratorOption
- func CodeStructs(structs []*CodeStruct) CodeGeneratorOption
- func CodeVariables(variables []*CodeVariable) CodeGeneratorOption
- type CodeGeneratorOptions
- type CodeStruct
- type CodeVariable
- type EntriesProto
- type ExcelFieldRaw
- type ExcelFileRaw
- type ExcelRowData
Constants ¶
This section is empty.
Variables ¶
View Source
var ( RowOffset int = 2 // 第一行数据偏移 ColOffset int = 2 // 第一列数据偏移 )
Functions ¶
func AddEntries ¶
func AddEntries(name string, e EntriesProto)
Types ¶
type CodeEnumComment ¶
type CodeEnumComment string
type CodeEnumType ¶
type CodeEnumType int
type CodeFieldComment ¶
type CodeFieldComment string
type CodeFieldTags ¶
type CodeFieldTags string
type CodeFieldType ¶
type CodeFieldType string
type CodeFunction ¶
type CodeFunction struct {
// contains filtered or unexported fields
}
code function
type CodeGenerator ¶
type CodeGenerator struct {
// contains filtered or unexported fields
}
code generator
func NewCodeGenerator ¶
func NewCodeGenerator(options ...CodeGeneratorOption) *CodeGenerator
func (*CodeGenerator) Generate ¶
func (g *CodeGenerator) Generate() error
generate go code starts here
func (*CodeGenerator) P ¶
func (g *CodeGenerator) P(v ...interface{})
type CodeGeneratorOption ¶
type CodeGeneratorOption func(*CodeGeneratorOptions)
func CodeFilePath ¶
func CodeFilePath(filePath string) CodeGeneratorOption
func CodeFunctions ¶
func CodeFunctions(functions []*CodeFunction) CodeGeneratorOption
func CodeImportPath ¶
func CodeImportPath(importPath []string) CodeGeneratorOption
func CodePackageName ¶
func CodePackageName(packageName string) CodeGeneratorOption
func CodeStructs ¶
func CodeStructs(structs []*CodeStruct) CodeGeneratorOption
func CodeVariables ¶
func CodeVariables(variables []*CodeVariable) CodeGeneratorOption
type CodeGeneratorOptions ¶
type CodeGeneratorOptions struct { PackageName string // name of this file's Go package FilePath string ImportPath []string // import path of this file's Go package Structs []*CodeStruct Variables []*CodeVariable Functions []*CodeFunction FileNamePrefix string FileNameSuffix string Comments string }
type CodeVariable ¶
type CodeVariable struct {
// contains filtered or unexported fields
}
code variable
type EntriesProto ¶
type EntriesProto interface {
Load(excelFileRaw *ExcelFileRaw) error
}
Entries should implement Load function
type ExcelFieldRaw ¶
type ExcelFieldRaw struct {
// contains filtered or unexported fields
}
Excel field raw data
type ExcelFileRaw ¶
type ExcelFileRaw struct { Filename string FieldRaw *treemap.Map CellData []ExcelRowData }
Excel file raw data
type ExcelRowData ¶
type ExcelRowData map[string]interface{}
Click to show internal directories.
Click to hide internal directories.