xlsxgen

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestParseFileOptions

func TestParseFileOptions(fd protoreflect.FileDescriptor) (string, *tableaupb.WorkbookOptions)

TestParseFileOptions is aimed to parse the options of a protobuf definition file.

func TestParseMessageOptions

func TestParseMessageOptions(md protoreflect.MessageDescriptor) (string, string, int32, int32, int32, bool)

TestParseMessageOptions is aimed to parse the options of a protobuf message.

Types

type Cell

type Cell struct {
	Data string
}

type Generator

type Generator struct {
	ProtoPackage string // protobuf package name.
	InputDir     string // input dir of workbooks.
	OutputDir    string // output dir of generated protoconf files.
	Workbook     string // Workbook name
}

func (*Generator) ExportSheet added in v0.7.5

func (gen *Generator) ExportSheet(metaSheet *MetaSheet) error

ExportSheet export a worksheet.

func (*Generator) Generate

func (gen *Generator) Generate()

func (*Generator) TestParseFieldOptions

func (gen *Generator) TestParseFieldOptions(md protoreflect.MessageDescriptor, row *[]Cell, depth int, prefix string)

TestParseFieldOptions is aimed to parse the options of all the fields of a protobuf message.

type MetaSheet added in v0.7.5

type MetaSheet struct {
	Worksheet string // worksheet name
	options.HeaderOption
	Transpose bool // interchange the rows and columns
	Rows      []Row
	// contains filtered or unexported fields
}

func NewMetaSheet added in v0.7.5

func NewMetaSheet(worksheet string, header *options.HeaderOption, transpose bool) *MetaSheet

func (*MetaSheet) Cell added in v0.7.5

func (sheet *MetaSheet) Cell(row int, name string) *Cell

func (*MetaSheet) ForEachCol added in v0.7.5

func (sheet *MetaSheet) ForEachCol(rowId int, f func(name string, cell *Cell) error) error

func (*MetaSheet) GetColType added in v0.7.5

func (sheet *MetaSheet) GetColType(col string) string

func (*MetaSheet) GetDefaultValue added in v0.7.5

func (sheet *MetaSheet) GetDefaultValue(col string) string

func (*MetaSheet) GetLastColName added in v0.7.5

func (sheet *MetaSheet) GetLastColName() string

func (*MetaSheet) NewRow added in v0.7.5

func (sheet *MetaSheet) NewRow() *Row

func (*MetaSheet) SetColNote added in v0.7.5

func (sheet *MetaSheet) SetColNote(col, note string)

func (*MetaSheet) SetColType added in v0.7.5

func (sheet *MetaSheet) SetColType(col, typ string)

func (*MetaSheet) SetDefaultValue added in v0.7.5

func (sheet *MetaSheet) SetDefaultValue(col, defaultVal string)

type Row

type Row struct {
	Cells []Cell
	Index int
}

Jump to

Keyboard shortcuts

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