Documentation
¶
Index ¶
- Constants
- func NewExtendedSheetParser(ctx context.Context, protoPackage, locationName string, ...) *sheetParser
- func NewSheetExporter(outputDir string, output *options.ConfOutputOption) *sheetExporter
- func NewSheetParser(ctx context.Context, protoPackage, locationName string, ...) *sheetParser
- func ParseFileOptions(fd protoreflect.FileDescriptor) (string, *tableaupb.WorkbookOptions)
- func ParseMessage(info *SheetInfo, impInfos ...importer.ImporterInfo) (proto.Message, error)
- func ParseMessageOptions(md protoreflect.MessageDescriptor) (string, *tableaupb.WorksheetOptions)
- func PrintPerfStats(gen *Generator)
- type Field
- type Generator
- type SheetInfo
- type SheetParserExtInfo
Constants ¶
View Source
const Version = "0.8.2"
Variables ¶
This section is empty.
Functions ¶
func NewExtendedSheetParser ¶ added in v0.11.0
func NewExtendedSheetParser(ctx context.Context, protoPackage, locationName string, bookOpts *tableaupb.WorkbookOptions, sheetOpts *tableaupb.WorksheetOptions, extInfo *SheetParserExtInfo) *sheetParser
NewExtendedSheetParser creates a new sheet parser with extended info.
func NewSheetExporter ¶
func NewSheetExporter(outputDir string, output *options.ConfOutputOption) *sheetExporter
func NewSheetParser ¶
func NewSheetParser(ctx context.Context, protoPackage, locationName string, opts *tableaupb.WorksheetOptions) *sheetParser
NewSheetParser creates a new sheet parser.
func ParseFileOptions ¶ added in v0.9.0
func ParseFileOptions(fd protoreflect.FileDescriptor) (string, *tableaupb.WorkbookOptions)
ParseFileOptions parse the options of a protobuf definition file.
func ParseMessage ¶ added in v0.10.5
ParseMessage parses multiple importer infos into one protomsg. If an error occurs, then wrap it with KeyModule as ModuleConf ("confgen"), then API user can call `xerrors.NewDesc(err)“ to print the pretty error message.
func ParseMessageOptions ¶ added in v0.9.0
func ParseMessageOptions(md protoreflect.MessageDescriptor) (string, *tableaupb.WorksheetOptions)
ParseMessageOptions parse the options of a protobuf message.
func PrintPerfStats ¶ added in v0.10.0
func PrintPerfStats(gen *Generator)
Types ¶
type Generator ¶
type Generator struct {
ProtoPackage string // protobuf package name.
InputDir string // input dir of workbooks.
OutputDir string // output dir of generated files.
LocationName string // TZ location name.
InputOpt *options.ConfInputOption // Input settings.
OutputOpt *options.ConfOutputOption // output settings.
// Performance stats
PerfStats sync.Map
// contains filtered or unexported fields
}
func NewGenerator ¶
func NewGeneratorWithOptions ¶ added in v0.9.14
func (*Generator) GenWorkbook ¶ added in v0.10.0
bookSpecifier can be:
- only workbook: excel/Item.xlsx
- with worksheet: excel/Item.xlsx#Item (To be implemented)
type SheetInfo ¶ added in v0.10.7
type SheetInfo struct {
ProtoPackage string
LocationName string
PrimaryBookName string
MD protoreflect.MessageDescriptor
BookOpts *tableaupb.WorkbookOptions
SheetOpts *tableaupb.WorksheetOptions
ExtInfo *SheetParserExtInfo
}
func (*SheetInfo) HasScatter ¶ added in v0.10.7
Source Files
¶
Click to show internal directories.
Click to hide internal directories.