excel

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RowOffset int = 2 // 第一行数据偏移
	ColOffset int = 2 // 第一列数据偏移
)

Functions

func AddEntries

func AddEntries(name string, e EntriesProto)

func Generate

func Generate(dirPath string)

func ReadAllEntries

func ReadAllEntries(dirPath string)

read all excel entries

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 CodeStruct

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

code struct

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{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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